@chrisjowen/wheelhouse 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -56
- package/build/client/_app/immutable/assets/0.CKUND0qa.css +1 -0
- package/build/client/_app/immutable/assets/0.CKUND0qa.css.br +0 -0
- package/build/client/_app/immutable/assets/0.CKUND0qa.css.gz +0 -0
- package/build/client/_app/immutable/assets/DocSheet.CaO2v_qh.css +1 -0
- package/build/client/_app/immutable/assets/DocSheet.CaO2v_qh.css.br +0 -0
- package/build/client/_app/immutable/assets/DocSheet.CaO2v_qh.css.gz +0 -0
- package/build/client/_app/immutable/chunks/08Q01-Mc.js +1 -0
- package/build/client/_app/immutable/chunks/08Q01-Mc.js.br +0 -0
- package/build/client/_app/immutable/chunks/08Q01-Mc.js.gz +0 -0
- package/build/client/_app/immutable/chunks/0TvUxbRv.js +1 -0
- package/build/client/_app/immutable/chunks/0TvUxbRv.js.br +2 -0
- package/build/client/_app/immutable/chunks/0TvUxbRv.js.gz +0 -0
- package/build/client/_app/immutable/chunks/3Of2kn6M.js +5 -0
- package/build/client/_app/immutable/chunks/3Of2kn6M.js.br +0 -0
- package/build/client/_app/immutable/chunks/3Of2kn6M.js.gz +0 -0
- package/build/client/_app/immutable/chunks/5fVeMNeJ.js +1 -0
- package/build/client/_app/immutable/chunks/5fVeMNeJ.js.br +0 -0
- package/build/client/_app/immutable/chunks/5fVeMNeJ.js.gz +0 -0
- package/build/client/_app/immutable/chunks/A8GZ5Uuc.js +1 -0
- package/build/client/_app/immutable/chunks/A8GZ5Uuc.js.br +0 -0
- package/build/client/_app/immutable/chunks/A8GZ5Uuc.js.gz +0 -0
- package/build/client/_app/immutable/chunks/AHy1Hzhf.js +1 -0
- package/build/client/_app/immutable/chunks/AHy1Hzhf.js.br +0 -0
- package/build/client/_app/immutable/chunks/AHy1Hzhf.js.gz +0 -0
- package/build/client/_app/immutable/chunks/B3jXa2LJ.js +1 -0
- package/build/client/_app/immutable/chunks/B3jXa2LJ.js.br +0 -0
- package/build/client/_app/immutable/chunks/B3jXa2LJ.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BEDHe9fo.js +1 -0
- package/build/client/_app/immutable/chunks/BEDHe9fo.js.br +0 -0
- package/build/client/_app/immutable/chunks/BEDHe9fo.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BJ_s8GdZ.js +2 -0
- package/build/client/_app/immutable/chunks/BJ_s8GdZ.js.br +0 -0
- package/build/client/_app/immutable/chunks/BJ_s8GdZ.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BKd0HUNP.js +1 -0
- package/build/client/_app/immutable/chunks/BKd0HUNP.js.br +1 -0
- package/build/client/_app/immutable/chunks/BKd0HUNP.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BLL4xbEj.js +1 -0
- package/build/client/_app/immutable/chunks/BLL4xbEj.js.br +0 -0
- package/build/client/_app/immutable/chunks/BLL4xbEj.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BUUcNufp.js +1 -0
- package/build/client/_app/immutable/chunks/BUUcNufp.js.br +0 -0
- package/build/client/_app/immutable/chunks/BUUcNufp.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BVXUMEgB.js +1 -0
- package/build/client/_app/immutable/chunks/BVXUMEgB.js.br +0 -0
- package/build/client/_app/immutable/chunks/BVXUMEgB.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BY5XjwMm.js +1 -0
- package/build/client/_app/immutable/chunks/BY5XjwMm.js.br +0 -0
- package/build/client/_app/immutable/chunks/BY5XjwMm.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BdZ-2OIO.js +1 -0
- package/build/client/_app/immutable/chunks/BdZ-2OIO.js.br +0 -0
- package/build/client/_app/immutable/chunks/BdZ-2OIO.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BdvB_H6l.js +1 -0
- package/build/client/_app/immutable/chunks/BdvB_H6l.js.br +0 -0
- package/build/client/_app/immutable/chunks/BdvB_H6l.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BkLV0FAz.js +1 -0
- package/build/client/_app/immutable/chunks/BkLV0FAz.js.br +0 -0
- package/build/client/_app/immutable/chunks/BkLV0FAz.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Bm8huziG.js +1 -0
- package/build/client/_app/immutable/chunks/Bm8huziG.js.br +0 -0
- package/build/client/_app/immutable/chunks/Bm8huziG.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BnMEvq-8.js +1 -0
- package/build/client/_app/immutable/chunks/BnMEvq-8.js.br +0 -0
- package/build/client/_app/immutable/chunks/BnMEvq-8.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BngQrigD.js +1 -0
- package/build/client/_app/immutable/chunks/BngQrigD.js.br +0 -0
- package/build/client/_app/immutable/chunks/BngQrigD.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BqQtpLRF.js +5 -0
- package/build/client/_app/immutable/chunks/BqQtpLRF.js.br +0 -0
- package/build/client/_app/immutable/chunks/BqQtpLRF.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Bx2K4OII.js +1 -0
- package/build/client/_app/immutable/chunks/Bx2K4OII.js.br +0 -0
- package/build/client/_app/immutable/chunks/Bx2K4OII.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Bypc6r1_.js +1 -0
- package/build/client/_app/immutable/chunks/Bypc6r1_.js.br +0 -0
- package/build/client/_app/immutable/chunks/Bypc6r1_.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C16DfZ5a.js +1 -0
- package/build/client/_app/immutable/chunks/C16DfZ5a.js.br +1 -0
- package/build/client/_app/immutable/chunks/C16DfZ5a.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C3Yi7wCu.js +1 -0
- package/build/client/_app/immutable/chunks/C3Yi7wCu.js.br +0 -0
- package/build/client/_app/immutable/chunks/C3Yi7wCu.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C3e5IrpE.js +1 -0
- package/build/client/_app/immutable/chunks/C3e5IrpE.js.br +0 -0
- package/build/client/_app/immutable/chunks/C3e5IrpE.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C3o9xHsB.js +1 -0
- package/build/client/_app/immutable/chunks/C3o9xHsB.js.br +0 -0
- package/build/client/_app/immutable/chunks/C3o9xHsB.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C6q0X9xa.js +1 -0
- package/build/client/_app/immutable/chunks/C6q0X9xa.js.br +0 -0
- package/build/client/_app/immutable/chunks/C6q0X9xa.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C74jQQYs.js +1 -0
- package/build/client/_app/immutable/chunks/C74jQQYs.js.br +0 -0
- package/build/client/_app/immutable/chunks/C74jQQYs.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CBHYGBBU.js +4 -0
- package/build/client/_app/immutable/chunks/CBHYGBBU.js.br +0 -0
- package/build/client/_app/immutable/chunks/CBHYGBBU.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CD3hbDYc.js +1 -0
- package/build/client/_app/immutable/chunks/CD3hbDYc.js.br +0 -0
- package/build/client/_app/immutable/chunks/CD3hbDYc.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CE3Ue5FU.js +1 -0
- package/build/client/_app/immutable/chunks/CE3Ue5FU.js.br +0 -0
- package/build/client/_app/immutable/chunks/CE3Ue5FU.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CGGuNYjO.js +1 -0
- package/build/client/_app/immutable/chunks/CGGuNYjO.js.br +0 -0
- package/build/client/_app/immutable/chunks/CGGuNYjO.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CH_9Gtej.js +1 -0
- package/build/client/_app/immutable/chunks/CH_9Gtej.js.br +0 -0
- package/build/client/_app/immutable/chunks/CH_9Gtej.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CIj4gWfs.js +1 -0
- package/build/client/_app/immutable/chunks/CIj4gWfs.js.br +0 -0
- package/build/client/_app/immutable/chunks/CIj4gWfs.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CJ3NIasv.js +1 -0
- package/build/client/_app/immutable/chunks/CJ3NIasv.js.br +0 -0
- package/build/client/_app/immutable/chunks/CJ3NIasv.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CKEJURpk.js +1 -0
- package/build/client/_app/immutable/chunks/CKEJURpk.js.br +0 -0
- package/build/client/_app/immutable/chunks/CKEJURpk.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CPmGhju_.js +1 -0
- package/build/client/_app/immutable/chunks/CPmGhju_.js.br +1 -0
- package/build/client/_app/immutable/chunks/CPmGhju_.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CXcL7cOb.js +1 -0
- package/build/client/_app/immutable/chunks/CXcL7cOb.js.br +0 -0
- package/build/client/_app/immutable/chunks/CXcL7cOb.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CXgAyvD-.js +1 -0
- package/build/client/_app/immutable/chunks/CXgAyvD-.js.br +0 -0
- package/build/client/_app/immutable/chunks/CXgAyvD-.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CZBcpBnY.js +1 -0
- package/build/client/_app/immutable/chunks/CZBcpBnY.js.br +0 -0
- package/build/client/_app/immutable/chunks/CZBcpBnY.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CZPeboo-.js +1 -0
- package/build/client/_app/immutable/chunks/CZPeboo-.js.br +0 -0
- package/build/client/_app/immutable/chunks/CZPeboo-.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Cb-gOV5k.js +1 -0
- package/build/client/_app/immutable/chunks/Cb-gOV5k.js.br +0 -0
- package/build/client/_app/immutable/chunks/Cb-gOV5k.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Cl72MTSX.js +1 -0
- package/build/client/_app/immutable/chunks/Cl72MTSX.js.br +0 -0
- package/build/client/_app/immutable/chunks/Cl72MTSX.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Cl7r7DFs.js +1 -0
- package/build/client/_app/immutable/chunks/Cl7r7DFs.js.br +0 -0
- package/build/client/_app/immutable/chunks/Cl7r7DFs.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Cm8CSK8p.js +1 -0
- package/build/client/_app/immutable/chunks/Cm8CSK8p.js.br +0 -0
- package/build/client/_app/immutable/chunks/Cm8CSK8p.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Cng04DK0.js +1 -0
- package/build/client/_app/immutable/chunks/Cng04DK0.js.br +0 -0
- package/build/client/_app/immutable/chunks/Cng04DK0.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CqOnPLsz.js +1 -0
- package/build/client/_app/immutable/chunks/CqOnPLsz.js.br +0 -0
- package/build/client/_app/immutable/chunks/CqOnPLsz.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Cqy1lT7e.js +1 -0
- package/build/client/_app/immutable/chunks/Cqy1lT7e.js.br +0 -0
- package/build/client/_app/immutable/chunks/Cqy1lT7e.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CrjvgIhR.js +1 -0
- package/build/client/_app/immutable/chunks/CrjvgIhR.js.br +0 -0
- package/build/client/_app/immutable/chunks/CrjvgIhR.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CsRBDrRN.js +1 -0
- package/build/client/_app/immutable/chunks/CsRBDrRN.js.br +0 -0
- package/build/client/_app/immutable/chunks/CsRBDrRN.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CwwFbl61.js +62 -0
- package/build/client/_app/immutable/chunks/CwwFbl61.js.br +0 -0
- package/build/client/_app/immutable/chunks/CwwFbl61.js.gz +0 -0
- package/build/client/_app/immutable/chunks/D0JSbOCt.js +1 -0
- package/build/client/_app/immutable/chunks/D0JSbOCt.js.br +0 -0
- package/build/client/_app/immutable/chunks/D0JSbOCt.js.gz +0 -0
- package/build/client/_app/immutable/chunks/D25j-NnT.js +1 -0
- package/build/client/_app/immutable/chunks/D25j-NnT.js.br +0 -0
- package/build/client/_app/immutable/chunks/D25j-NnT.js.gz +0 -0
- package/build/client/_app/immutable/chunks/D5hwKKRv.js +1 -0
- package/build/client/_app/immutable/chunks/D5hwKKRv.js.br +0 -0
- package/build/client/_app/immutable/chunks/D5hwKKRv.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DBxUIz0k.js +1 -0
- package/build/client/_app/immutable/chunks/DBxUIz0k.js.br +0 -0
- package/build/client/_app/immutable/chunks/DBxUIz0k.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DH7t4M9x.js +1 -0
- package/build/client/_app/immutable/chunks/DH7t4M9x.js.br +0 -0
- package/build/client/_app/immutable/chunks/DH7t4M9x.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DIsXG5DF.js +1 -0
- package/build/client/_app/immutable/chunks/DIsXG5DF.js.br +0 -0
- package/build/client/_app/immutable/chunks/DIsXG5DF.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DNgh8jh8.js +1 -0
- package/build/client/_app/immutable/chunks/DNgh8jh8.js.br +0 -0
- package/build/client/_app/immutable/chunks/DNgh8jh8.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DOWSzKHL.js +1 -0
- package/build/client/_app/immutable/chunks/DOWSzKHL.js.br +0 -0
- package/build/client/_app/immutable/chunks/DOWSzKHL.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DSbOoIPC.js +1 -0
- package/build/client/_app/immutable/chunks/DSbOoIPC.js.br +0 -0
- package/build/client/_app/immutable/chunks/DSbOoIPC.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DUYBhCSA.js +1 -0
- package/build/client/_app/immutable/chunks/DUYBhCSA.js.br +0 -0
- package/build/client/_app/immutable/chunks/DUYBhCSA.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DfDxKk91.js +2 -0
- package/build/client/_app/immutable/chunks/DfDxKk91.js.br +0 -0
- package/build/client/_app/immutable/chunks/DfDxKk91.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DhfQd5fc.js +1 -0
- package/build/client/_app/immutable/chunks/DhfQd5fc.js.br +0 -0
- package/build/client/_app/immutable/chunks/DhfQd5fc.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DmYFgZ4g.js +6 -0
- package/build/client/_app/immutable/chunks/DmYFgZ4g.js.br +0 -0
- package/build/client/_app/immutable/chunks/DmYFgZ4g.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Dn-83VwV.js +1 -0
- package/build/client/_app/immutable/chunks/Dn-83VwV.js.br +1 -0
- package/build/client/_app/immutable/chunks/Dn-83VwV.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Dnnuh6qK.js +1 -0
- package/build/client/_app/immutable/chunks/Dnnuh6qK.js.br +0 -0
- package/build/client/_app/immutable/chunks/Dnnuh6qK.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DocaGLjv.js +1 -0
- package/build/client/_app/immutable/chunks/DocaGLjv.js.br +0 -0
- package/build/client/_app/immutable/chunks/DocaGLjv.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Dqlbq2bD.js +2 -0
- package/build/client/_app/immutable/chunks/Dqlbq2bD.js.br +0 -0
- package/build/client/_app/immutable/chunks/Dqlbq2bD.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DugIbHkD.js +1 -0
- package/build/client/_app/immutable/chunks/DugIbHkD.js.br +0 -0
- package/build/client/_app/immutable/chunks/DugIbHkD.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Dy07EIjs.js +1 -0
- package/build/client/_app/immutable/chunks/Dy07EIjs.js.br +0 -0
- package/build/client/_app/immutable/chunks/Dy07EIjs.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Dy_X9Fgu.js +1 -0
- package/build/client/_app/immutable/chunks/Dy_X9Fgu.js.br +0 -0
- package/build/client/_app/immutable/chunks/Dy_X9Fgu.js.gz +0 -0
- package/build/client/_app/immutable/chunks/I26VQaTs.js +2 -0
- package/build/client/_app/immutable/chunks/I26VQaTs.js.br +0 -0
- package/build/client/_app/immutable/chunks/I26VQaTs.js.gz +0 -0
- package/build/client/_app/immutable/chunks/IsTbwoyV.js +1 -0
- package/build/client/_app/immutable/chunks/IsTbwoyV.js.br +0 -0
- package/build/client/_app/immutable/chunks/IsTbwoyV.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Km1CymxJ.js +1 -0
- package/build/client/_app/immutable/chunks/Km1CymxJ.js.br +0 -0
- package/build/client/_app/immutable/chunks/Km1CymxJ.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Me06-nC7.js +1 -0
- package/build/client/_app/immutable/chunks/Me06-nC7.js.br +0 -0
- package/build/client/_app/immutable/chunks/Me06-nC7.js.gz +0 -0
- package/build/client/_app/immutable/chunks/PQApLOOr.js +1 -0
- package/build/client/_app/immutable/chunks/PQApLOOr.js.br +0 -0
- package/build/client/_app/immutable/chunks/PQApLOOr.js.gz +0 -0
- package/build/client/_app/immutable/chunks/WcvPAxq7.js +1 -0
- package/build/client/_app/immutable/chunks/WcvPAxq7.js.br +0 -0
- package/build/client/_app/immutable/chunks/WcvPAxq7.js.gz +0 -0
- package/build/client/_app/immutable/chunks/ZoG8qKMx.js +1 -0
- package/build/client/_app/immutable/chunks/ZoG8qKMx.js.br +0 -0
- package/build/client/_app/immutable/chunks/ZoG8qKMx.js.gz +0 -0
- package/build/client/_app/immutable/chunks/cZnJ0mAm.js +7 -0
- package/build/client/_app/immutable/chunks/cZnJ0mAm.js.br +0 -0
- package/build/client/_app/immutable/chunks/cZnJ0mAm.js.gz +0 -0
- package/build/client/_app/immutable/chunks/qb_JS6rP.js +1 -0
- package/build/client/_app/immutable/chunks/qb_JS6rP.js.br +0 -0
- package/build/client/_app/immutable/chunks/qb_JS6rP.js.gz +0 -0
- package/build/client/_app/immutable/chunks/riwaJFkb.js +3 -0
- package/build/client/_app/immutable/chunks/riwaJFkb.js.br +0 -0
- package/build/client/_app/immutable/chunks/riwaJFkb.js.gz +0 -0
- package/build/client/_app/immutable/chunks/wDLVOANX.js +2 -0
- package/build/client/_app/immutable/chunks/wDLVOANX.js.br +0 -0
- package/build/client/_app/immutable/chunks/wDLVOANX.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.CNnpPQtw.js +2 -0
- package/build/client/_app/immutable/entry/app.CNnpPQtw.js.br +0 -0
- package/build/client/_app/immutable/entry/app.CNnpPQtw.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.BGpEqKH0.js +1 -0
- package/build/client/_app/immutable/entry/start.BGpEqKH0.js.br +0 -0
- package/build/client/_app/immutable/entry/start.BGpEqKH0.js.gz +0 -0
- package/build/client/_app/immutable/nodes/0.CGlGdRWB.js +8 -0
- package/build/client/_app/immutable/nodes/0.CGlGdRWB.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.CGlGdRWB.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.B4M0q1v4.js +1 -0
- package/build/client/_app/immutable/nodes/1.B4M0q1v4.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.B4M0q1v4.js.gz +0 -0
- package/build/client/_app/immutable/nodes/10.LJhhE6c8.js +3 -0
- package/build/client/_app/immutable/nodes/10.LJhhE6c8.js.br +0 -0
- package/build/client/_app/immutable/nodes/10.LJhhE6c8.js.gz +0 -0
- package/build/client/_app/immutable/nodes/11.CM_xAozz.js +1 -0
- package/build/client/_app/immutable/nodes/11.CM_xAozz.js.br +0 -0
- package/build/client/_app/immutable/nodes/11.CM_xAozz.js.gz +0 -0
- package/build/client/_app/immutable/nodes/12.UENbuJYy.js +14 -0
- package/build/client/_app/immutable/nodes/12.UENbuJYy.js.br +0 -0
- package/build/client/_app/immutable/nodes/12.UENbuJYy.js.gz +0 -0
- package/build/client/_app/immutable/nodes/13.NbAfy9an.js +150 -0
- package/build/client/_app/immutable/nodes/13.NbAfy9an.js.br +0 -0
- package/build/client/_app/immutable/nodes/13.NbAfy9an.js.gz +0 -0
- package/build/client/_app/immutable/nodes/15.BgyPK-jf.js +11 -0
- package/build/client/_app/immutable/nodes/15.BgyPK-jf.js.br +0 -0
- package/build/client/_app/immutable/nodes/15.BgyPK-jf.js.gz +0 -0
- package/build/client/_app/immutable/nodes/16.DcgniGJK.js +9 -0
- package/build/client/_app/immutable/nodes/16.DcgniGJK.js.br +0 -0
- package/build/client/_app/immutable/nodes/16.DcgniGJK.js.gz +0 -0
- package/build/client/_app/immutable/nodes/17.CB9DXHxS.js +2 -0
- package/build/client/_app/immutable/nodes/17.CB9DXHxS.js.br +0 -0
- package/build/client/_app/immutable/nodes/17.CB9DXHxS.js.gz +0 -0
- package/build/client/_app/immutable/nodes/18.BHa-KoGE.js +6 -0
- package/build/client/_app/immutable/nodes/18.BHa-KoGE.js.br +0 -0
- package/build/client/_app/immutable/nodes/18.BHa-KoGE.js.gz +0 -0
- package/build/client/_app/immutable/nodes/19._VaGaWBD.js +1 -0
- package/build/client/_app/immutable/nodes/19._VaGaWBD.js.br +0 -0
- package/build/client/_app/immutable/nodes/19._VaGaWBD.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.DKxd0T79.js +14 -0
- package/build/client/_app/immutable/nodes/2.DKxd0T79.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.DKxd0T79.js.gz +0 -0
- package/build/client/_app/immutable/nodes/20.C10FVhEw.js +10 -0
- package/build/client/_app/immutable/nodes/20.C10FVhEw.js.br +0 -0
- package/build/client/_app/immutable/nodes/20.C10FVhEw.js.gz +0 -0
- package/build/client/_app/immutable/nodes/21.BhyJIr3P.js +6 -0
- package/build/client/_app/immutable/nodes/21.BhyJIr3P.js.br +0 -0
- package/build/client/_app/immutable/nodes/21.BhyJIr3P.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.CcRoRYc-.js +5 -0
- package/build/client/_app/immutable/nodes/3.CcRoRYc-.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.CcRoRYc-.js.gz +0 -0
- package/build/client/_app/immutable/nodes/4.BulJqGnt.js +1 -0
- package/build/client/_app/immutable/nodes/4.BulJqGnt.js.br +0 -0
- package/build/client/_app/immutable/nodes/4.BulJqGnt.js.gz +0 -0
- package/build/client/_app/immutable/nodes/5.BT3hraTU.js +1 -0
- package/build/client/_app/immutable/nodes/5.BT3hraTU.js.br +0 -0
- package/build/client/_app/immutable/nodes/5.BT3hraTU.js.gz +0 -0
- package/build/client/_app/immutable/nodes/6.DtNMha3Y.js +7 -0
- package/build/client/_app/immutable/nodes/6.DtNMha3Y.js.br +0 -0
- package/build/client/_app/immutable/nodes/6.DtNMha3Y.js.gz +0 -0
- package/build/client/_app/immutable/nodes/7.Bv6Vn8eC.js +4 -0
- package/build/client/_app/immutable/nodes/7.Bv6Vn8eC.js.br +0 -0
- package/build/client/_app/immutable/nodes/7.Bv6Vn8eC.js.gz +0 -0
- package/build/client/_app/immutable/nodes/9.DgQz7-Cb.js +1 -0
- package/build/client/_app/immutable/nodes/9.DgQz7-Cb.js.br +0 -0
- package/build/client/_app/immutable/nodes/9.DgQz7-Cb.js.gz +0 -0
- package/build/client/_app/version.json +1 -1
- package/build/client/_app/version.json.br +0 -0
- package/build/client/_app/version.json.gz +0 -0
- package/build/handler.js +7 -7
- package/build/index.js +7 -7
- package/build/server/chunks/chunks/AllowanceMeter.js-DBpmESX6.js +42 -0
- package/build/server/chunks/chunks/DecisionCard.js-B1YgF5EF.js +446 -0
- package/build/server/chunks/chunks/DictateTextarea.js-CbkGsd1h.js +415 -0
- package/build/server/chunks/chunks/DocSheet.js-BPPDMi3P.js +50 -0
- package/build/server/chunks/chunks/EtaLine.js-5SCP9O1f.js +79 -0
- package/build/server/chunks/chunks/EveryProjectSwitch.js-DzcwkHh4.js +200 -0
- package/build/server/chunks/chunks/Icon.js-CVZZ-yuB.js +129 -0
- package/build/server/chunks/chunks/InsightsNav.js-Cmn5y1to.js +18 -0
- package/build/server/chunks/chunks/InstallPlugin.js-B46b-IrK.js +45 -0
- package/build/server/chunks/chunks/LinkedText.js-COjHV297.js +43 -0
- package/build/server/chunks/chunks/ProjectBanner.js-ByPp7Y_e.js +111 -0
- package/build/server/chunks/chunks/ProjectStateMark.js-BkRD8cX4.js +61 -0
- package/build/server/chunks/chunks/QuestionList.js-CppuauNj.js +187 -0
- package/build/server/chunks/chunks/ResizableRail.js-BS8hRLV0.js +395 -0
- package/build/server/chunks/chunks/SettingsNav.js-BtJIv5cc.js +22 -0
- package/build/server/chunks/chunks/SlotContent.js-B4p1QLQN.js +748 -0
- package/build/server/chunks/chunks/StageTrack.js-DHvZX7Bl.js +111 -0
- package/build/server/chunks/chunks/TimeBar.js-CUFKEJW9.js +32 -0
- package/build/server/chunks/chunks/TimeLegend.js-B3Wl61jM.js +29 -0
- package/build/server/chunks/chunks/aliases.svelte.js-C_vCoKdk.js +138 -0
- package/build/server/chunks/chunks/arrow-down.js-Bt3fQooI.js +18 -0
- package/build/server/chunks/chunks/arrow-left.js-BKiSMzvI.js +18 -0
- package/build/server/chunks/chunks/arrow-right.js-CNYqcx0M.js +18 -0
- package/build/server/chunks/chunks/arrow-up.js-DHbXk79z.js +18 -0
- package/build/server/chunks/chunks/attachments.js-BAnnqpd-.js +48 -0
- package/build/server/chunks/chunks/bell.js-CXJp-3UZ.js +150 -0
- package/build/server/chunks/chunks/berths.js-CuAE9lHW.js +268 -0
- package/build/server/chunks/chunks/book-open.js-C2rohN3N.js +23 -0
- package/build/server/chunks/chunks/button.js-BF2PsvWw.js +7311 -0
- package/build/server/chunks/chunks/chat.svelte.js--pRzj_Xo.js +545 -0
- package/build/server/chunks/chunks/check.js-32sYHVxG.js +15 -0
- package/build/server/chunks/chunks/checks.js-DR3fVVpO.js +242 -0
- package/build/server/chunks/chunks/chevron-down.js-CH53s_me.js +15 -0
- package/build/server/chunks/chunks/chevron-left.js-D5RHY-kD.js +15 -0
- package/build/server/chunks/chunks/chevron-right.js-DCBAqAae.js +15 -0
- package/build/server/chunks/chunks/circle-alert.js-XTuAj7ZH.js +23 -0
- package/build/server/chunks/chunks/circle-dashed.js-fXv_bIo-.js +24 -0
- package/build/server/chunks/chunks/circle-dot.js-C950Kosw.js +18 -0
- package/build/server/chunks/chunks/client.js-B_5mNqUe.js +24 -0
- package/build/server/chunks/chunks/clock.js-CHhHTWK_.js +18 -0
- package/build/server/chunks/chunks/compass.js-k2sRSGWn.js +23 -0
- package/build/server/chunks/chunks/detail.js-DDoqeh1A.js +144 -0
- package/build/server/chunks/chunks/docpath.js-D27w_pf9.js +47 -0
- package/build/server/chunks/chunks/external-link.js-BQs1euhR.js +24 -0
- package/build/server/chunks/chunks/file-text.js-CnuVvHlB.js +26 -0
- package/build/server/chunks/chunks/gauge.js-Cbb1aqE7.js +35 -0
- package/build/server/chunks/chunks/git-pull-request.js-BMzktlcs.js +20 -0
- package/build/server/chunks/chunks/hand.js-BA9yKAan.js +25 -0
- package/build/server/chunks/chunks/harbour.js-PHLHOFea.js +117 -0
- package/build/server/chunks/chunks/html.js-FW6Ia4bL.js +8 -0
- package/build/server/chunks/chunks/http.js-CBM8xgUM.js +25 -0
- package/build/server/chunks/chunks/http2.js-fIdVBJaD.js +26 -0
- package/build/server/chunks/chunks/inbox.js-Dv8a1ecX.js +184 -0
- package/build/server/chunks/chunks/inbox.svelte.js-n7K3YnGB.js +171 -0
- package/build/server/chunks/chunks/index-server.js-DsObimPA.js +9 -0
- package/build/server/chunks/chunks/index-server2.js-Fb2GE8KQ.js +17 -0
- package/build/server/chunks/chunks/index.js-B0NFhRTN.js +1524 -0
- package/build/server/chunks/chunks/index2.js-Bxt1T6_K.js +46 -0
- package/build/server/chunks/chunks/internal.js-BlgsFxfY.js +146 -0
- package/build/server/chunks/chunks/live.svelte.js-By2dseJB.js +253 -0
- package/build/server/chunks/chunks/loader-circle.js-rQHvIWN7.js +16 -0
- package/build/server/chunks/chunks/markdown.js-CApgGpeX.js +2634 -0
- package/build/server/chunks/chunks/message-circle-question-mark.js-DbmaS9k_.js +25 -0
- package/build/server/chunks/chunks/message-square-text.js-CyRiNGB8.js +25 -0
- package/build/server/chunks/chunks/message-square.js-XK15WVZq.js +22 -0
- package/build/server/chunks/chunks/messages-square.js-BXH8BHfd.js +28 -0
- package/build/server/chunks/chunks/minus.js-DKvkj8VD.js +15 -0
- package/build/server/chunks/chunks/monitor-play.js-4ed3ghDf.js +28 -0
- package/build/server/chunks/chunks/nav.js-DwnXJgxd.js +29 -0
- package/build/server/chunks/chunks/plus.js-caVrjGZc.js +15 -0
- package/build/server/chunks/chunks/preview.js-hrimfbCG.js +69 -0
- package/build/server/chunks/chunks/prreview.js-Cg9LDxJp.js +92 -0
- package/build/server/chunks/chunks/repo.js-CuWUNKbP.js +33 -0
- package/build/server/chunks/chunks/requests.js-DiL4Poa9.js +42 -0
- package/build/server/chunks/chunks/restart.js-Dv1_ODgZ.js +12 -0
- package/build/server/chunks/chunks/root.js-60iebdW4.js +3105 -0
- package/build/server/chunks/chunks/rotate-cw.js-M4SHOpYI.js +21 -0
- package/build/server/chunks/chunks/runtime.js-BuGWYyZZ.js +16470 -0
- package/build/server/chunks/chunks/scale.js-S5g8YUqL.js +21 -0
- package/build/server/chunks/chunks/scroll-lock.js-Ci_ylINL.js +2811 -0
- package/build/server/chunks/chunks/service.js-DQK1kj-4.js +914 -0
- package/build/server/chunks/chunks/settings.js-C_6kvzhM.js +862 -0
- package/build/server/chunks/chunks/square-terminal.js-D9D9_9_V.js +30 -0
- package/build/server/chunks/chunks/store.js-XXOawxPN.js +317 -0
- package/build/server/chunks/chunks/tone.js-Dxsl-adt.js +31 -0
- package/build/server/chunks/chunks/triangle-alert.js-ClLszsZE.js +25 -0
- package/build/server/chunks/chunks/uploads.js-D45pIvPk.js +107 -0
- package/build/server/chunks/chunks/urls.js-BrlC6XZ8.js +8 -0
- package/build/server/chunks/chunks/utils.js-BJgm9WbO.js +2985 -0
- package/build/server/chunks/chunks/vault.js-CTaWe09z.js +162 -0
- package/build/server/chunks/chunks/view.js-CrOFjYk4.js +76 -0
- package/build/server/chunks/chunks/views.js-DyGxvskG.js +124 -0
- package/build/server/chunks/chunks/words.js-Cte4wOB4.js +48 -0
- package/build/server/chunks/chunks/x.js-YxaUOlq9.js +18 -0
- package/build/server/chunks/entries/endpoints/api/apps/_op_/_server.ts.js-DSkVUNdc.js +90 -0
- package/build/server/chunks/entries/endpoints/api/events/_server.ts.js-CYnLRjOH.js +106 -0
- package/build/server/chunks/entries/endpoints/api/files/_server.ts.js-CG8IGmSp.js +49 -0
- package/build/server/chunks/entries/endpoints/api/firstmate/chat/_server.ts.js-fmzKkrXb.js +83 -0
- package/build/server/chunks/entries/endpoints/api/firstmate/commands/_server.ts.js-BgIU3add.js +119 -0
- package/build/server/chunks/entries/endpoints/api/firstmate/dismiss/_server.ts.js-Ba9E_53E.js +45 -0
- package/build/server/chunks/entries/endpoints/api/firstmate/input/_server.ts.js-BQZBERsR.js +51 -0
- package/build/server/chunks/entries/endpoints/api/firstmate/interrupt/_server.ts.js-BnT3VHSx.js +44 -0
- package/build/server/chunks/entries/endpoints/api/firstmate/messages/_server.ts.js-DRYHwJ7R.js +66 -0
- package/build/server/chunks/entries/endpoints/api/firstmate/pick/_server.ts.js-BD2B1ByG.js +54 -0
- package/build/server/chunks/entries/endpoints/api/firstmate/start/_server.ts.js-DB-m2WWH.js +44 -0
- package/build/server/chunks/entries/endpoints/api/firstmate/uploads/_day_/_id_/_name_/_server.ts.js-CK3swjFX.js +32 -0
- package/build/server/chunks/entries/endpoints/api/firstmate/uploads/_server.ts.js-WCE63uer.js +40 -0
- package/build/server/chunks/entries/endpoints/api/fleet/_server.ts.js-D5-3acjK.js +36 -0
- package/build/server/chunks/entries/endpoints/api/gateway/_server.ts.js-B2I7jHdc.js +100 -0
- package/build/server/chunks/entries/endpoints/api/health/_server.ts.js-BFSqEG5B.js +36 -0
- package/build/server/chunks/entries/endpoints/api/inbox/_server.ts.js-BpUaHfsf.js +60 -0
- package/build/server/chunks/entries/endpoints/api/inbox/report/_server.ts.js-BNRD4HyF.js +51 -0
- package/build/server/chunks/entries/endpoints/api/insights/_server.ts.js-7808SNDM.js +36 -0
- package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/config/_server.ts.js-B-cQTShG.js +71 -0
- package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/load/_server.ts.js-CPAHSih2.js +23 -0
- package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/ui/_...path_/_server.ts.js-DW3M1pzH.js +59 -0
- package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/update/_server.ts.js-DDTSw0pX.js +35 -0
- package/build/server/chunks/entries/endpoints/api/plugins/_server.ts.js-BlD-1l6V.js +36 -0
- package/build/server/chunks/entries/endpoints/api/plugins/inspect/_server.ts.js-IT-jeApI.js +35 -0
- package/build/server/chunks/entries/endpoints/api/plugins/install/_server.ts.js-DQqKN2MF.js +38 -0
- package/build/server/chunks/entries/endpoints/api/plugins/updates/_server.ts.js-D7rx-bwI.js +23 -0
- package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/_server.ts.js-BC0HjK9M.js +41 -0
- package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/commands/_server.ts.js-aVmcjStV.js +50 -0
- package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/consent/_server.ts.js-BuHN_WYU.js +62 -0
- package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/draft/_server.ts.js-Dx0x7sws.js +49 -0
- package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/file/_server.ts.js-CcCDMmmF.js +72 -0
- package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/test/_server.ts.js-BsOOyTNM.js +55 -0
- package/build/server/chunks/entries/endpoints/api/services/_server.ts.js-DGyU8Zmu.js +55 -0
- package/build/server/chunks/entries/endpoints/api/slots/_server.ts.js-1B8fEiat.js +44 -0
- package/build/server/chunks/entries/endpoints/api/tasks/_id_/_server.ts.js-D4CKazw-.js +41 -0
- package/build/server/chunks/entries/endpoints/api/tasks/_id_/artifacts/_...name_/_server.ts.js-CUKo26Ia.js +60 -0
- package/build/server/chunks/entries/endpoints/api/tasks/_id_/diff/_server.ts.js-BOa2lgvP.js +48 -0
- package/build/server/chunks/entries/endpoints/api/tasks/_id_/output/_server.ts.js-BmI8Ofms.js +93 -0
- package/build/server/chunks/entries/endpoints/api/tasks/_id_/preview/_server.ts.js-C2mJi22c.js +110 -0
- package/build/server/chunks/entries/endpoints/api/tasks/_id_/review/_server.ts.js-8pN6fHl8.js +43 -0
- package/build/server/chunks/entries/endpoints/api/tasks/_id_/review/ask/_server.ts.js-D6D9O8Su.js +49 -0
- package/build/server/chunks/entries/endpoints/api/tasks/_id_/review/check/_server.ts.js-BAaCwzOf.js +48 -0
- package/build/server/chunks/entries/endpoints/api/tasks/_id_/review/guide/_server.ts.js-DfP2iNta.js +48 -0
- package/build/server/chunks/entries/endpoints/api/tasks/_id_/review/runs/_run_/stop/_server.ts.js-DZDaSSYT.js +41 -0
- package/build/server/chunks/entries/endpoints/api/vault/_server.ts.js-CJNUplXf.js +54 -0
- package/build/server/chunks/entries/endpoints/api/wheelhouse/update/_server.ts.js-CVqjWsw8.js +23 -0
- package/build/server/chunks/entries/endpoints/api/wheelhouse/upgrade/_server.ts.js-CE2zzWtC.js +23 -0
- package/build/server/chunks/entries/endpoints/projects/_server.ts.js-uMp6dcat.js +7 -0
- package/build/server/chunks/entries/fallbacks/error.svelte.js-DnpcUjRk.js +15 -0
- package/build/server/chunks/entries/hooks.server.js-FjSdw_QS.js +54 -0
- package/build/server/chunks/entries/pages/_layout.server.ts.js-BkWAC802.js +22 -0
- package/build/server/chunks/entries/pages/_layout.svelte.js-DstinFjN.js +8746 -0
- package/build/server/chunks/entries/pages/_page.server.ts.js-BXkuWJh7.js +16 -0
- package/build/server/chunks/entries/pages/_page.svelte.js-ehBbQlco.js +2194 -0
- package/build/server/chunks/entries/pages/decisions/_page.server.ts.js-B2YZfjBk.js +11 -0
- package/build/server/chunks/entries/pages/decisions/_page.svelte.js-C3NsHXP-.js +184 -0
- package/build/server/chunks/entries/pages/files/_page.server.ts.js-CT3pm5a6.js +17 -0
- package/build/server/chunks/entries/pages/files/_page.svelte.js-Bj-5ZaJn.js +61 -0
- package/build/server/chunks/entries/pages/harbour/_page.server.ts.js-CcLkegHq.js +46 -0
- package/build/server/chunks/entries/pages/harbour/_page.svelte.js-hBC6QUHZ.js +580 -0
- package/build/server/chunks/entries/pages/headroom/_page.server.ts.js-BazCFIuz.js +11 -0
- package/build/server/chunks/entries/pages/headroom/_page.svelte.js-BLFQjLz8.js +149 -0
- package/build/server/chunks/entries/pages/inbox/_page.svelte.js-rjm303kf.js +185 -0
- package/build/server/chunks/entries/pages/plugins/_page.server.ts.js-D_nxVVQ0.js +11 -0
- package/build/server/chunks/entries/pages/plugins/_plugin_/_page_/_page.server.ts.js-BRQpg3kQ.js +16 -0
- package/build/server/chunks/entries/pages/plugins/_plugin_/_page_/_page.svelte.js-DazeLLT8.js +52 -0
- package/build/server/chunks/entries/pages/projects/_id_/_page.server.ts.js-BIypd_XU.js +23 -0
- package/build/server/chunks/entries/pages/projects/_id_/_page.svelte.js-DJajtLup.js +945 -0
- package/build/server/chunks/entries/pages/projects/_id_/_plugin_/_tab_/_page.server.ts.js-BwAOIwUv.js +21 -0
- package/build/server/chunks/entries/pages/projects/_id_/_plugin_/_tab_/_page.svelte.js-Cm8mxt61.js +74 -0
- package/build/server/chunks/entries/pages/projects/_id_/passage/_page.server.ts.js-CnfqlJgl.js +27 -0
- package/build/server/chunks/entries/pages/projects/_id_/passage/_page.svelte.js-CuMA-rCM.js +433 -0
- package/build/server/chunks/entries/pages/projects/_id_/passage/edit/_page.server.ts.js-CG14M19O.js +15 -0
- package/build/server/chunks/entries/pages/projects/_id_/passage/edit/_page.svelte.js-mtGQO-dJ.js +1880 -0
- package/build/server/chunks/entries/pages/settings/_page.server.ts.js-DnBg1UuM.js +11 -0
- package/build/server/chunks/entries/pages/settings/gateway/_page.server.ts.js-Zgfe-LX9.js +11 -0
- package/build/server/chunks/entries/pages/settings/gateway/_page.svelte.js-BmbSSxk6.js +208 -0
- package/build/server/chunks/entries/pages/settings/plugins/_page.server.ts.js-DZ4oJmnj.js +19 -0
- package/build/server/chunks/entries/pages/settings/plugins/_page.svelte.js-gBZCjZlg.js +1847 -0
- package/build/server/chunks/entries/pages/settings/plugins/_plugin_/_page.server.ts.js-Dm-tgyir.js +17 -0
- package/build/server/chunks/entries/pages/settings/plugins/_plugin_/_page.svelte.js-BFGxdrrb.js +220 -0
- package/build/server/chunks/entries/pages/tasks/_id_/_page.server.ts.js-Llp3a0Fb.js +25 -0
- package/build/server/chunks/entries/pages/tasks/_id_/_page.svelte.js-LgJMZ2RE.js +2107 -0
- package/build/server/chunks/entries/pages/tasks/_id_/doc/_page.server.ts.js-DuWuEdZ2.js +24 -0
- package/build/server/chunks/entries/pages/tasks/_id_/doc/_page.svelte.js-BOMmvf6G.js +80 -0
- package/build/server/chunks/entries/pages/tasks/_id_/review/_page.server.ts.js-BMQF9I9c.js +15 -0
- package/build/server/chunks/entries/pages/tasks/_id_/review/_page.svelte.js-k659tqiw.js +657 -0
- package/build/server/chunks/entries/pages/time/_page.server.ts.js-DstGu3ji.js +11 -0
- package/build/server/chunks/entries/pages/time/_page.svelte.js-Ckn0YUW_.js +108 -0
- package/build/server/chunks/handler-BRidfBIY.js +1474 -0
- package/build/server/chunks/index.js-Dhoi5wa_.js +4296 -0
- package/build/server/chunks/manifest.js-CF4aVg77.js +537 -0
- package/build/server/chunks/nodes/0.js-B2yTHeOL.js +41 -0
- package/build/server/chunks/nodes/1.js-BoD2_1or.js +9 -0
- package/build/server/chunks/nodes/10.js-C2XmTW8j.js +43 -0
- package/build/server/chunks/nodes/11.js-CAJnQkWH.js +42 -0
- package/build/server/chunks/nodes/12.js-Cu57dOUj.js +43 -0
- package/build/server/chunks/nodes/13.js-1g1BRnk_.js +42 -0
- package/build/server/chunks/nodes/14.js-Cl3VZ6XR.js +12 -0
- package/build/server/chunks/nodes/15.js-BqL5jpLU.js +41 -0
- package/build/server/chunks/nodes/16.js-DibdTAKZ.js +41 -0
- package/build/server/chunks/nodes/17.js-BUFA5Avk.js +44 -0
- package/build/server/chunks/nodes/18.js-cxLrKmMx.js +42 -0
- package/build/server/chunks/nodes/19.js-DMbI3mDp.js +42 -0
- package/build/server/chunks/nodes/2.js-8QSIq2KZ.js +41 -0
- package/build/server/chunks/nodes/20.js-BNXpftag.js +42 -0
- package/build/server/chunks/nodes/21.js-DdJK6h7p.js +41 -0
- package/build/server/chunks/nodes/3.js-DHT7fiTy.js +41 -0
- package/build/server/chunks/nodes/4.js-DvjrLz8n.js +41 -0
- package/build/server/chunks/nodes/5.js-CvUGUQbi.js +45 -0
- package/build/server/chunks/nodes/6.js-ptKHsAn6.js +41 -0
- package/build/server/chunks/nodes/7.js-BigF9SYG.js +9 -0
- package/build/server/chunks/nodes/8.js-D32pPbKa.js +12 -0
- package/build/server/chunks/nodes/9.js-DkS4HHqV.js +41 -0
- package/dist/cli.js +2156 -62
- package/dist/wh-vault.js +1007 -0
- package/package.json +5 -3
- package/plugins/github-issues/.wheelhouse-plugin/plugin.json +44 -0
- package/plugins/github-issues/README.md +16 -0
- package/plugins/github-issues/wheelhouse/server/index.js +463 -0
- package/plugins/project-links/.wheelhouse-plugin/plugin.json +25 -0
- package/plugins/project-links/README.md +17 -0
- package/plugins/project-links/wheelhouse/server/index.js +278 -0
- package/plugins/project-links/wheelhouse/ui/index.js +87 -0
- package/plugins/vault/.wheelhouse-plugin/plugin.json +22 -0
- package/plugins/vault/README.md +18 -0
- package/plugins/vault/wheelhouse/server/index.js +297 -0
- package/build/client/_app/immutable/assets/0.DaQhCSel.css +0 -1
- package/build/client/_app/immutable/assets/0.DaQhCSel.css.br +0 -0
- package/build/client/_app/immutable/assets/0.DaQhCSel.css.gz +0 -0
- package/build/client/_app/immutable/assets/12.DT1C9nmd.css +0 -1
- package/build/client/_app/immutable/assets/12.DT1C9nmd.css.br +0 -0
- package/build/client/_app/immutable/assets/12.DT1C9nmd.css.gz +0 -0
- package/build/client/_app/immutable/assets/14.CjNfSPQ6.css +0 -1
- package/build/client/_app/immutable/assets/14.CjNfSPQ6.css.br +0 -0
- package/build/client/_app/immutable/assets/14.CjNfSPQ6.css.gz +0 -0
- package/build/client/_app/immutable/chunks/36FDwM1G.js +0 -1
- package/build/client/_app/immutable/chunks/36FDwM1G.js.br +0 -0
- package/build/client/_app/immutable/chunks/36FDwM1G.js.gz +0 -0
- package/build/client/_app/immutable/chunks/B1XxiJam.js +0 -1
- package/build/client/_app/immutable/chunks/B1XxiJam.js.br +0 -0
- package/build/client/_app/immutable/chunks/B1XxiJam.js.gz +0 -0
- package/build/client/_app/immutable/chunks/B2wEHue2.js +0 -1
- package/build/client/_app/immutable/chunks/B2wEHue2.js.br +0 -0
- package/build/client/_app/immutable/chunks/B2wEHue2.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BAurN1n6.js +0 -2
- package/build/client/_app/immutable/chunks/BAurN1n6.js.br +0 -0
- package/build/client/_app/immutable/chunks/BAurN1n6.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BEAYWcbT.js +0 -1
- package/build/client/_app/immutable/chunks/BEAYWcbT.js.br +0 -0
- package/build/client/_app/immutable/chunks/BEAYWcbT.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BGINfGsV.js +0 -1
- package/build/client/_app/immutable/chunks/BGINfGsV.js.br +0 -4
- package/build/client/_app/immutable/chunks/BGINfGsV.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BHsdHLbF.js +0 -1
- package/build/client/_app/immutable/chunks/BHsdHLbF.js.br +0 -0
- package/build/client/_app/immutable/chunks/BHsdHLbF.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BR5v76-T.js +0 -1
- package/build/client/_app/immutable/chunks/BR5v76-T.js.br +0 -0
- package/build/client/_app/immutable/chunks/BR5v76-T.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BUo4hMcM.js +0 -1
- package/build/client/_app/immutable/chunks/BUo4hMcM.js.br +0 -0
- package/build/client/_app/immutable/chunks/BUo4hMcM.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BVVO3JPx.js +0 -1
- package/build/client/_app/immutable/chunks/BVVO3JPx.js.br +0 -0
- package/build/client/_app/immutable/chunks/BVVO3JPx.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BZm5e4fE.js +0 -1
- package/build/client/_app/immutable/chunks/BZm5e4fE.js.br +0 -0
- package/build/client/_app/immutable/chunks/BZm5e4fE.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Bfi4vm-w.js +0 -1
- package/build/client/_app/immutable/chunks/Bfi4vm-w.js.br +0 -0
- package/build/client/_app/immutable/chunks/Bfi4vm-w.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BiTivU7x.js +0 -1
- package/build/client/_app/immutable/chunks/BiTivU7x.js.br +0 -0
- package/build/client/_app/immutable/chunks/BiTivU7x.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BiuLIp4b.js +0 -1
- package/build/client/_app/immutable/chunks/BiuLIp4b.js.br +0 -0
- package/build/client/_app/immutable/chunks/BiuLIp4b.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Bns_F-QV.js +0 -1
- package/build/client/_app/immutable/chunks/Bns_F-QV.js.br +0 -0
- package/build/client/_app/immutable/chunks/Bns_F-QV.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Brlpgp90.js +0 -1
- package/build/client/_app/immutable/chunks/Brlpgp90.js.br +0 -0
- package/build/client/_app/immutable/chunks/Brlpgp90.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BunkbzFG.js +0 -1
- package/build/client/_app/immutable/chunks/BunkbzFG.js.br +0 -0
- package/build/client/_app/immutable/chunks/BunkbzFG.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BwOfqJw9.js +0 -1
- package/build/client/_app/immutable/chunks/BwOfqJw9.js.br +0 -0
- package/build/client/_app/immutable/chunks/BwOfqJw9.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C-xrRA1Y.js +0 -1
- package/build/client/_app/immutable/chunks/C-xrRA1Y.js.br +0 -0
- package/build/client/_app/immutable/chunks/C-xrRA1Y.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C2_XZrIO.js +0 -7
- package/build/client/_app/immutable/chunks/C2_XZrIO.js.br +0 -0
- package/build/client/_app/immutable/chunks/C2_XZrIO.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C2d4bDYU.js +0 -1
- package/build/client/_app/immutable/chunks/C2d4bDYU.js.br +0 -0
- package/build/client/_app/immutable/chunks/C2d4bDYU.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C6BQPSOs.js +0 -62
- package/build/client/_app/immutable/chunks/C6BQPSOs.js.br +0 -0
- package/build/client/_app/immutable/chunks/C6BQPSOs.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CDphfOBv.js +0 -1
- package/build/client/_app/immutable/chunks/CDphfOBv.js.br +0 -0
- package/build/client/_app/immutable/chunks/CDphfOBv.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CHoQMvOZ.js +0 -1
- package/build/client/_app/immutable/chunks/CHoQMvOZ.js.br +0 -0
- package/build/client/_app/immutable/chunks/CHoQMvOZ.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CIE0U5Ih.js +0 -1
- package/build/client/_app/immutable/chunks/CIE0U5Ih.js.br +0 -0
- package/build/client/_app/immutable/chunks/CIE0U5Ih.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CLs9Rkbg.js +0 -1
- package/build/client/_app/immutable/chunks/CLs9Rkbg.js.br +0 -0
- package/build/client/_app/immutable/chunks/CLs9Rkbg.js.gz +0 -0
- package/build/client/_app/immutable/chunks/COQ3aAYj.js +0 -1
- package/build/client/_app/immutable/chunks/COQ3aAYj.js.br +0 -0
- package/build/client/_app/immutable/chunks/COQ3aAYj.js.gz +0 -0
- package/build/client/_app/immutable/chunks/COiIt96y.js +0 -1
- package/build/client/_app/immutable/chunks/COiIt96y.js.br +0 -0
- package/build/client/_app/immutable/chunks/COiIt96y.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CQ7gIAH8.js +0 -1
- package/build/client/_app/immutable/chunks/CQ7gIAH8.js.br +0 -2
- package/build/client/_app/immutable/chunks/CQ7gIAH8.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CQlHU-Rx.js +0 -1
- package/build/client/_app/immutable/chunks/CQlHU-Rx.js.br +0 -0
- package/build/client/_app/immutable/chunks/CQlHU-Rx.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CXfdgbLv.js +0 -1
- package/build/client/_app/immutable/chunks/CXfdgbLv.js.br +0 -0
- package/build/client/_app/immutable/chunks/CXfdgbLv.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CeYIQAXD.js +0 -1
- package/build/client/_app/immutable/chunks/CeYIQAXD.js.br +0 -0
- package/build/client/_app/immutable/chunks/CeYIQAXD.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CewXGI4o.js +0 -14
- package/build/client/_app/immutable/chunks/CewXGI4o.js.br +0 -0
- package/build/client/_app/immutable/chunks/CewXGI4o.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CfdzAfq2.js +0 -1
- package/build/client/_app/immutable/chunks/CfdzAfq2.js.br +0 -0
- package/build/client/_app/immutable/chunks/CfdzAfq2.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CkFDaaNz.js +0 -1
- package/build/client/_app/immutable/chunks/CkFDaaNz.js.br +0 -0
- package/build/client/_app/immutable/chunks/CkFDaaNz.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CkLriSVx.js +0 -1
- package/build/client/_app/immutable/chunks/CkLriSVx.js.br +0 -0
- package/build/client/_app/immutable/chunks/CkLriSVx.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Clzs_eXS.js +0 -5
- package/build/client/_app/immutable/chunks/Clzs_eXS.js.br +0 -0
- package/build/client/_app/immutable/chunks/Clzs_eXS.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CrCQ2NNA.js +0 -1
- package/build/client/_app/immutable/chunks/CrCQ2NNA.js.br +0 -0
- package/build/client/_app/immutable/chunks/CrCQ2NNA.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CrgqcyB_.js +0 -1
- package/build/client/_app/immutable/chunks/CrgqcyB_.js.br +0 -0
- package/build/client/_app/immutable/chunks/CrgqcyB_.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CtlVBKf-.js +0 -1
- package/build/client/_app/immutable/chunks/CtlVBKf-.js.br +0 -0
- package/build/client/_app/immutable/chunks/CtlVBKf-.js.gz +0 -0
- package/build/client/_app/immutable/chunks/D4aeBIhU.js +0 -1
- package/build/client/_app/immutable/chunks/D4aeBIhU.js.br +0 -0
- package/build/client/_app/immutable/chunks/D4aeBIhU.js.gz +0 -0
- package/build/client/_app/immutable/chunks/D8Hx-_mj.js +0 -1
- package/build/client/_app/immutable/chunks/D8Hx-_mj.js.br +0 -3
- package/build/client/_app/immutable/chunks/D8Hx-_mj.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DC8T2WRZ.js +0 -1
- package/build/client/_app/immutable/chunks/DC8T2WRZ.js.br +0 -0
- package/build/client/_app/immutable/chunks/DC8T2WRZ.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DGy76IbW.js +0 -2
- package/build/client/_app/immutable/chunks/DGy76IbW.js.br +0 -0
- package/build/client/_app/immutable/chunks/DGy76IbW.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DIABVMrA.js +0 -1
- package/build/client/_app/immutable/chunks/DIABVMrA.js.br +0 -0
- package/build/client/_app/immutable/chunks/DIABVMrA.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DLith9Yi.js +0 -1
- package/build/client/_app/immutable/chunks/DLith9Yi.js.br +0 -0
- package/build/client/_app/immutable/chunks/DLith9Yi.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DPTtvukI.js +0 -1
- package/build/client/_app/immutable/chunks/DPTtvukI.js.br +0 -0
- package/build/client/_app/immutable/chunks/DPTtvukI.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Da92_52d.js +0 -1
- package/build/client/_app/immutable/chunks/Da92_52d.js.br +0 -0
- package/build/client/_app/immutable/chunks/Da92_52d.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Db0WMrvR.js +0 -1
- package/build/client/_app/immutable/chunks/Db0WMrvR.js.br +0 -0
- package/build/client/_app/immutable/chunks/Db0WMrvR.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Dlb_KqyS.js +0 -2
- package/build/client/_app/immutable/chunks/Dlb_KqyS.js.br +0 -0
- package/build/client/_app/immutable/chunks/Dlb_KqyS.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DmcreR7o.js +0 -1
- package/build/client/_app/immutable/chunks/DmcreR7o.js.br +0 -0
- package/build/client/_app/immutable/chunks/DmcreR7o.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Dq9kJk5R.js +0 -1
- package/build/client/_app/immutable/chunks/Dq9kJk5R.js.br +0 -0
- package/build/client/_app/immutable/chunks/Dq9kJk5R.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DxGQT-Hz.js +0 -1
- package/build/client/_app/immutable/chunks/DxGQT-Hz.js.br +0 -0
- package/build/client/_app/immutable/chunks/DxGQT-Hz.js.gz +0 -0
- package/build/client/_app/immutable/chunks/ET-O1REu.js +0 -1
- package/build/client/_app/immutable/chunks/ET-O1REu.js.br +0 -0
- package/build/client/_app/immutable/chunks/ET-O1REu.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Ewrw42Vq.js +0 -1
- package/build/client/_app/immutable/chunks/Ewrw42Vq.js.br +0 -0
- package/build/client/_app/immutable/chunks/Ewrw42Vq.js.gz +0 -0
- package/build/client/_app/immutable/chunks/FQ69txbU.js +0 -1
- package/build/client/_app/immutable/chunks/FQ69txbU.js.br +0 -0
- package/build/client/_app/immutable/chunks/FQ69txbU.js.gz +0 -0
- package/build/client/_app/immutable/chunks/L-6wuY5f.js +0 -2
- package/build/client/_app/immutable/chunks/L-6wuY5f.js.br +0 -0
- package/build/client/_app/immutable/chunks/L-6wuY5f.js.gz +0 -0
- package/build/client/_app/immutable/chunks/M201SoVK.js +0 -1
- package/build/client/_app/immutable/chunks/M201SoVK.js.br +0 -1
- package/build/client/_app/immutable/chunks/M201SoVK.js.gz +0 -0
- package/build/client/_app/immutable/chunks/OeqXO44y.js +0 -1
- package/build/client/_app/immutable/chunks/OeqXO44y.js.br +0 -0
- package/build/client/_app/immutable/chunks/OeqXO44y.js.gz +0 -0
- package/build/client/_app/immutable/chunks/PPVm8Dsz.js +0 -1
- package/build/client/_app/immutable/chunks/PPVm8Dsz.js.br +0 -0
- package/build/client/_app/immutable/chunks/PPVm8Dsz.js.gz +0 -0
- package/build/client/_app/immutable/chunks/QAFSHLn2.js +0 -1
- package/build/client/_app/immutable/chunks/QAFSHLn2.js.br +0 -0
- package/build/client/_app/immutable/chunks/QAFSHLn2.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Tm9AblHs.js +0 -1
- package/build/client/_app/immutable/chunks/Tm9AblHs.js.br +0 -0
- package/build/client/_app/immutable/chunks/Tm9AblHs.js.gz +0 -0
- package/build/client/_app/immutable/chunks/bvY4yrzM.js +0 -4
- package/build/client/_app/immutable/chunks/bvY4yrzM.js.br +0 -0
- package/build/client/_app/immutable/chunks/bvY4yrzM.js.gz +0 -0
- package/build/client/_app/immutable/chunks/eMSiEzFi.js +0 -1
- package/build/client/_app/immutable/chunks/eMSiEzFi.js.br +0 -0
- package/build/client/_app/immutable/chunks/eMSiEzFi.js.gz +0 -0
- package/build/client/_app/immutable/chunks/iVpzjqp1.js +0 -1
- package/build/client/_app/immutable/chunks/iVpzjqp1.js.br +0 -0
- package/build/client/_app/immutable/chunks/iVpzjqp1.js.gz +0 -0
- package/build/client/_app/immutable/chunks/m3YfhLk1.js +0 -1
- package/build/client/_app/immutable/chunks/m3YfhLk1.js.br +0 -0
- package/build/client/_app/immutable/chunks/m3YfhLk1.js.gz +0 -0
- package/build/client/_app/immutable/chunks/p7x6PRF0.js +0 -1
- package/build/client/_app/immutable/chunks/p7x6PRF0.js.br +0 -0
- package/build/client/_app/immutable/chunks/p7x6PRF0.js.gz +0 -0
- package/build/client/_app/immutable/chunks/t4rxsdjl.js +0 -74
- package/build/client/_app/immutable/chunks/t4rxsdjl.js.br +0 -0
- package/build/client/_app/immutable/chunks/t4rxsdjl.js.gz +0 -0
- package/build/client/_app/immutable/chunks/uD7-7yV9.js +0 -1
- package/build/client/_app/immutable/chunks/uD7-7yV9.js.br +0 -4
- package/build/client/_app/immutable/chunks/uD7-7yV9.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.D22_AlD8.js +0 -2
- package/build/client/_app/immutable/entry/app.D22_AlD8.js.br +0 -0
- package/build/client/_app/immutable/entry/app.D22_AlD8.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.xwa7znED.js +0 -1
- package/build/client/_app/immutable/entry/start.xwa7znED.js.br +0 -0
- package/build/client/_app/immutable/entry/start.xwa7znED.js.gz +0 -0
- package/build/client/_app/immutable/nodes/0.DsfUbybd.js +0 -5
- package/build/client/_app/immutable/nodes/0.DsfUbybd.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.DsfUbybd.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.9tnApS8T.js +0 -1
- package/build/client/_app/immutable/nodes/1.9tnApS8T.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.9tnApS8T.js.gz +0 -0
- package/build/client/_app/immutable/nodes/10.CbyVViLq.js +0 -14
- package/build/client/_app/immutable/nodes/10.CbyVViLq.js.br +0 -0
- package/build/client/_app/immutable/nodes/10.CbyVViLq.js.gz +0 -0
- package/build/client/_app/immutable/nodes/11.xg5UTCOx.js +0 -77
- package/build/client/_app/immutable/nodes/11.xg5UTCOx.js.br +0 -0
- package/build/client/_app/immutable/nodes/11.xg5UTCOx.js.gz +0 -0
- package/build/client/_app/immutable/nodes/12.C6hLGaov.js +0 -32
- package/build/client/_app/immutable/nodes/12.C6hLGaov.js.br +0 -0
- package/build/client/_app/immutable/nodes/12.C6hLGaov.js.gz +0 -0
- package/build/client/_app/immutable/nodes/13.DHbTeLkm.js +0 -5
- package/build/client/_app/immutable/nodes/13.DHbTeLkm.js.br +0 -0
- package/build/client/_app/immutable/nodes/13.DHbTeLkm.js.gz +0 -0
- package/build/client/_app/immutable/nodes/14.BMIOGjF-.js +0 -1
- package/build/client/_app/immutable/nodes/14.BMIOGjF-.js.br +0 -0
- package/build/client/_app/immutable/nodes/14.BMIOGjF-.js.gz +0 -0
- package/build/client/_app/immutable/nodes/15.DYSMqa5A.js +0 -10
- package/build/client/_app/immutable/nodes/15.DYSMqa5A.js.br +0 -0
- package/build/client/_app/immutable/nodes/15.DYSMqa5A.js.gz +0 -0
- package/build/client/_app/immutable/nodes/16.B0mX0t_j.js +0 -6
- package/build/client/_app/immutable/nodes/16.B0mX0t_j.js.br +0 -0
- package/build/client/_app/immutable/nodes/16.B0mX0t_j.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.CSYV0jmk.js +0 -4
- package/build/client/_app/immutable/nodes/2.CSYV0jmk.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.CSYV0jmk.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.X5qqsIUa.js +0 -5
- package/build/client/_app/immutable/nodes/3.X5qqsIUa.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.X5qqsIUa.js.gz +0 -0
- package/build/client/_app/immutable/nodes/4.Di4k8SR2.js +0 -3
- package/build/client/_app/immutable/nodes/4.Di4k8SR2.js.br +0 -0
- package/build/client/_app/immutable/nodes/4.Di4k8SR2.js.gz +0 -0
- package/build/client/_app/immutable/nodes/5.DMFYTxVa.js +0 -7
- package/build/client/_app/immutable/nodes/5.DMFYTxVa.js.br +0 -0
- package/build/client/_app/immutable/nodes/5.DMFYTxVa.js.gz +0 -0
- package/build/client/_app/immutable/nodes/6.6yDAURLV.js +0 -4
- package/build/client/_app/immutable/nodes/6.6yDAURLV.js.br +0 -0
- package/build/client/_app/immutable/nodes/6.6yDAURLV.js.gz +0 -0
- package/build/client/_app/immutable/nodes/7.xxvMU05c.js +0 -1
- package/build/client/_app/immutable/nodes/7.xxvMU05c.js.br +0 -0
- package/build/client/_app/immutable/nodes/7.xxvMU05c.js.gz +0 -0
- package/build/client/_app/immutable/nodes/8.GSaWotW8.js +0 -1
- package/build/client/_app/immutable/nodes/8.GSaWotW8.js.br +0 -0
- package/build/client/_app/immutable/nodes/8.GSaWotW8.js.gz +0 -0
- package/build/client/_app/immutable/nodes/9.CEiUwDDg.js +0 -1
- package/build/client/_app/immutable/nodes/9.CEiUwDDg.js.br +0 -0
- package/build/client/_app/immutable/nodes/9.CEiUwDDg.js.gz +0 -0
- package/build/server/chunks/chunks/AllowanceMeter.js-C9jRsAGU.js +0 -42
- package/build/server/chunks/chunks/DecisionCard.js-u1VQ9s_v.js +0 -350
- package/build/server/chunks/chunks/DictateTextarea.js-BlEnOzcN.js +0 -85
- package/build/server/chunks/chunks/EtaLine.js-Pa4_VV6V.js +0 -79
- package/build/server/chunks/chunks/Icon.js-D7CY3joB.js +0 -129
- package/build/server/chunks/chunks/InsightsNav.js-BlxFBJfj.js +0 -22
- package/build/server/chunks/chunks/MicButton.js-BZSQAyuM.js +0 -336
- package/build/server/chunks/chunks/QuestionList.js-DglKezUe.js +0 -259
- package/build/server/chunks/chunks/SlotContent.js-YqZXXtRz.js +0 -1977
- package/build/server/chunks/chunks/StageTrack.js-BaorW-yk.js +0 -59
- package/build/server/chunks/chunks/TimeBar.js-k38rc7ZI.js +0 -32
- package/build/server/chunks/chunks/TimeLegend.js-BQVvgsvs.js +0 -29
- package/build/server/chunks/chunks/access.js-CS2pJasF.js +0 -816
- package/build/server/chunks/chunks/anchor.js-ByXDBfbi.js +0 -20
- package/build/server/chunks/chunks/arrow-down.js-DXDJc9EE.js +0 -18
- package/build/server/chunks/chunks/arrow-left.js-6Yey35CE.js +0 -18
- package/build/server/chunks/chunks/arrow-right.js-CfbPWRqu.js +0 -18
- package/build/server/chunks/chunks/arrow-up.js-AhghNbhW.js +0 -18
- package/build/server/chunks/chunks/bell.js-CAlv92RY.js +0 -143
- package/build/server/chunks/chunks/blocks.js-BL9jLCe-.js +0 -710
- package/build/server/chunks/chunks/bus.svelte.js-DRTptEhF.js +0 -9
- package/build/server/chunks/chunks/button.js-HeBqLheH.js +0 -7311
- package/build/server/chunks/chunks/chat.svelte.js-Cgdbtjbw.js +0 -537
- package/build/server/chunks/chunks/check.js-bmUhmMEz.js +0 -15
- package/build/server/chunks/chunks/checks.js-BnIxIaus.js +0 -175
- package/build/server/chunks/chunks/chevron-down.js-D75hVSIe.js +0 -15
- package/build/server/chunks/chunks/chevron-right.js-yhLg_GaH.js +0 -15
- package/build/server/chunks/chunks/circle-dashed.js-Bm3gZCXK.js +0 -24
- package/build/server/chunks/chunks/client.js-BUNengrw.js +0 -24
- package/build/server/chunks/chunks/clock.js-D7JTvRbC.js +0 -18
- package/build/server/chunks/chunks/compass.js-Tq6uiG8I.js +0 -23
- package/build/server/chunks/chunks/detail.js-CSjOmiVi.js +0 -133
- package/build/server/chunks/chunks/external-link.js-WxVF0xXO.js +0 -24
- package/build/server/chunks/chunks/file-text.js-CAo3vdqd.js +0 -26
- package/build/server/chunks/chunks/gauge.js-Dw9bgE72.js +0 -35
- package/build/server/chunks/chunks/git-pull-request.js-Cx1w8BQr.js +0 -20
- package/build/server/chunks/chunks/hammer.js-fp_Kidfj.js +0 -24
- package/build/server/chunks/chunks/hand.js-xkYPYJZj.js +0 -37
- package/build/server/chunks/chunks/harbour.js-xu7EfIHk.js +0 -113
- package/build/server/chunks/chunks/http.js-TzZuOtxn.js +0 -25
- package/build/server/chunks/chunks/http2.js-Cr9xuMRL.js +0 -26
- package/build/server/chunks/chunks/inbox.js-CW2sFmx9.js +0 -114
- package/build/server/chunks/chunks/inbox.svelte.js-OoKhjjWM.js +0 -134
- package/build/server/chunks/chunks/index-server.js-CtyUzIGY.js +0 -17
- package/build/server/chunks/chunks/index-server2.js-DMc-UvjC.js +0 -19
- package/build/server/chunks/chunks/index.js-Bn6j9diM.js +0 -1524
- package/build/server/chunks/chunks/index2.js-CXaRTuov.js +0 -46
- package/build/server/chunks/chunks/internal.js-Co-6PAQm.js +0 -146
- package/build/server/chunks/chunks/live.svelte.js-BRUTNc9D.js +0 -196
- package/build/server/chunks/chunks/loader-circle.js-IYRaUYWq.js +0 -16
- package/build/server/chunks/chunks/message-circle-question-mark.js-DwrMi0ty.js +0 -25
- package/build/server/chunks/chunks/message-square-text.js-N5uEmy8L.js +0 -25
- package/build/server/chunks/chunks/message-square.js-Hp-6BHgG.js +0 -22
- package/build/server/chunks/chunks/minus.js-bsfnwE-h.js +0 -15
- package/build/server/chunks/chunks/monitor-play.js-B7qbbPH6.js +0 -28
- package/build/server/chunks/chunks/preview.js-CVD-Kwks.js +0 -68
- package/build/server/chunks/chunks/prreview.js-C5XxDIu2.js +0 -85
- package/build/server/chunks/chunks/root.js-CQzYN4Pu.js +0 -3105
- package/build/server/chunks/chunks/runtime.js-C0n924wq.js +0 -13280
- package/build/server/chunks/chunks/scale.js-vP4G0lZM.js +0 -21
- package/build/server/chunks/chunks/shield-check.js-PJLnCKD9.js +0 -23
- package/build/server/chunks/chunks/spec.js-B0yI1XqG.js +0 -307
- package/build/server/chunks/chunks/split.js-BsCU24rQ.js +0 -20
- package/build/server/chunks/chunks/square-terminal.js-D5Z4Sl2-.js +0 -47
- package/build/server/chunks/chunks/tone.js-r2qFVrZC.js +0 -30
- package/build/server/chunks/chunks/trash.js-DYFbRevY.js +0 -46
- package/build/server/chunks/chunks/triangle-alert.js-DuE40HSU.js +0 -38
- package/build/server/chunks/chunks/utils.js-DTSGDHlH.js +0 -2956
- package/build/server/chunks/chunks/view.js-BtcLmKUY.js +0 -76
- package/build/server/chunks/chunks/view2.js-BdUXqNlY.js +0 -87
- package/build/server/chunks/chunks/views.js-B0wP-tuB.js +0 -137
- package/build/server/chunks/chunks/waypoints.js-D3HN7bje.js +0 -67
- package/build/server/chunks/chunks/x.js-tlds9Ooz.js +0 -18
- package/build/server/chunks/entries/endpoints/api/events/_server.ts.js-DNHG661Q.js +0 -93
- package/build/server/chunks/entries/endpoints/api/firstmate/chat/_server.ts.js-XBUQePMq.js +0 -74
- package/build/server/chunks/entries/endpoints/api/firstmate/commands/_server.ts.js-D1tzpRWy.js +0 -110
- package/build/server/chunks/entries/endpoints/api/firstmate/input/_server.ts.js-DqhQUZUA.js +0 -42
- package/build/server/chunks/entries/endpoints/api/firstmate/interrupt/_server.ts.js-LsZer0Bi.js +0 -35
- package/build/server/chunks/entries/endpoints/api/firstmate/messages/_server.ts.js-DQob0XkJ.js +0 -57
- package/build/server/chunks/entries/endpoints/api/firstmate/pick/_server.ts.js-DgFjtYYL.js +0 -45
- package/build/server/chunks/entries/endpoints/api/firstmate/start/_server.ts.js-DOoA4rRW.js +0 -35
- package/build/server/chunks/entries/endpoints/api/fleet/_server.ts.js-DZQsFY87.js +0 -27
- package/build/server/chunks/entries/endpoints/api/health/_server.ts.js-DuSzTlq5.js +0 -27
- package/build/server/chunks/entries/endpoints/api/inbox/_server.ts.js-C15XwPXH.js +0 -51
- package/build/server/chunks/entries/endpoints/api/insights/_server.ts.js--gavJO4f.js +0 -27
- package/build/server/chunks/entries/endpoints/api/plugins/_server.ts.js-CsTy_jT6.js +0 -27
- package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/_server.ts.js-BWOcGtOU.js +0 -32
- package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/commands/_server.ts.js-Kjwbc2wm.js +0 -41
- package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/consent/_server.ts.js-BTIb8CUb.js +0 -53
- package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/draft/_server.ts.js-Vh52yDJ9.js +0 -40
- package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/file/_server.ts.js-LJDJLrpB.js +0 -63
- package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/test/_server.ts.js-CdDBYH6K.js +0 -46
- package/build/server/chunks/entries/endpoints/api/services/_server.ts.js-DoElFmWK.js +0 -46
- package/build/server/chunks/entries/endpoints/api/slots/_server.ts.js-KiiPnPLF.js +0 -35
- package/build/server/chunks/entries/endpoints/api/specs/_id_/_server.ts.js-LMXTPr04.js +0 -59
- package/build/server/chunks/entries/endpoints/api/specs/_id_/build-request/_server.ts.js-bqjJGIjt.js +0 -47
- package/build/server/chunks/entries/endpoints/api/specs/_id_/comments/_comment_/_server.ts.js-DD1qQE9w.js +0 -36
- package/build/server/chunks/entries/endpoints/api/specs/_id_/comments/_server.ts.js-Bby1xkpH.js +0 -57
- package/build/server/chunks/entries/endpoints/api/specs/_id_/images/_name_/_server.ts.js-CPX8OLQa.js +0 -49
- package/build/server/chunks/entries/endpoints/api/specs/_id_/images/_server.ts.js-BjBV4SVl.js +0 -55
- package/build/server/chunks/entries/endpoints/api/specs/_id_/sent/_server.ts.js-BAqm0IW0.js +0 -36
- package/build/server/chunks/entries/endpoints/api/specs/_id_/turn/_server.ts.js-CNFIHA70.js +0 -82
- package/build/server/chunks/entries/endpoints/api/specs/_server.ts.js-Bix9PKKr.js +0 -40
- package/build/server/chunks/entries/endpoints/api/tasks/_id_/_server.ts.js-CT7cLDQU.js +0 -32
- package/build/server/chunks/entries/endpoints/api/tasks/_id_/artifacts/_...name_/_server.ts.js-zCsm8UJT.js +0 -51
- package/build/server/chunks/entries/endpoints/api/tasks/_id_/diff/_server.ts.js-ccyEPbua.js +0 -39
- package/build/server/chunks/entries/endpoints/api/tasks/_id_/output/_server.ts.js-eZPQtK6T.js +0 -84
- package/build/server/chunks/entries/endpoints/api/tasks/_id_/preview/_server.ts.js-CW76hSLW.js +0 -102
- package/build/server/chunks/entries/endpoints/api/tasks/_id_/review/_server.ts.js-Cjuig1dr.js +0 -34
- package/build/server/chunks/entries/endpoints/api/tasks/_id_/review/ask/_server.ts.js-C04r1OFS.js +0 -40
- package/build/server/chunks/entries/endpoints/api/tasks/_id_/review/check/_server.ts.js-Ca5VNJtJ.js +0 -39
- package/build/server/chunks/entries/endpoints/api/tasks/_id_/review/guide/_server.ts.js-BKLIKSUM.js +0 -39
- package/build/server/chunks/entries/endpoints/api/tasks/_id_/review/runs/_run_/stop/_server.ts.js-C-D9zXgK.js +0 -32
- package/build/server/chunks/entries/fallbacks/error.svelte.js-DlN_tCrh.js +0 -15
- package/build/server/chunks/entries/hooks.server.js-Cgq1_RNe.js +0 -40
- package/build/server/chunks/entries/pages/_layout.server.ts.js-B7EWMhm1.js +0 -20
- package/build/server/chunks/entries/pages/_layout.svelte.js-BJuZaosz.js +0 -10454
- package/build/server/chunks/entries/pages/_page.server.ts.js-CrjekE3C.js +0 -16
- package/build/server/chunks/entries/pages/_page.svelte.js-BI4c5H0n.js +0 -3699
- package/build/server/chunks/entries/pages/decisions/_page.server.ts.js-Olm_zS-k.js +0 -11
- package/build/server/chunks/entries/pages/decisions/_page.svelte.js-ClTz3O_K.js +0 -167
- package/build/server/chunks/entries/pages/harbour/_page.server.ts.js-CVhhNUGy.js +0 -20
- package/build/server/chunks/entries/pages/harbour/_page.svelte.js-43FRNSVK.js +0 -1346
- package/build/server/chunks/entries/pages/headroom/_page.server.ts.js-Bv8GukD1.js +0 -11
- package/build/server/chunks/entries/pages/headroom/_page.svelte.js-zmKQdAwy.js +0 -135
- package/build/server/chunks/entries/pages/inbox/_page.svelte.js-wTvAFPNM.js +0 -175
- package/build/server/chunks/entries/pages/plugins/_plugin_/_page_/_page.server.ts.js-BJRmRxez.js +0 -15
- package/build/server/chunks/entries/pages/plugins/_plugin_/_page_/_page.svelte.js-DfAqJJ3i.js +0 -55
- package/build/server/chunks/entries/pages/projects/_id_/_plugin_/_tab_/_page.server.ts.js-DawJ61h-.js +0 -15
- package/build/server/chunks/entries/pages/projects/_id_/_plugin_/_tab_/_page.svelte.js-B472Pugu.js +0 -66
- package/build/server/chunks/entries/pages/projects/_id_/passage/_page.server.ts.js-Cm-4qkeb.js +0 -14
- package/build/server/chunks/entries/pages/projects/_id_/passage/_page.svelte.js-CWjEArXY.js +0 -394
- package/build/server/chunks/entries/pages/projects/_id_/passage/edit/_page.server.ts.js-DWNW8L5o.js +0 -15
- package/build/server/chunks/entries/pages/projects/_id_/passage/edit/_page.svelte.js-iHacn81K.js +0 -1859
- package/build/server/chunks/entries/pages/projects/_page.server.ts.js-BVDM5Frg.js +0 -37
- package/build/server/chunks/entries/pages/projects/_page.svelte.js-B_NQ-Wg3.js +0 -270
- package/build/server/chunks/entries/pages/spec/_page.server.ts.js-B3atEUDm.js +0 -31
- package/build/server/chunks/entries/pages/spec/_page.svelte.js-BJjweG9u.js +0 -1561
- package/build/server/chunks/entries/pages/tasks/_id_/_page.server.ts.js-BDQIO7Ft.js +0 -25
- package/build/server/chunks/entries/pages/tasks/_id_/_page.svelte.js-Dr2wwDJG.js +0 -2063
- package/build/server/chunks/entries/pages/tasks/_id_/doc/_page.server.ts.js-Bw-3fcQ6.js +0 -24
- package/build/server/chunks/entries/pages/tasks/_id_/doc/_page.svelte.js-DOyZ1QzI.js +0 -145
- package/build/server/chunks/entries/pages/tasks/_id_/review/_page.server.ts.js-CJek9uLa.js +0 -15
- package/build/server/chunks/entries/pages/tasks/_id_/review/_page.svelte.js-BDaRELgE.js +0 -692
- package/build/server/chunks/entries/pages/time/_page.server.ts.js-An6F-Ydg.js +0 -11
- package/build/server/chunks/entries/pages/time/_page.svelte.js-CSXGxvVs.js +0 -107
- package/build/server/chunks/handler-BnRz5A8m.js +0 -1474
- package/build/server/chunks/index.js-C8djlQGs.js +0 -4296
- package/build/server/chunks/manifest.js-YAglwkb0.js +0 -434
- package/build/server/chunks/nodes/0.js-lkzICUiD.js +0 -32
- package/build/server/chunks/nodes/1.js-BJHI215Q.js +0 -9
- package/build/server/chunks/nodes/10.js-BWB-fD67.js +0 -33
- package/build/server/chunks/nodes/11.js-DWkXu85W.js +0 -33
- package/build/server/chunks/nodes/12.js-CKTx5eRx.js +0 -37
- package/build/server/chunks/nodes/13.js-C9YUj8Wf.js +0 -33
- package/build/server/chunks/nodes/14.js-CvfRHrCy.js +0 -33
- package/build/server/chunks/nodes/15.js-D_eEoMQb.js +0 -33
- package/build/server/chunks/nodes/16.js-BQhgpvij.js +0 -32
- package/build/server/chunks/nodes/2.js-C-3t-e-a.js +0 -32
- package/build/server/chunks/nodes/3.js-DgwKYi6C.js +0 -32
- package/build/server/chunks/nodes/4.js-DRDQ1cZ6.js +0 -34
- package/build/server/chunks/nodes/5.js-Bn5aoN6C.js +0 -32
- package/build/server/chunks/nodes/6.js-lazTWxVv.js +0 -9
- package/build/server/chunks/nodes/7.js-PUjlFfxr.js +0 -32
- package/build/server/chunks/nodes/8.js-DYPhaWV-.js +0 -34
- package/build/server/chunks/nodes/9.js-C2q_Jaiu.js +0 -32
- /package/build/client/_app/immutable/assets/{15.KLSHp5Yu.css → 20.KLSHp5Yu.css} +0 -0
- /package/build/client/_app/immutable/assets/{15.KLSHp5Yu.css.br → 20.KLSHp5Yu.css.br} +0 -0
- /package/build/client/_app/immutable/assets/{15.KLSHp5Yu.css.gz → 20.KLSHp5Yu.css.gz} +0 -0
- /package/build/client/_app/immutable/assets/{4.5dJKCkOT.css → 5.5dJKCkOT.css} +0 -0
- /package/build/client/_app/immutable/assets/{4.5dJKCkOT.css.br → 5.5dJKCkOT.css.br} +0 -0
- /package/build/client/_app/immutable/assets/{4.5dJKCkOT.css.gz → 5.5dJKCkOT.css.gz} +0 -0
- /package/build/client/_app/immutable/assets/{MicButton.Dga9zAug.css → DictateTextarea.Dga9zAug.css} +0 -0
- /package/build/client/_app/immutable/assets/{MicButton.Dga9zAug.css.br → DictateTextarea.Dga9zAug.css.br} +0 -0
- /package/build/client/_app/immutable/assets/{MicButton.Dga9zAug.css.gz → DictateTextarea.Dga9zAug.css.gz} +0 -0
|
@@ -0,0 +1,2985 @@
|
|
|
1
|
+
import { b as base64_decode } from './utils2.js-BQzn9ikS.js';
|
|
2
|
+
|
|
3
|
+
/** @import { StandardSchemaV1 } from '@standard-schema/spec' */
|
|
4
|
+
|
|
5
|
+
class HttpError {
|
|
6
|
+
/**
|
|
7
|
+
* @param {number} status
|
|
8
|
+
* @param {{message: string} extends App.Error ? (App.Error | string | undefined) : App.Error} body
|
|
9
|
+
*/
|
|
10
|
+
constructor(status, body) {
|
|
11
|
+
this.status = status;
|
|
12
|
+
if (typeof body === 'string') {
|
|
13
|
+
this.body = { message: body };
|
|
14
|
+
} else if (body) {
|
|
15
|
+
this.body = body;
|
|
16
|
+
} else {
|
|
17
|
+
this.body = { message: `Error: ${status}` };
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
toString() {
|
|
22
|
+
return JSON.stringify(this.body);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
class Redirect {
|
|
27
|
+
/**
|
|
28
|
+
* @param {300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308} status
|
|
29
|
+
* @param {string} location
|
|
30
|
+
*/
|
|
31
|
+
constructor(status, location) {
|
|
32
|
+
try {
|
|
33
|
+
new Headers({ location });
|
|
34
|
+
} catch {
|
|
35
|
+
throw new Error(
|
|
36
|
+
`Invalid redirect location ${JSON.stringify(location)}: ` +
|
|
37
|
+
'this string contains characters that cannot be used in HTTP headers'
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
this.status = status;
|
|
42
|
+
this.location = location;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* An error that was thrown from within the SvelteKit runtime that is not fatal and doesn't result in a 500, such as a 404.
|
|
48
|
+
* `SvelteKitError` goes through `handleError`.
|
|
49
|
+
* @extends Error
|
|
50
|
+
*/
|
|
51
|
+
class SvelteKitError extends Error {
|
|
52
|
+
/**
|
|
53
|
+
* @param {number} status
|
|
54
|
+
* @param {string} text
|
|
55
|
+
* @param {string} message
|
|
56
|
+
*/
|
|
57
|
+
constructor(status, text, message) {
|
|
58
|
+
super(message);
|
|
59
|
+
this.status = status;
|
|
60
|
+
this.text = text;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* @template [T=undefined]
|
|
66
|
+
*/
|
|
67
|
+
class ActionFailure {
|
|
68
|
+
/**
|
|
69
|
+
* @param {number} status
|
|
70
|
+
* @param {T} data
|
|
71
|
+
*/
|
|
72
|
+
constructor(status, data) {
|
|
73
|
+
this.status = status;
|
|
74
|
+
this.data = data;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
var defaultParseOptions = {
|
|
79
|
+
decodeValues: true,
|
|
80
|
+
map: false,
|
|
81
|
+
silent: false,
|
|
82
|
+
split: "auto", // auto = split strings but not arrays
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
function isForbiddenKey(key) {
|
|
86
|
+
return typeof key !== "string" || key in {};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function createNullObj() {
|
|
90
|
+
return Object.create(null);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function isNonEmptyString(str) {
|
|
94
|
+
return typeof str === "string" && !!str.trim();
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function parseString(setCookieValue, options) {
|
|
98
|
+
var parts = setCookieValue.split(";").filter(isNonEmptyString);
|
|
99
|
+
|
|
100
|
+
var nameValuePairStr = parts.shift();
|
|
101
|
+
if (!nameValuePairStr) {
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
var parsed = parseNameValuePair(nameValuePairStr);
|
|
105
|
+
var name = parsed.name;
|
|
106
|
+
var value = parsed.value;
|
|
107
|
+
|
|
108
|
+
options = options
|
|
109
|
+
? Object.assign({}, defaultParseOptions, options)
|
|
110
|
+
: defaultParseOptions;
|
|
111
|
+
|
|
112
|
+
if (isForbiddenKey(name)) {
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
try {
|
|
117
|
+
value = options.decodeValues ? decodeURIComponent(value) : value; // decode cookie value
|
|
118
|
+
} catch (e) {
|
|
119
|
+
console.error(
|
|
120
|
+
"set-cookie-parser: failed to decode cookie value. Set options.decodeValues=false to disable decoding.",
|
|
121
|
+
e
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
var cookie = createNullObj();
|
|
126
|
+
cookie.name = name;
|
|
127
|
+
cookie.value = value;
|
|
128
|
+
|
|
129
|
+
parts.forEach(function (part) {
|
|
130
|
+
var sides = part.split("=");
|
|
131
|
+
var key = sides.shift().trim().toLowerCase();
|
|
132
|
+
if (isForbiddenKey(key)) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
var value = sides.join("=").trim();
|
|
136
|
+
if (key === "expires") {
|
|
137
|
+
cookie.expires = new Date(value);
|
|
138
|
+
} else if (key === "max-age") {
|
|
139
|
+
var n = parseInt(value, 10);
|
|
140
|
+
if (!Number.isNaN(n)) cookie.maxAge = n;
|
|
141
|
+
} else if (key === "secure") {
|
|
142
|
+
cookie.secure = true;
|
|
143
|
+
} else if (key === "httponly") {
|
|
144
|
+
cookie.httpOnly = true;
|
|
145
|
+
} else if (key === "samesite") {
|
|
146
|
+
cookie.sameSite = value;
|
|
147
|
+
} else if (key === "partitioned") {
|
|
148
|
+
cookie.partitioned = true;
|
|
149
|
+
} else if (key) {
|
|
150
|
+
cookie[key] = value;
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
return cookie;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function parseNameValuePair(nameValuePairStr) {
|
|
158
|
+
// Parses name-value-pair according to rfc6265bis draft
|
|
159
|
+
|
|
160
|
+
var name = "";
|
|
161
|
+
var value = "";
|
|
162
|
+
var nameValueArr = nameValuePairStr.split("=");
|
|
163
|
+
if (nameValueArr.length > 1) {
|
|
164
|
+
name = nameValueArr.shift();
|
|
165
|
+
value = nameValueArr.join("="); // everything after the first =, joined by a "=" if there was more than one part
|
|
166
|
+
} else {
|
|
167
|
+
value = nameValuePairStr;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// rfc6265 5.2: remove any leading or trailing WSP characters from the name string and the value string
|
|
171
|
+
return { name: trimWsp(name), value: trimWsp(value) };
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// Trims only WSP (SP / HTAB), per rfc6265. Unlike String.prototype.trim(), this leaves other
|
|
175
|
+
// whitespace (e.g. NBSP) alone, and it is linear-time.
|
|
176
|
+
function trimWsp(str) {
|
|
177
|
+
var start = 0;
|
|
178
|
+
var end = str.length;
|
|
179
|
+
while (start < end && isWsp(str.charCodeAt(start))) {
|
|
180
|
+
start += 1;
|
|
181
|
+
}
|
|
182
|
+
while (end > start && isWsp(str.charCodeAt(end - 1))) {
|
|
183
|
+
end -= 1;
|
|
184
|
+
}
|
|
185
|
+
return str.substring(start, end);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function isWsp(code) {
|
|
189
|
+
return code === 0x20 || code === 0x09;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
function parseSetCookie(input, options) {
|
|
193
|
+
options = options
|
|
194
|
+
? Object.assign({}, defaultParseOptions, options)
|
|
195
|
+
: defaultParseOptions;
|
|
196
|
+
|
|
197
|
+
if (!input) {
|
|
198
|
+
if (!options.map) {
|
|
199
|
+
return [];
|
|
200
|
+
} else {
|
|
201
|
+
return createNullObj();
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
if (input.headers) {
|
|
206
|
+
if (typeof input.headers.getSetCookie === "function") {
|
|
207
|
+
// for fetch responses - they combine headers of the same type in the headers array,
|
|
208
|
+
// but getSetCookie returns an uncombined array
|
|
209
|
+
input = input.headers.getSetCookie();
|
|
210
|
+
} else if (input.headers["set-cookie"]) {
|
|
211
|
+
// fast-path for node.js (which automatically normalizes header names to lower-case)
|
|
212
|
+
input = input.headers["set-cookie"];
|
|
213
|
+
} else {
|
|
214
|
+
// slow-path for other environments - see #25
|
|
215
|
+
var sch =
|
|
216
|
+
input.headers[
|
|
217
|
+
Object.keys(input.headers).find(function (key) {
|
|
218
|
+
return key.toLowerCase() === "set-cookie";
|
|
219
|
+
})
|
|
220
|
+
];
|
|
221
|
+
// warn if called on a request-like object with a cookie header rather than a set-cookie header - see #34, 36
|
|
222
|
+
if (!sch && input.headers.cookie && !options.silent) {
|
|
223
|
+
console.warn(
|
|
224
|
+
"Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
input = sch;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
var split = options.split;
|
|
232
|
+
var isArray = Array.isArray(input);
|
|
233
|
+
|
|
234
|
+
if (split === "auto") {
|
|
235
|
+
split = !isArray;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
if (!isArray) {
|
|
239
|
+
input = [input];
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
input = input.filter(isNonEmptyString);
|
|
243
|
+
|
|
244
|
+
if (split) {
|
|
245
|
+
input = input.map(splitCookiesString).flat();
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
if (!options.map) {
|
|
249
|
+
return input
|
|
250
|
+
.map(function (str) {
|
|
251
|
+
return parseString(str, options);
|
|
252
|
+
})
|
|
253
|
+
.filter(Boolean);
|
|
254
|
+
} else {
|
|
255
|
+
var cookies = createNullObj();
|
|
256
|
+
return input.reduce(function (cookies, str) {
|
|
257
|
+
var cookie = parseString(str, options);
|
|
258
|
+
if (cookie && !isForbiddenKey(cookie.name)) {
|
|
259
|
+
cookies[cookie.name] = cookie;
|
|
260
|
+
}
|
|
261
|
+
return cookies;
|
|
262
|
+
}, cookies);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/*
|
|
267
|
+
Set-Cookie header field-values are sometimes comma joined in one string. This splits them without choking on commas
|
|
268
|
+
that are within a single set-cookie field-value, such as in the Expires portion.
|
|
269
|
+
|
|
270
|
+
This is uncommon, but explicitly allowed - see https://tools.ietf.org/html/rfc2616#section-4.2
|
|
271
|
+
Node.js does this for every header *except* set-cookie - see https://github.com/nodejs/node/blob/d5e363b77ebaf1caf67cd7528224b651c86815c1/lib/_http_incoming.js#L128
|
|
272
|
+
React Native's fetch does this for *every* header, including set-cookie.
|
|
273
|
+
|
|
274
|
+
Based on: https://github.com/google/j2objc/commit/16820fdbc8f76ca0c33472810ce0cb03d20efe25
|
|
275
|
+
Credits to: https://github.com/tomball for original and https://github.com/chrusart for JavaScript implementation
|
|
276
|
+
*/
|
|
277
|
+
function splitCookiesString(cookiesString) {
|
|
278
|
+
if (Array.isArray(cookiesString)) {
|
|
279
|
+
return cookiesString;
|
|
280
|
+
}
|
|
281
|
+
if (typeof cookiesString !== "string") {
|
|
282
|
+
return [];
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
var cookiesStrings = [];
|
|
286
|
+
var pos = 0;
|
|
287
|
+
var start;
|
|
288
|
+
var ch;
|
|
289
|
+
var lastComma;
|
|
290
|
+
var nextStart;
|
|
291
|
+
var cookiesSeparatorFound;
|
|
292
|
+
|
|
293
|
+
function skipWhitespace() {
|
|
294
|
+
while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) {
|
|
295
|
+
pos += 1;
|
|
296
|
+
}
|
|
297
|
+
return pos < cookiesString.length;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
function notSpecialChar() {
|
|
301
|
+
ch = cookiesString.charAt(pos);
|
|
302
|
+
|
|
303
|
+
return ch !== "=" && ch !== ";" && ch !== ",";
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
while (pos < cookiesString.length) {
|
|
307
|
+
start = pos;
|
|
308
|
+
cookiesSeparatorFound = false;
|
|
309
|
+
|
|
310
|
+
while (skipWhitespace()) {
|
|
311
|
+
ch = cookiesString.charAt(pos);
|
|
312
|
+
if (ch === ",") {
|
|
313
|
+
// ',' is a cookie separator if we have later first '=', not ';' or ','
|
|
314
|
+
lastComma = pos;
|
|
315
|
+
pos += 1;
|
|
316
|
+
|
|
317
|
+
skipWhitespace();
|
|
318
|
+
nextStart = pos;
|
|
319
|
+
|
|
320
|
+
while (pos < cookiesString.length && notSpecialChar()) {
|
|
321
|
+
pos += 1;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
// currently special character
|
|
325
|
+
if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") {
|
|
326
|
+
// we found cookies separator
|
|
327
|
+
cookiesSeparatorFound = true;
|
|
328
|
+
// pos is inside the next cookie, so back up and return it.
|
|
329
|
+
pos = nextStart;
|
|
330
|
+
cookiesStrings.push(cookiesString.substring(start, lastComma));
|
|
331
|
+
start = pos;
|
|
332
|
+
} else {
|
|
333
|
+
// in param ',' or param separator ';',
|
|
334
|
+
// we continue from that comma
|
|
335
|
+
pos = lastComma + 1;
|
|
336
|
+
}
|
|
337
|
+
} else {
|
|
338
|
+
pos += 1;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
if (!cookiesSeparatorFound || pos >= cookiesString.length) {
|
|
343
|
+
cookiesStrings.push(cookiesString.substring(start, cookiesString.length));
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
return cookiesStrings;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
// named export for CJS
|
|
351
|
+
parseSetCookie.parseSetCookie = parseSetCookie;
|
|
352
|
+
// for backwards compatibility
|
|
353
|
+
parseSetCookie.parse = parseSetCookie;
|
|
354
|
+
parseSetCookie.parseString = parseString;
|
|
355
|
+
parseSetCookie.splitCookiesString = splitCookiesString;
|
|
356
|
+
|
|
357
|
+
const UNDEFINED = -1;
|
|
358
|
+
const HOLE = -2;
|
|
359
|
+
const NAN = -3;
|
|
360
|
+
const POSITIVE_INFINITY = -4;
|
|
361
|
+
const NEGATIVE_INFINITY = -5;
|
|
362
|
+
const NEGATIVE_ZERO = -6;
|
|
363
|
+
const SPARSE = -7;
|
|
364
|
+
|
|
365
|
+
// The largest valid value for a JavaScript array's `length` property,
|
|
366
|
+
// and the largest valid array index (one less than the max length).
|
|
367
|
+
const MAX_ARRAY_LEN = 2 ** 32 - 1;
|
|
368
|
+
const MAX_ARRAY_INDEX = MAX_ARRAY_LEN - 1;
|
|
369
|
+
|
|
370
|
+
/** @type {Record<string, string>} */
|
|
371
|
+
const escaped = {
|
|
372
|
+
'<': '\\u003C',
|
|
373
|
+
'\\': '\\\\',
|
|
374
|
+
'\b': '\\b',
|
|
375
|
+
'\f': '\\f',
|
|
376
|
+
'\n': '\\n',
|
|
377
|
+
'\r': '\\r',
|
|
378
|
+
'\t': '\\t',
|
|
379
|
+
'\u2028': '\\u2028',
|
|
380
|
+
'\u2029': '\\u2029'
|
|
381
|
+
};
|
|
382
|
+
|
|
383
|
+
class DevalueError extends Error {
|
|
384
|
+
/**
|
|
385
|
+
* @param {string} message
|
|
386
|
+
* @param {string[]} keys
|
|
387
|
+
* @param {any} [value] - The value that failed to be serialized
|
|
388
|
+
* @param {any} [root] - The root value being serialized
|
|
389
|
+
*/
|
|
390
|
+
constructor(message, keys, value, root) {
|
|
391
|
+
super(message);
|
|
392
|
+
this.name = 'DevalueError';
|
|
393
|
+
this.path = keys.join('');
|
|
394
|
+
this.value = value;
|
|
395
|
+
this.root = root;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/** @param {any} thing */
|
|
400
|
+
function is_primitive(thing) {
|
|
401
|
+
return thing === null || (typeof thing !== 'object' && typeof thing !== 'function');
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
const object_proto_names = /* @__PURE__ */ Object.getOwnPropertyNames(Object.prototype)
|
|
405
|
+
.sort()
|
|
406
|
+
.join('\0');
|
|
407
|
+
|
|
408
|
+
/** @param {any} thing */
|
|
409
|
+
function is_plain_object(thing) {
|
|
410
|
+
const proto = Object.getPrototypeOf(thing);
|
|
411
|
+
|
|
412
|
+
return (
|
|
413
|
+
proto === Object.prototype ||
|
|
414
|
+
proto === null ||
|
|
415
|
+
Object.getPrototypeOf(proto) === null ||
|
|
416
|
+
Object.getOwnPropertyNames(proto).sort().join('\0') === object_proto_names
|
|
417
|
+
);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/** @param {any} thing */
|
|
421
|
+
function get_type(thing) {
|
|
422
|
+
return Object.prototype.toString.call(thing).slice(8, -1);
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
/** @param {any} thing */
|
|
426
|
+
function is_buffer(thing) {
|
|
427
|
+
return typeof Buffer !== 'undefined' && Buffer.isBuffer(thing);
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
/** @param {string} char */
|
|
431
|
+
function get_escaped_char(char) {
|
|
432
|
+
switch (char) {
|
|
433
|
+
case '"':
|
|
434
|
+
return '\\"';
|
|
435
|
+
case '<':
|
|
436
|
+
return '\\u003C';
|
|
437
|
+
case '\\':
|
|
438
|
+
return '\\\\';
|
|
439
|
+
case '\n':
|
|
440
|
+
return '\\n';
|
|
441
|
+
case '\r':
|
|
442
|
+
return '\\r';
|
|
443
|
+
case '\t':
|
|
444
|
+
return '\\t';
|
|
445
|
+
case '\b':
|
|
446
|
+
return '\\b';
|
|
447
|
+
case '\f':
|
|
448
|
+
return '\\f';
|
|
449
|
+
case '\u2028':
|
|
450
|
+
return '\\u2028';
|
|
451
|
+
case '\u2029':
|
|
452
|
+
return '\\u2029';
|
|
453
|
+
default:
|
|
454
|
+
return char < ' ' ? `\\u${char.charCodeAt(0).toString(16).padStart(4, '0')}` : '';
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
/** @param {string} str */
|
|
459
|
+
function stringify_string(str) {
|
|
460
|
+
let result = '';
|
|
461
|
+
let last_pos = 0;
|
|
462
|
+
const len = str.length;
|
|
463
|
+
|
|
464
|
+
for (let i = 0; i < len; i += 1) {
|
|
465
|
+
const char = str[i];
|
|
466
|
+
const replacement = get_escaped_char(char);
|
|
467
|
+
if (replacement) {
|
|
468
|
+
result += str.slice(last_pos, i) + replacement;
|
|
469
|
+
last_pos = i + 1;
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
return `"${last_pos === 0 ? str : result + str.slice(last_pos)}"`;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
/** @param {Record<string | symbol, any>} object */
|
|
477
|
+
function enumerable_symbols(object) {
|
|
478
|
+
return Object.getOwnPropertySymbols(object).filter(
|
|
479
|
+
(symbol) => Object.getOwnPropertyDescriptor(object, symbol).enumerable
|
|
480
|
+
);
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
const is_identifier = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;
|
|
484
|
+
|
|
485
|
+
/** @param {string} key */
|
|
486
|
+
function stringify_key(key) {
|
|
487
|
+
return is_identifier.test(key) ? '.' + key : '[' + JSON.stringify(key) + ']';
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
/** @param {number} n */
|
|
491
|
+
function is_valid_array_index(n) {
|
|
492
|
+
if (!Number.isInteger(n)) return false;
|
|
493
|
+
if (n < 0) return false;
|
|
494
|
+
if (n > MAX_ARRAY_INDEX) return false;
|
|
495
|
+
return true;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
/** @param {number} n */
|
|
499
|
+
function is_valid_array_len(n) {
|
|
500
|
+
if (!Number.isInteger(n)) return false;
|
|
501
|
+
if (n < 0) return false;
|
|
502
|
+
if (n > MAX_ARRAY_LEN) return false;
|
|
503
|
+
return true;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
/** @param {string} s */
|
|
507
|
+
function is_valid_array_index_string(s) {
|
|
508
|
+
if (s.length === 0) return false;
|
|
509
|
+
if (s.length > 1 && s.charCodeAt(0) === 48) return false; // leading zero
|
|
510
|
+
for (let i = 0; i < s.length; i++) {
|
|
511
|
+
const c = s.charCodeAt(i);
|
|
512
|
+
if (c < 48 || c > 57) return false;
|
|
513
|
+
}
|
|
514
|
+
// by this point we know it's a string of digits, but it has to be within
|
|
515
|
+
// the range of valid array indices
|
|
516
|
+
return is_valid_array_index(+s);
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* Returns the length of the leading run of valid array indices in `keys`.
|
|
521
|
+
* @param {readonly string[]} keys
|
|
522
|
+
*/
|
|
523
|
+
function array_index_cut(keys) {
|
|
524
|
+
for (var i = keys.length - 1; i >= 0; i--) {
|
|
525
|
+
if (is_valid_array_index_string(keys[i])) {
|
|
526
|
+
break;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
return i + 1;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
/**
|
|
533
|
+
* Finds the populated indices of an array.
|
|
534
|
+
* @param {unknown[]} array
|
|
535
|
+
*/
|
|
536
|
+
function valid_array_indices(array) {
|
|
537
|
+
const keys = Object.keys(array);
|
|
538
|
+
keys.length = array_index_cut(keys);
|
|
539
|
+
return keys;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
const chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$';
|
|
543
|
+
// Short strings have bounded escaping/output costs per reference, so they cannot
|
|
544
|
+
// cause quadratic expansion. Keep them on the original fast path rather than
|
|
545
|
+
// paying for deduplication on common values such as names, IDs and status fields.
|
|
546
|
+
const MIN_STRING_LENGTH = 128;
|
|
547
|
+
const unsafe_chars = /[<\b\f\n\r\t\0\u2028\u2029]/g;
|
|
548
|
+
const reserved =
|
|
549
|
+
/^(?:do|if|in|for|int|let|new|try|var|byte|case|char|else|enum|goto|long|this|void|with|await|break|catch|class|const|final|float|short|super|throw|while|yield|delete|double|export|import|native|return|switch|throws|typeof|boolean|default|extends|finally|package|private|abstract|continue|debugger|function|volatile|interface|protected|transient|implements|instanceof|synchronized)$/;
|
|
550
|
+
|
|
551
|
+
/**
|
|
552
|
+
* Turn a value into the JavaScript that creates an equivalent value
|
|
553
|
+
* @param {any} value
|
|
554
|
+
* @param {(value: any, uneval: (value: any) => string) => string | void} [replacer]
|
|
555
|
+
*/
|
|
556
|
+
function uneval(value, replacer) {
|
|
557
|
+
const counts = new Map();
|
|
558
|
+
|
|
559
|
+
/** @type {string[]} */
|
|
560
|
+
const keys = [];
|
|
561
|
+
|
|
562
|
+
const custom = new Map();
|
|
563
|
+
|
|
564
|
+
// Only allocate a literal cache when we need to reuse an expensive primitive,
|
|
565
|
+
// including long Map keys rendered in error paths during the walk.
|
|
566
|
+
/** @type {Map<string | bigint, string> | undefined} */
|
|
567
|
+
let primitives;
|
|
568
|
+
|
|
569
|
+
/** @param {any} thing */
|
|
570
|
+
function stringify_cached_primitive(thing) {
|
|
571
|
+
if (
|
|
572
|
+
(typeof thing === 'string' && thing.length >= MIN_STRING_LENGTH) ||
|
|
573
|
+
typeof thing === 'bigint'
|
|
574
|
+
) {
|
|
575
|
+
primitives ??= new Map();
|
|
576
|
+
let literal = primitives.get(thing);
|
|
577
|
+
if (literal === undefined) {
|
|
578
|
+
literal = stringify_primitive$1(thing);
|
|
579
|
+
primitives.set(thing, literal);
|
|
580
|
+
}
|
|
581
|
+
return literal;
|
|
582
|
+
}
|
|
583
|
+
return stringify_primitive$1(thing);
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
/** @param {any} thing */
|
|
587
|
+
function walk(thing) {
|
|
588
|
+
if (!is_primitive(thing)) {
|
|
589
|
+
if (counts.has(thing)) {
|
|
590
|
+
counts.set(thing, counts.get(thing) + 1);
|
|
591
|
+
return;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
counts.set(thing, 1);
|
|
595
|
+
|
|
596
|
+
if (replacer) {
|
|
597
|
+
const str = replacer(thing, (value) => uneval(value, replacer));
|
|
598
|
+
|
|
599
|
+
if (typeof str === 'string') {
|
|
600
|
+
custom.set(thing, str);
|
|
601
|
+
return;
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
if (typeof thing === 'function') {
|
|
606
|
+
throw new DevalueError(`Cannot stringify a function`, keys, thing, value);
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
const type = get_type(thing);
|
|
610
|
+
|
|
611
|
+
switch (type) {
|
|
612
|
+
case 'BigInt':
|
|
613
|
+
case 'String':
|
|
614
|
+
walk(thing.valueOf());
|
|
615
|
+
return;
|
|
616
|
+
|
|
617
|
+
case 'Number':
|
|
618
|
+
case 'Boolean':
|
|
619
|
+
case 'Date':
|
|
620
|
+
case 'RegExp':
|
|
621
|
+
case 'URL':
|
|
622
|
+
case 'URLSearchParams':
|
|
623
|
+
return;
|
|
624
|
+
|
|
625
|
+
case 'Array':
|
|
626
|
+
// forEach scans the logical length of dictionary-backed sparse
|
|
627
|
+
// arrays. Visit own enumerable indices without doing work for
|
|
628
|
+
// every hole.
|
|
629
|
+
for (const i of valid_array_indices(thing)) {
|
|
630
|
+
keys.push(`[${i}]`);
|
|
631
|
+
walk(thing[i]);
|
|
632
|
+
keys.pop();
|
|
633
|
+
}
|
|
634
|
+
break;
|
|
635
|
+
|
|
636
|
+
case 'Set':
|
|
637
|
+
Array.from(thing).forEach(walk);
|
|
638
|
+
break;
|
|
639
|
+
|
|
640
|
+
case 'Map':
|
|
641
|
+
for (const [key, value] of thing) {
|
|
642
|
+
keys.push(`.get(${is_primitive(key) ? stringify_cached_primitive(key) : '...'})`);
|
|
643
|
+
walk(key);
|
|
644
|
+
walk(value);
|
|
645
|
+
keys.pop();
|
|
646
|
+
}
|
|
647
|
+
break;
|
|
648
|
+
|
|
649
|
+
case 'Int8Array':
|
|
650
|
+
case 'Uint8Array':
|
|
651
|
+
case 'Uint8ClampedArray':
|
|
652
|
+
case 'Int16Array':
|
|
653
|
+
case 'Uint16Array':
|
|
654
|
+
case 'Float16Array':
|
|
655
|
+
case 'Int32Array':
|
|
656
|
+
case 'Uint32Array':
|
|
657
|
+
case 'Float32Array':
|
|
658
|
+
case 'Float64Array':
|
|
659
|
+
case 'BigInt64Array':
|
|
660
|
+
case 'BigUint64Array':
|
|
661
|
+
case 'DataView':
|
|
662
|
+
// A Node Buffer's backing store may be a shared pool. It must
|
|
663
|
+
// never be visited or hoisted just because a Buffer uses it.
|
|
664
|
+
if (!is_buffer(thing)) walk(thing.buffer);
|
|
665
|
+
return;
|
|
666
|
+
|
|
667
|
+
case 'ArrayBuffer':
|
|
668
|
+
return;
|
|
669
|
+
|
|
670
|
+
case 'Temporal.Duration':
|
|
671
|
+
case 'Temporal.Instant':
|
|
672
|
+
case 'Temporal.PlainDate':
|
|
673
|
+
case 'Temporal.PlainTime':
|
|
674
|
+
case 'Temporal.PlainDateTime':
|
|
675
|
+
case 'Temporal.PlainMonthDay':
|
|
676
|
+
case 'Temporal.PlainYearMonth':
|
|
677
|
+
case 'Temporal.ZonedDateTime':
|
|
678
|
+
return;
|
|
679
|
+
|
|
680
|
+
default:
|
|
681
|
+
if (!is_plain_object(thing)) {
|
|
682
|
+
throw new DevalueError(`Cannot stringify arbitrary non-POJOs`, keys, thing, value);
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
if (enumerable_symbols(thing).length > 0) {
|
|
686
|
+
throw new DevalueError(`Cannot stringify POJOs with symbolic keys`, keys, thing, value);
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
for (const key of Object.keys(thing)) {
|
|
690
|
+
if (key === '__proto__') {
|
|
691
|
+
throw new DevalueError(
|
|
692
|
+
`Cannot stringify objects with __proto__ keys`,
|
|
693
|
+
keys,
|
|
694
|
+
thing,
|
|
695
|
+
value
|
|
696
|
+
);
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
keys.push(stringify_key(key));
|
|
700
|
+
walk(thing[key]);
|
|
701
|
+
keys.pop();
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
} else if (typeof thing === 'symbol') {
|
|
705
|
+
throw new DevalueError(`Cannot stringify a Symbol primitive`, keys, thing, value);
|
|
706
|
+
} else if (
|
|
707
|
+
(typeof thing === 'string' && thing.length >= MIN_STRING_LENGTH) ||
|
|
708
|
+
typeof thing === 'bigint'
|
|
709
|
+
) {
|
|
710
|
+
counts.set(thing, (counts.get(thing) || 0) + 1);
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
walk(value);
|
|
715
|
+
|
|
716
|
+
const names = new Map();
|
|
717
|
+
|
|
718
|
+
/** @type {Array<[any, number]>} */
|
|
719
|
+
const repeated = [];
|
|
720
|
+
// Avoid allocating entries for all the values that will never be hoisted.
|
|
721
|
+
counts.forEach((count, thing) => {
|
|
722
|
+
if (count > 1) repeated.push([thing, count]);
|
|
723
|
+
});
|
|
724
|
+
|
|
725
|
+
repeated
|
|
726
|
+
.sort((a, b) => b[1] - a[1])
|
|
727
|
+
.forEach(([thing, count]) => {
|
|
728
|
+
const name = get_name(names.size);
|
|
729
|
+
|
|
730
|
+
if (is_primitive(thing)) {
|
|
731
|
+
const length = stringify_cached_primitive(thing).length;
|
|
732
|
+
// Hoisting costs one literal, a parameter and a reference per occurrence.
|
|
733
|
+
// Allow for the IIFE wrapper and separators even if one already exists,
|
|
734
|
+
// so inexpensive repetitions stay inline.
|
|
735
|
+
if (length * count <= length + (count + 1) * name.length + 25) return;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
names.set(thing, name);
|
|
739
|
+
});
|
|
740
|
+
|
|
741
|
+
/**
|
|
742
|
+
* @param {any} thing
|
|
743
|
+
* @returns {string}
|
|
744
|
+
*/
|
|
745
|
+
function stringify(thing) {
|
|
746
|
+
if (names.has(thing)) {
|
|
747
|
+
return names.get(thing);
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
if (is_primitive(thing)) {
|
|
751
|
+
return stringify_primitive$1(thing);
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
if (custom.has(thing)) {
|
|
755
|
+
return custom.get(thing);
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
const type = get_type(thing);
|
|
759
|
+
|
|
760
|
+
switch (type) {
|
|
761
|
+
case 'Number':
|
|
762
|
+
case 'String':
|
|
763
|
+
case 'Boolean':
|
|
764
|
+
case 'BigInt':
|
|
765
|
+
return `Object(${stringify(thing.valueOf())})`;
|
|
766
|
+
|
|
767
|
+
case 'RegExp':
|
|
768
|
+
const { source, flags } = thing;
|
|
769
|
+
return flags
|
|
770
|
+
? `new RegExp(${stringify_string(source)},"${flags}")`
|
|
771
|
+
: `new RegExp(${stringify_string(source)})`;
|
|
772
|
+
|
|
773
|
+
case 'Date':
|
|
774
|
+
return `new Date(${thing.getTime()})`;
|
|
775
|
+
|
|
776
|
+
case 'URL':
|
|
777
|
+
return `new URL(${stringify_string(thing.toString())})`;
|
|
778
|
+
|
|
779
|
+
case 'URLSearchParams':
|
|
780
|
+
return `new URLSearchParams(${stringify_string(thing.toString())})`;
|
|
781
|
+
|
|
782
|
+
case 'Array': {
|
|
783
|
+
// For dense arrays (no holes), we iterate normally.
|
|
784
|
+
// When we encounter the first hole, we collect own indices
|
|
785
|
+
// to determine the sparseness, then decide between:
|
|
786
|
+
// - Array literal with holes: [,"a",,] (default)
|
|
787
|
+
// - Object.assign with a sparse-safe allocator (for very sparse arrays)
|
|
788
|
+
// Only the Object.assign path avoids iterating every slot, which
|
|
789
|
+
// is what protects against the DoS of e.g. `arr[1000000] = 1`.
|
|
790
|
+
let has_holes = false;
|
|
791
|
+
|
|
792
|
+
let result = '[';
|
|
793
|
+
|
|
794
|
+
for (let i = 0; i < thing.length; i += 1) {
|
|
795
|
+
if (i > 0) result += ',';
|
|
796
|
+
|
|
797
|
+
if (Object.hasOwn(thing, i)) {
|
|
798
|
+
result += stringify(thing[i]);
|
|
799
|
+
} else if (!has_holes) {
|
|
800
|
+
// Decide between array literal and Object.assign.
|
|
801
|
+
//
|
|
802
|
+
// Array literal: holes are consecutive commas.
|
|
803
|
+
// For example, [, "a", ,] is written as [,"a",,].
|
|
804
|
+
// Each hole costs 1 char (a comma).
|
|
805
|
+
//
|
|
806
|
+
// Object.assign: populated indices are listed explicitly.
|
|
807
|
+
// For example, [, "a", ,] would be written as
|
|
808
|
+
// Object.assign(sparse(3),{1:"a"}), where sparse(n) stands
|
|
809
|
+
// for the expression emitted by stringify_sparse_array(n).
|
|
810
|
+
// This avoids paying per-hole, but has a large fixed
|
|
811
|
+
// overhead for the allocator and Object.assign wrapper,
|
|
812
|
+
// and each element costs extra chars for its index and colon.
|
|
813
|
+
//
|
|
814
|
+
// The serialized values are the same size either way, so
|
|
815
|
+
// the choice comes down to the structural overhead:
|
|
816
|
+
//
|
|
817
|
+
// Array literal overhead:
|
|
818
|
+
// 1 char per element or hole (comma separators)
|
|
819
|
+
// + 2 chars for "[" and "]"
|
|
820
|
+
// = L + 2
|
|
821
|
+
//
|
|
822
|
+
// Object.assign overhead:
|
|
823
|
+
// "Object.assign(" — 14 chars
|
|
824
|
+
// + allocator expression — A chars
|
|
825
|
+
// + ",{" — 2 chars
|
|
826
|
+
// + for each populated element:
|
|
827
|
+
// index + ":" + "," — (d + 2) chars
|
|
828
|
+
// + "})" — 2 chars
|
|
829
|
+
// = (18 + A) + P * (d + 2)
|
|
830
|
+
//
|
|
831
|
+
// where L is the array length, P is the number of
|
|
832
|
+
// populated elements, A is the allocator expression's
|
|
833
|
+
// length, and d is the number of digits in L (an upper
|
|
834
|
+
// bound on the digits in any index).
|
|
835
|
+
//
|
|
836
|
+
// Object.assign is cheaper when:
|
|
837
|
+
// (18 + A) + P * (d + 2) < L + 2
|
|
838
|
+
const populated_keys = valid_array_indices(thing);
|
|
839
|
+
const population = populated_keys.length;
|
|
840
|
+
const d = String(thing.length).length;
|
|
841
|
+
const array = stringify_sparse_array(thing.length);
|
|
842
|
+
|
|
843
|
+
const hole_cost = thing.length + 2;
|
|
844
|
+
const sparse_cost = array.length + 18 + population * (d + 2);
|
|
845
|
+
|
|
846
|
+
if (hole_cost > sparse_cost) {
|
|
847
|
+
const entries = populated_keys.map((k) => `${k}:${stringify(thing[k])}`).join(',');
|
|
848
|
+
return `Object.assign(${array},{${entries}})`;
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
has_holes = true;
|
|
852
|
+
}
|
|
853
|
+
// else: already decided on array literal, hole is just an empty slot
|
|
854
|
+
// (the comma separator is all we need — no content for this position)
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
const tail = thing.length === 0 || Object.hasOwn(thing, thing.length - 1) ? '' : ',';
|
|
858
|
+
return result + tail + ']';
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
case 'Set':
|
|
862
|
+
case 'Map':
|
|
863
|
+
return `new ${type}([${Array.from(thing).map(stringify).join(',')}])`;
|
|
864
|
+
|
|
865
|
+
case 'Int8Array':
|
|
866
|
+
case 'Uint8Array':
|
|
867
|
+
case 'Uint8ClampedArray':
|
|
868
|
+
case 'Int16Array':
|
|
869
|
+
case 'Uint16Array':
|
|
870
|
+
case 'Float16Array':
|
|
871
|
+
case 'Int32Array':
|
|
872
|
+
case 'Uint32Array':
|
|
873
|
+
case 'Float32Array':
|
|
874
|
+
case 'Float64Array':
|
|
875
|
+
case 'BigInt64Array':
|
|
876
|
+
case 'BigUint64Array': {
|
|
877
|
+
if (is_buffer(thing)) thing = new Uint8Array(thing);
|
|
878
|
+
|
|
879
|
+
let str = `new ${type}`;
|
|
880
|
+
|
|
881
|
+
if (!names.has(thing.buffer)) {
|
|
882
|
+
str += `([${stringify_typed_array_elements(type, thing.buffer)}])`;
|
|
883
|
+
} else {
|
|
884
|
+
str += `(${stringify(thing.buffer)})`;
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
// handle subarrays
|
|
888
|
+
if (thing.byteLength !== thing.buffer.byteLength) {
|
|
889
|
+
const start = thing.byteOffset / thing.BYTES_PER_ELEMENT;
|
|
890
|
+
const end = start + thing.length;
|
|
891
|
+
str += `.subarray(${start},${end})`;
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
return str;
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
case 'DataView': {
|
|
898
|
+
let str = `new DataView`;
|
|
899
|
+
|
|
900
|
+
if (!names.has(thing.buffer)) {
|
|
901
|
+
str += `(new Uint8Array([${new Uint8Array(thing.buffer)}]).buffer`;
|
|
902
|
+
} else {
|
|
903
|
+
str += `(${stringify(thing.buffer)}`;
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
// handle subviews
|
|
907
|
+
if (thing.byteLength !== thing.buffer.byteLength) {
|
|
908
|
+
str += `,${thing.byteOffset},${thing.byteLength}`;
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
return str + ')';
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
case 'ArrayBuffer': {
|
|
915
|
+
const ui8 = new Uint8Array(thing);
|
|
916
|
+
return `new Uint8Array([${ui8.toString()}]).buffer`;
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
case 'Temporal.Duration':
|
|
920
|
+
case 'Temporal.Instant':
|
|
921
|
+
case 'Temporal.PlainDate':
|
|
922
|
+
case 'Temporal.PlainTime':
|
|
923
|
+
case 'Temporal.PlainDateTime':
|
|
924
|
+
case 'Temporal.PlainMonthDay':
|
|
925
|
+
case 'Temporal.PlainYearMonth':
|
|
926
|
+
case 'Temporal.ZonedDateTime':
|
|
927
|
+
return `${type}.from(${stringify_string(thing.toString())})`;
|
|
928
|
+
|
|
929
|
+
default:
|
|
930
|
+
const keys = Object.keys(thing);
|
|
931
|
+
const obj = keys.map((key) => `${safe_key(key)}:${stringify(thing[key])}`).join(',');
|
|
932
|
+
const proto = Object.getPrototypeOf(thing);
|
|
933
|
+
if (proto === null) {
|
|
934
|
+
return keys.length > 0 ? `{${obj},__proto__:null}` : `{__proto__:null}`;
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
return `{${obj}}`;
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
const str = stringify(value);
|
|
942
|
+
|
|
943
|
+
if (names.size) {
|
|
944
|
+
/** @type {string[]} */
|
|
945
|
+
const params = [];
|
|
946
|
+
|
|
947
|
+
/** @type {string[]} */
|
|
948
|
+
const statements = [];
|
|
949
|
+
|
|
950
|
+
/** @type {string[]} */
|
|
951
|
+
const values = [];
|
|
952
|
+
|
|
953
|
+
// Reconstructions (e.g. `b = new Uint8Array(...)`) reassign a placeholder
|
|
954
|
+
// parameter. They must run before the `statements` that reference them,
|
|
955
|
+
// otherwise those statements capture the placeholder. They only depend on
|
|
956
|
+
// IIFE arguments (never on each other), so emitting them first is safe.
|
|
957
|
+
/** @type {string[]} */
|
|
958
|
+
const reconstructions = [];
|
|
959
|
+
|
|
960
|
+
names.forEach((name, thing) => {
|
|
961
|
+
params.push(name);
|
|
962
|
+
|
|
963
|
+
if (custom.has(thing)) {
|
|
964
|
+
values.push(/** @type {string} */ (custom.get(thing)));
|
|
965
|
+
return;
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
if (is_primitive(thing)) {
|
|
969
|
+
values.push(stringify_cached_primitive(thing));
|
|
970
|
+
return;
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
const type = get_type(thing);
|
|
974
|
+
|
|
975
|
+
switch (type) {
|
|
976
|
+
case 'Number':
|
|
977
|
+
case 'String':
|
|
978
|
+
case 'Boolean':
|
|
979
|
+
case 'BigInt': {
|
|
980
|
+
const primitive = thing.valueOf();
|
|
981
|
+
if (names.has(primitive)) {
|
|
982
|
+
// A hoisted primitive is only in scope inside the IIFE, not in
|
|
983
|
+
// its arguments. Reconstruct the box before assigning references.
|
|
984
|
+
values.push('{}');
|
|
985
|
+
reconstructions.push(`${name}=Object(${stringify(primitive)})`);
|
|
986
|
+
} else {
|
|
987
|
+
values.push(`Object(${stringify(primitive)})`);
|
|
988
|
+
}
|
|
989
|
+
break;
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
case 'RegExp':
|
|
993
|
+
const { source, flags } = thing;
|
|
994
|
+
const regexp = flags
|
|
995
|
+
? `new RegExp(${stringify_string(source)},"${flags}")`
|
|
996
|
+
: `new RegExp(${stringify_string(source)})`;
|
|
997
|
+
values.push(regexp);
|
|
998
|
+
break;
|
|
999
|
+
|
|
1000
|
+
case 'Date':
|
|
1001
|
+
values.push(`new Date(${thing.getTime()})`);
|
|
1002
|
+
break;
|
|
1003
|
+
|
|
1004
|
+
case 'URL':
|
|
1005
|
+
values.push(`new URL(${stringify_string(thing.toString())})`);
|
|
1006
|
+
break;
|
|
1007
|
+
|
|
1008
|
+
case 'URLSearchParams':
|
|
1009
|
+
values.push(`new URLSearchParams(${stringify_string(thing.toString())})`);
|
|
1010
|
+
break;
|
|
1011
|
+
|
|
1012
|
+
case 'Array': {
|
|
1013
|
+
const populated_keys = valid_array_indices(thing);
|
|
1014
|
+
// Only preallocate when the length is bounded by the number
|
|
1015
|
+
// of populated elements, plus a small constant for short arrays.
|
|
1016
|
+
values.push(
|
|
1017
|
+
thing.length > 32 + 2 * populated_keys.length
|
|
1018
|
+
? stringify_sparse_array(thing.length)
|
|
1019
|
+
: `Array(${thing.length})`
|
|
1020
|
+
);
|
|
1021
|
+
for (const i of populated_keys) {
|
|
1022
|
+
statements.push(`${name}[${i}]=${stringify(thing[i])}`);
|
|
1023
|
+
}
|
|
1024
|
+
break;
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
case 'Set': {
|
|
1028
|
+
values.push(`new Set`);
|
|
1029
|
+
const adds = Array.from(thing).map((v) => `.add(${stringify(v)})`);
|
|
1030
|
+
// An empty Set is fully built by `new Set`; a chained statement would
|
|
1031
|
+
// otherwise be a dangling `name.`.
|
|
1032
|
+
if (adds.length > 0) statements.push(name + adds.join(''));
|
|
1033
|
+
break;
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
case 'Map': {
|
|
1037
|
+
values.push(`new Map`);
|
|
1038
|
+
const sets = Array.from(thing).map(
|
|
1039
|
+
([k, v]) => `.set(${stringify(k)}, ${stringify(v)})`
|
|
1040
|
+
);
|
|
1041
|
+
if (sets.length > 0) statements.push(name + sets.join(''));
|
|
1042
|
+
break;
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
case 'Int8Array':
|
|
1046
|
+
case 'Uint8Array':
|
|
1047
|
+
case 'Uint8ClampedArray':
|
|
1048
|
+
case 'Int16Array':
|
|
1049
|
+
case 'Uint16Array':
|
|
1050
|
+
case 'Float16Array':
|
|
1051
|
+
case 'Int32Array':
|
|
1052
|
+
case 'Uint32Array':
|
|
1053
|
+
case 'Float32Array':
|
|
1054
|
+
case 'Float64Array':
|
|
1055
|
+
case 'BigInt64Array':
|
|
1056
|
+
case 'BigUint64Array': {
|
|
1057
|
+
if (is_buffer(thing)) thing = new Uint8Array(thing);
|
|
1058
|
+
|
|
1059
|
+
let str = `new ${type}`;
|
|
1060
|
+
|
|
1061
|
+
if (!names.has(thing.buffer)) {
|
|
1062
|
+
str += `([${stringify_typed_array_elements(type, thing.buffer)}])`;
|
|
1063
|
+
} else {
|
|
1064
|
+
str += `(${stringify(thing.buffer)})`;
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
// handle subarrays
|
|
1068
|
+
if (thing.byteLength !== thing.buffer.byteLength) {
|
|
1069
|
+
const start = thing.byteOffset / thing.BYTES_PER_ELEMENT;
|
|
1070
|
+
const end = start + thing.length;
|
|
1071
|
+
str += `.subarray(${start},${end})`;
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
values.push(`{}`);
|
|
1075
|
+
reconstructions.push(`${name}=${str}`);
|
|
1076
|
+
break;
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
case 'DataView': {
|
|
1080
|
+
let str = `new DataView`;
|
|
1081
|
+
|
|
1082
|
+
if (!names.has(thing.buffer)) {
|
|
1083
|
+
str += `(new Uint8Array([${new Uint8Array(thing.buffer)}]).buffer`;
|
|
1084
|
+
} else {
|
|
1085
|
+
str += `(${stringify(thing.buffer)}`;
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
// handle subviews
|
|
1089
|
+
if (thing.byteLength !== thing.buffer.byteLength) {
|
|
1090
|
+
str += `,${thing.byteOffset},${thing.byteLength}`;
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
str += ')';
|
|
1094
|
+
|
|
1095
|
+
values.push(`{}`);
|
|
1096
|
+
reconstructions.push(`${name}=${str}`);
|
|
1097
|
+
break;
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
case 'ArrayBuffer':
|
|
1101
|
+
values.push(`new Uint8Array([${new Uint8Array(thing)}]).buffer`);
|
|
1102
|
+
break;
|
|
1103
|
+
|
|
1104
|
+
case 'Temporal.Duration':
|
|
1105
|
+
case 'Temporal.Instant':
|
|
1106
|
+
case 'Temporal.PlainDate':
|
|
1107
|
+
case 'Temporal.PlainTime':
|
|
1108
|
+
case 'Temporal.PlainDateTime':
|
|
1109
|
+
case 'Temporal.PlainMonthDay':
|
|
1110
|
+
case 'Temporal.PlainYearMonth':
|
|
1111
|
+
case 'Temporal.ZonedDateTime':
|
|
1112
|
+
values.push(`${type}.from(${stringify_string(thing.toString())})`);
|
|
1113
|
+
break;
|
|
1114
|
+
|
|
1115
|
+
default:
|
|
1116
|
+
values.push(Object.getPrototypeOf(thing) === null ? 'Object.create(null)' : '{}');
|
|
1117
|
+
Object.keys(thing).forEach((key) => {
|
|
1118
|
+
statements.push(`${name}${safe_prop(key)}=${stringify(thing[key])}`);
|
|
1119
|
+
});
|
|
1120
|
+
}
|
|
1121
|
+
});
|
|
1122
|
+
|
|
1123
|
+
statements.push(`return ${str}`);
|
|
1124
|
+
|
|
1125
|
+
const body = [...reconstructions, ...statements].join(';');
|
|
1126
|
+
// A function may have at most 65535 parameters (and a call at most that
|
|
1127
|
+
// many arguments). For very large graphs, pass the hoisted values as a
|
|
1128
|
+
// single array argument and destructure them into the placeholder names,
|
|
1129
|
+
// so the emitted code stays within the engine limit (#93).
|
|
1130
|
+
if (params.length > 65534) {
|
|
1131
|
+
return `(function(){var[${params.join(',')}]=arguments[0];${body}}([${values.join(',')}]))`;
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
return `(function(${params.join(',')}){${body}}(${values.join(',')}))`;
|
|
1135
|
+
} else {
|
|
1136
|
+
return str;
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
/**
|
|
1141
|
+
* Emit an array whose storage is not proportional to its declared length.
|
|
1142
|
+
* As in the default parse operations, touching and deleting the largest valid
|
|
1143
|
+
* index forces V8 into dictionary-elements mode before setting the length.
|
|
1144
|
+
* Merely starting with [] and assigning .length still eagerly allocates.
|
|
1145
|
+
* @param {number} length
|
|
1146
|
+
*/
|
|
1147
|
+
function stringify_sparse_array(length) {
|
|
1148
|
+
return `(function(a){a[${MAX_ARRAY_INDEX}]=0;delete a[${MAX_ARRAY_INDEX}];a.length=${length};return a}([]))`;
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
/**
|
|
1152
|
+
* Serialize the elements of `buffer`, read as `type`, as a comma-separated list.
|
|
1153
|
+
* The view is created from `type` rather than from the serialized value's own
|
|
1154
|
+
* constructor, which may be a subclass like Node's `Buffer` whose `toString`
|
|
1155
|
+
* decodes the bytes instead of listing them.
|
|
1156
|
+
* `BigInt64Array`/`BigUint64Array` elements are bigints and must be written
|
|
1157
|
+
* with an `n` suffix, otherwise the emitted `new BigInt64Array([...])` throws.
|
|
1158
|
+
* @param {string} type
|
|
1159
|
+
* @param {ArrayBufferLike} buffer
|
|
1160
|
+
*/
|
|
1161
|
+
function stringify_typed_array_elements(type, buffer) {
|
|
1162
|
+
const array = new (/** @type {any} */ (globalThis)[type])(buffer);
|
|
1163
|
+
|
|
1164
|
+
if (type === 'BigInt64Array' || type === 'BigUint64Array') {
|
|
1165
|
+
return Array.from(array, (element) => `${element}n`).join(',');
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
// Float arrays can hold `-0`, which `toString()` collapses to `"0"`, silently
|
|
1169
|
+
// losing the sign on round-trip. Emit `-0` explicitly for those elements.
|
|
1170
|
+
if (
|
|
1171
|
+
array instanceof Float32Array ||
|
|
1172
|
+
array instanceof Float64Array ||
|
|
1173
|
+
(typeof Float16Array !== 'undefined' && array instanceof Float16Array)
|
|
1174
|
+
) {
|
|
1175
|
+
return Array.from(array, (element) => (Object.is(element, -0) ? '-0' : `${element}`)).join(',');
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
return array.toString();
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
/** @param {number} num */
|
|
1182
|
+
function get_name(num) {
|
|
1183
|
+
let name = '';
|
|
1184
|
+
|
|
1185
|
+
do {
|
|
1186
|
+
name = chars[num % chars.length] + name;
|
|
1187
|
+
num = ~~(num / chars.length) - 1;
|
|
1188
|
+
} while (num >= 0);
|
|
1189
|
+
|
|
1190
|
+
return reserved.test(name) ? `${name}0` : name;
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
/** @param {string} c */
|
|
1194
|
+
function escape_unsafe_char(c) {
|
|
1195
|
+
return escaped[c] || c;
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
/** @param {string} str */
|
|
1199
|
+
function escape_unsafe_chars(str) {
|
|
1200
|
+
return str.replace(unsafe_chars, escape_unsafe_char);
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
/** @param {string} key */
|
|
1204
|
+
function safe_key(key) {
|
|
1205
|
+
return /^[_$a-zA-Z][_$a-zA-Z0-9]*$/.test(key) ? key : escape_unsafe_chars(JSON.stringify(key));
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
/** @param {string} key */
|
|
1209
|
+
function safe_prop(key) {
|
|
1210
|
+
return /^[_$a-zA-Z][_$a-zA-Z0-9]*$/.test(key)
|
|
1211
|
+
? `.${key}`
|
|
1212
|
+
: `[${escape_unsafe_chars(JSON.stringify(key))}]`;
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
/** @param {any} thing */
|
|
1216
|
+
function stringify_primitive$1(thing) {
|
|
1217
|
+
const type = typeof thing;
|
|
1218
|
+
if (type === 'string') return stringify_string(thing);
|
|
1219
|
+
if (thing === void 0) return 'void 0';
|
|
1220
|
+
if (thing === 0 && 1 / thing < 0) return '-0';
|
|
1221
|
+
const str = String(thing);
|
|
1222
|
+
if (type === 'number') return str.replace(/^(-)?0\./, '$1.');
|
|
1223
|
+
if (type === 'bigint') return thing + 'n';
|
|
1224
|
+
return str;
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
/* Baseline 2025 runtimes */
|
|
1228
|
+
|
|
1229
|
+
/** @type {(array_buffer: ArrayBuffer) => string} */
|
|
1230
|
+
function encode_native(array_buffer) {
|
|
1231
|
+
return new Uint8Array(array_buffer).toBase64();
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
/** @type {(base64: string) => ArrayBuffer} */
|
|
1235
|
+
function decode_native(base64) {
|
|
1236
|
+
return Uint8Array.fromBase64(base64).buffer;
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
/* Node-compatible runtimes */
|
|
1240
|
+
|
|
1241
|
+
/** @type {(array_buffer: ArrayBuffer) => string} */
|
|
1242
|
+
function encode_buffer(array_buffer) {
|
|
1243
|
+
return Buffer.from(array_buffer).toString('base64');
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
/** @type {(base64: string) => ArrayBuffer} */
|
|
1247
|
+
function decode_buffer(base64) {
|
|
1248
|
+
return Uint8Array.from(Buffer.from(base64, 'base64')).buffer;
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
/* Legacy runtimes */
|
|
1252
|
+
|
|
1253
|
+
/** @type {(array_buffer: ArrayBuffer) => string} */
|
|
1254
|
+
function encode_legacy(array_buffer) {
|
|
1255
|
+
const array = new Uint8Array(array_buffer);
|
|
1256
|
+
let binary = '';
|
|
1257
|
+
|
|
1258
|
+
// the maximum number of arguments to String.fromCharCode.apply
|
|
1259
|
+
// should be around 0xFFFF in modern engines
|
|
1260
|
+
const chunk_size = 0x8000;
|
|
1261
|
+
for (let i = 0; i < array.length; i += chunk_size) {
|
|
1262
|
+
const chunk = array.subarray(i, i + chunk_size);
|
|
1263
|
+
binary += String.fromCharCode.apply(null, chunk);
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
return btoa(binary);
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
/** @type {(base64: string) => ArrayBuffer} */
|
|
1270
|
+
function decode_legacy(base64) {
|
|
1271
|
+
const binary_string = atob(base64);
|
|
1272
|
+
const len = binary_string.length;
|
|
1273
|
+
const array = new Uint8Array(len);
|
|
1274
|
+
|
|
1275
|
+
for (let i = 0; i < len; i++) {
|
|
1276
|
+
array[i] = binary_string.charCodeAt(i);
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
return array.buffer;
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
const native = typeof Uint8Array.fromBase64 === 'function';
|
|
1283
|
+
const buffer = typeof process === 'object' && process.versions?.node !== undefined;
|
|
1284
|
+
|
|
1285
|
+
const encode64 = native ? encode_native : buffer ? encode_buffer : encode_legacy;
|
|
1286
|
+
const decode64 = native ? decode_native : buffer ? decode_buffer : decode_legacy;
|
|
1287
|
+
|
|
1288
|
+
/**
|
|
1289
|
+
* Merges caller-provided operation overrides over the defaults. Iterating the
|
|
1290
|
+
* default keys (rather than the override's own keys) means nullish members
|
|
1291
|
+
* fall back to the default, and inherited members — e.g. from a class
|
|
1292
|
+
* instance — are picked up.
|
|
1293
|
+
*
|
|
1294
|
+
* @template {Record<string, any>} T
|
|
1295
|
+
* @param {T} defaults
|
|
1296
|
+
* @param {Partial<T> | undefined} overrides
|
|
1297
|
+
* @returns {T}
|
|
1298
|
+
*/
|
|
1299
|
+
function merge_operations(defaults, overrides) {
|
|
1300
|
+
return defaults;
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
/** @type {{ kind: 'not-plain' }} */
|
|
1304
|
+
const NOT_PLAIN = /* @__PURE__ */ Object.freeze({ kind: 'not-plain' });
|
|
1305
|
+
|
|
1306
|
+
/** @type {{ kind: 'symbol-keys' }} */
|
|
1307
|
+
const SYMBOL_KEYS = /* @__PURE__ */ Object.freeze({ kind: 'symbol-keys' });
|
|
1308
|
+
|
|
1309
|
+
/**
|
|
1310
|
+
* The default implementations of every introspection/extraction operation
|
|
1311
|
+
* `stringify` performs on the value being serialized. Each one uses native
|
|
1312
|
+
* JavaScript semantics (property access, iteration, prototype methods, etc).
|
|
1313
|
+
*
|
|
1314
|
+
* Pass overrides via the `operations` option of `stringify`/`stringifyAsync`
|
|
1315
|
+
* to customize how values are inspected — e.g. to serialize values without
|
|
1316
|
+
* triggering getters, proxy traps, or patched prototype methods, or to
|
|
1317
|
+
* serialize values that live in a different JavaScript runtime (a `node:vm`
|
|
1318
|
+
* context, a WASM-hosted engine, a remote process) through handle objects.
|
|
1319
|
+
*
|
|
1320
|
+
* The object is frozen — it is shared by every `stringify` call that does
|
|
1321
|
+
* not override a given operation.
|
|
1322
|
+
*
|
|
1323
|
+
*/
|
|
1324
|
+
/** @type {import('./types.js').DefaultStringifyOperations} */
|
|
1325
|
+
const stringify_operations = {
|
|
1326
|
+
identify: (value) => value,
|
|
1327
|
+
|
|
1328
|
+
typeOf: (value) => (value === null ? 'null' : typeof value),
|
|
1329
|
+
|
|
1330
|
+
toPrimitive: (value) => value,
|
|
1331
|
+
|
|
1332
|
+
tagOf: (value) => get_type(value),
|
|
1333
|
+
|
|
1334
|
+
isThenable: (value) => typeof value.then === 'function',
|
|
1335
|
+
|
|
1336
|
+
toPromise: (thenable) => Promise.resolve(thenable),
|
|
1337
|
+
|
|
1338
|
+
unbox: (boxed) => boxed.valueOf(),
|
|
1339
|
+
|
|
1340
|
+
toISOString: (date) => (isNaN(date.getDate()) ? '' : date.toISOString()),
|
|
1341
|
+
|
|
1342
|
+
toStringValue: (value) => value.toString(),
|
|
1343
|
+
|
|
1344
|
+
regExpInfo: (regexp) => ({ source: regexp.source, flags: regexp.flags }),
|
|
1345
|
+
|
|
1346
|
+
valuesOf: (set) => set,
|
|
1347
|
+
|
|
1348
|
+
entriesOf: (map) => map,
|
|
1349
|
+
|
|
1350
|
+
viewInfo: (view) => {
|
|
1351
|
+
// Node Buffers may share a pool containing unrelated, sensitive data.
|
|
1352
|
+
// Copy only the visible bytes, without using Buffer's pooling or slice.
|
|
1353
|
+
if (is_buffer(view)) view = new Uint8Array(view);
|
|
1354
|
+
|
|
1355
|
+
return {
|
|
1356
|
+
buffer: view.buffer,
|
|
1357
|
+
byteOffset: view.byteOffset,
|
|
1358
|
+
byteLength: view.byteLength,
|
|
1359
|
+
length: view.length,
|
|
1360
|
+
bufferByteLength: view.buffer.byteLength
|
|
1361
|
+
};
|
|
1362
|
+
},
|
|
1363
|
+
|
|
1364
|
+
toArrayBuffer: (buffer) => buffer,
|
|
1365
|
+
|
|
1366
|
+
lengthOf: (array) => array.length,
|
|
1367
|
+
|
|
1368
|
+
hasOwn: (value, key) => Object.hasOwn(value, key),
|
|
1369
|
+
|
|
1370
|
+
indicesOf: (array) => valid_array_indices(array),
|
|
1371
|
+
|
|
1372
|
+
shapeOf: (value) => {
|
|
1373
|
+
if (!is_plain_object(value)) return NOT_PLAIN;
|
|
1374
|
+
if (enumerable_symbols(value).length > 0) return SYMBOL_KEYS;
|
|
1375
|
+
|
|
1376
|
+
return {
|
|
1377
|
+
kind: Object.getPrototypeOf(value) === null ? 'null-proto' : 'plain',
|
|
1378
|
+
keys: Object.keys(value)
|
|
1379
|
+
};
|
|
1380
|
+
},
|
|
1381
|
+
|
|
1382
|
+
get: (value, key) => value[key]
|
|
1383
|
+
};
|
|
1384
|
+
|
|
1385
|
+
const default_stringify_operations = /* @__PURE__ */ Object.freeze(stringify_operations);
|
|
1386
|
+
|
|
1387
|
+
const array_buffer_byte_length = Object.getOwnPropertyDescriptor(
|
|
1388
|
+
ArrayBuffer.prototype,
|
|
1389
|
+
'byteLength'
|
|
1390
|
+
).get;
|
|
1391
|
+
|
|
1392
|
+
const shared_array_buffer_byte_length =
|
|
1393
|
+
typeof SharedArrayBuffer === 'undefined'
|
|
1394
|
+
? undefined
|
|
1395
|
+
: Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype, 'byteLength').get;
|
|
1396
|
+
|
|
1397
|
+
/**
|
|
1398
|
+
* The default implementations of every construction operation `parse` and
|
|
1399
|
+
* `unflatten` perform while reviving a value. Each one uses native
|
|
1400
|
+
* JavaScript semantics (built-in constructors, property assignment, etc).
|
|
1401
|
+
*
|
|
1402
|
+
* Pass overrides via the `operations` option of `parse`/`unflatten` to
|
|
1403
|
+
* customize how values are built — e.g. to construct them from the
|
|
1404
|
+
* intrinsics of a different realm (a `node:vm` context), or to build up
|
|
1405
|
+
* values inside another JavaScript runtime (a WASM-hosted engine, a remote
|
|
1406
|
+
* process) through handle objects.
|
|
1407
|
+
*
|
|
1408
|
+
* The object is frozen — it is shared by every `parse` call that does not
|
|
1409
|
+
* override a given operation.
|
|
1410
|
+
*
|
|
1411
|
+
*/
|
|
1412
|
+
/** @type {import('./types.js').DefaultParseOperations} */
|
|
1413
|
+
const parse_operations = {
|
|
1414
|
+
fromPrimitive: (primitive) => primitive,
|
|
1415
|
+
|
|
1416
|
+
fromISOString: (iso) => new Date(iso),
|
|
1417
|
+
|
|
1418
|
+
fromStringValue: (tag, text) => {
|
|
1419
|
+
if (tag === 'URL') return new URL(text);
|
|
1420
|
+
if (tag === 'URLSearchParams') return new URLSearchParams(text);
|
|
1421
|
+
// 'Temporal.Instant', 'Temporal.PlainDate', ...
|
|
1422
|
+
// @ts-expect-error TS doesn't know about Temporal yet
|
|
1423
|
+
return Temporal[tag.slice(9)].from(text);
|
|
1424
|
+
},
|
|
1425
|
+
|
|
1426
|
+
fromArrayBuffer: (buffer) => buffer,
|
|
1427
|
+
|
|
1428
|
+
fromRegExpInfo: (source, flags) => new RegExp(source, flags),
|
|
1429
|
+
|
|
1430
|
+
fromViewInfo: (tag, buffer, byteOffset, length) => {
|
|
1431
|
+
// A reviver can replace an ArrayBuffer with a length or array-like value,
|
|
1432
|
+
// which a typed array constructor would use to allocate a new buffer.
|
|
1433
|
+
// The native getters check internal slots, so they work across realms
|
|
1434
|
+
// and cannot be fooled by a forged prototype or Symbol.toStringTag.
|
|
1435
|
+
try {
|
|
1436
|
+
array_buffer_byte_length.call(buffer);
|
|
1437
|
+
} catch (error) {
|
|
1438
|
+
if (!shared_array_buffer_byte_length) throw error;
|
|
1439
|
+
shared_array_buffer_byte_length.call(buffer);
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1442
|
+
const Constructor = /** @type {any} */ (globalThis)[tag];
|
|
1443
|
+
return byteOffset !== undefined
|
|
1444
|
+
? new Constructor(buffer, byteOffset, length)
|
|
1445
|
+
: new Constructor(buffer);
|
|
1446
|
+
},
|
|
1447
|
+
|
|
1448
|
+
box: (value) => Object(value),
|
|
1449
|
+
|
|
1450
|
+
createArray: (length) => new Array(length),
|
|
1451
|
+
|
|
1452
|
+
createSparseArray: (length) => {
|
|
1453
|
+
/** @type {any[]} */
|
|
1454
|
+
const array = [];
|
|
1455
|
+
|
|
1456
|
+
// Setting `array.length = length` (or equivalently calling
|
|
1457
|
+
// `new Array(length)`) on an untrusted length is a DoS vector: V8
|
|
1458
|
+
// eagerly allocates a contiguous backing store for array lengths below
|
|
1459
|
+
// ~10^8, so a small payload with a huge declared length can force
|
|
1460
|
+
// arbitrary memory allocation. Touching the largest-possible index
|
|
1461
|
+
// first forces V8 into dictionary-elements mode, where `length` is
|
|
1462
|
+
// just a number and no contiguous allocation occurs.
|
|
1463
|
+
array[MAX_ARRAY_INDEX] = undefined;
|
|
1464
|
+
delete array[MAX_ARRAY_INDEX];
|
|
1465
|
+
array.length = length;
|
|
1466
|
+
|
|
1467
|
+
return array;
|
|
1468
|
+
},
|
|
1469
|
+
|
|
1470
|
+
createObject: () => ({}),
|
|
1471
|
+
|
|
1472
|
+
createNullPrototypeObject: () => Object.create(null),
|
|
1473
|
+
|
|
1474
|
+
createSet: () => new Set(),
|
|
1475
|
+
|
|
1476
|
+
createMap: () => new Map(),
|
|
1477
|
+
|
|
1478
|
+
set: (target, key, value) => {
|
|
1479
|
+
target[key] = value;
|
|
1480
|
+
},
|
|
1481
|
+
|
|
1482
|
+
addValue: (set, value) => {
|
|
1483
|
+
set.add(value);
|
|
1484
|
+
},
|
|
1485
|
+
|
|
1486
|
+
addEntry: (map, key, value) => {
|
|
1487
|
+
map.set(key, value);
|
|
1488
|
+
}
|
|
1489
|
+
};
|
|
1490
|
+
|
|
1491
|
+
const default_parse_operations = /* @__PURE__ */ Object.freeze(parse_operations);
|
|
1492
|
+
|
|
1493
|
+
/**
|
|
1494
|
+
* Revive a value serialized with `devalue.stringify`
|
|
1495
|
+
* @param {string} serialized
|
|
1496
|
+
* @param {Record<string, (value: any) => any>} [revivers]
|
|
1497
|
+
* @param {import('./types.js').ParseOptions} [options]
|
|
1498
|
+
*/
|
|
1499
|
+
function parse(serialized, revivers, options) {
|
|
1500
|
+
return unflatten(JSON.parse(serialized), revivers);
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
/**
|
|
1504
|
+
* Revive a value flattened with `devalue.stringify`
|
|
1505
|
+
* @param {number | any[]} parsed
|
|
1506
|
+
* @param {Record<string, (value: any) => any>} [revivers]
|
|
1507
|
+
* @param {import('./types.js').ParseOptions} [options]
|
|
1508
|
+
*/
|
|
1509
|
+
function unflatten(parsed, revivers, options) {
|
|
1510
|
+
/** @type {import('./types.js').ParseOperations} */
|
|
1511
|
+
const ops = merge_operations(default_parse_operations);
|
|
1512
|
+
|
|
1513
|
+
if (typeof parsed === 'number') return hydrate(parsed, true);
|
|
1514
|
+
|
|
1515
|
+
if (!Array.isArray(parsed) || parsed.length === 0) {
|
|
1516
|
+
throw new Error('Invalid input');
|
|
1517
|
+
}
|
|
1518
|
+
|
|
1519
|
+
const values = /** @type {any[]} */ (parsed);
|
|
1520
|
+
|
|
1521
|
+
const hydrated = Array(values.length);
|
|
1522
|
+
|
|
1523
|
+
/**
|
|
1524
|
+
* A set of values currently being hydrated with custom revivers,
|
|
1525
|
+
* used to detect invalid cyclical dependencies
|
|
1526
|
+
* @type {Set<number> | null}
|
|
1527
|
+
*/
|
|
1528
|
+
let hydrating = null;
|
|
1529
|
+
|
|
1530
|
+
/**
|
|
1531
|
+
* @param {number} index
|
|
1532
|
+
* @returns {any}
|
|
1533
|
+
*/
|
|
1534
|
+
function hydrate(index, standalone = false) {
|
|
1535
|
+
if (index === UNDEFINED) return ops.fromPrimitive(undefined);
|
|
1536
|
+
if (index === NAN) return ops.fromPrimitive(NaN);
|
|
1537
|
+
if (index === POSITIVE_INFINITY) return ops.fromPrimitive(Infinity);
|
|
1538
|
+
if (index === NEGATIVE_INFINITY) return ops.fromPrimitive(-Infinity);
|
|
1539
|
+
if (index === NEGATIVE_ZERO) return ops.fromPrimitive(-0);
|
|
1540
|
+
|
|
1541
|
+
if (standalone || typeof index !== 'number') {
|
|
1542
|
+
throw new Error(`Invalid input`);
|
|
1543
|
+
}
|
|
1544
|
+
|
|
1545
|
+
if (index in hydrated) return hydrated[index];
|
|
1546
|
+
|
|
1547
|
+
if (index >= values.length) {
|
|
1548
|
+
throw new Error(`Invalid input`);
|
|
1549
|
+
}
|
|
1550
|
+
|
|
1551
|
+
const value = values[index];
|
|
1552
|
+
|
|
1553
|
+
if (!value || typeof value !== 'object') {
|
|
1554
|
+
hydrated[index] = ops.fromPrimitive(value);
|
|
1555
|
+
} else if (Array.isArray(value)) {
|
|
1556
|
+
if (typeof value[0] === 'string') {
|
|
1557
|
+
const type = value[0];
|
|
1558
|
+
|
|
1559
|
+
const reviver = revivers && Object.hasOwn(revivers, type) ? revivers[type] : undefined;
|
|
1560
|
+
|
|
1561
|
+
if (reviver) {
|
|
1562
|
+
let i = value[1];
|
|
1563
|
+
if (typeof i !== 'number') {
|
|
1564
|
+
// if it's not a number, it was serialized by a builtin reviver
|
|
1565
|
+
// so we need to munge it into the format expected by a custom reviver
|
|
1566
|
+
i = values.push(value[1]) - 1;
|
|
1567
|
+
}
|
|
1568
|
+
|
|
1569
|
+
// If the payload is already hydrated, its recursion has already
|
|
1570
|
+
// terminated (e.g. a self-referential object cached itself before
|
|
1571
|
+
// following its own back-reference), so revive it directly. Falling
|
|
1572
|
+
// through to the `hydrating` guard here would wrongly reject a valid
|
|
1573
|
+
// cycle. An actually infinite payload (e.g. `[["Custom", 0]]`) is never
|
|
1574
|
+
// cached, so it still hits the guard below.
|
|
1575
|
+
if (Object.hasOwn(hydrated, i)) {
|
|
1576
|
+
return (hydrated[index] = reviver(hydrated[i]));
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1579
|
+
hydrating ??= new Set();
|
|
1580
|
+
|
|
1581
|
+
if (hydrating.has(i)) {
|
|
1582
|
+
throw new Error('Invalid circular reference');
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1585
|
+
hydrating.add(i);
|
|
1586
|
+
hydrated[index] = reviver(hydrate(i));
|
|
1587
|
+
hydrating.delete(i);
|
|
1588
|
+
|
|
1589
|
+
return hydrated[index];
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1592
|
+
switch (type) {
|
|
1593
|
+
case 'Date':
|
|
1594
|
+
hydrated[index] = ops.fromISOString(value[1]);
|
|
1595
|
+
break;
|
|
1596
|
+
|
|
1597
|
+
case 'Set':
|
|
1598
|
+
const set = ops.createSet();
|
|
1599
|
+
hydrated[index] = set;
|
|
1600
|
+
for (let i = 1; i < value.length; i += 1) {
|
|
1601
|
+
ops.addValue(set, hydrate(value[i]));
|
|
1602
|
+
}
|
|
1603
|
+
break;
|
|
1604
|
+
|
|
1605
|
+
case 'Map':
|
|
1606
|
+
const map = ops.createMap();
|
|
1607
|
+
hydrated[index] = map;
|
|
1608
|
+
for (let i = 1; i < value.length; i += 2) {
|
|
1609
|
+
ops.addEntry(map, hydrate(value[i]), hydrate(value[i + 1]));
|
|
1610
|
+
}
|
|
1611
|
+
break;
|
|
1612
|
+
|
|
1613
|
+
case 'RegExp':
|
|
1614
|
+
hydrated[index] = ops.fromRegExpInfo(value[1], value[2]);
|
|
1615
|
+
break;
|
|
1616
|
+
|
|
1617
|
+
case 'Object': {
|
|
1618
|
+
const wrapped_index = value[1];
|
|
1619
|
+
|
|
1620
|
+
if (
|
|
1621
|
+
typeof values[wrapped_index] === 'object' &&
|
|
1622
|
+
values[wrapped_index][0] !== 'BigInt'
|
|
1623
|
+
) {
|
|
1624
|
+
// avoid infinite recusion in case of malformed input
|
|
1625
|
+
throw new Error('Invalid input');
|
|
1626
|
+
}
|
|
1627
|
+
|
|
1628
|
+
hydrated[index] = ops.box(hydrate(wrapped_index));
|
|
1629
|
+
break;
|
|
1630
|
+
}
|
|
1631
|
+
|
|
1632
|
+
case 'BigInt':
|
|
1633
|
+
hydrated[index] = ops.fromPrimitive(BigInt(value[1]));
|
|
1634
|
+
break;
|
|
1635
|
+
|
|
1636
|
+
case 'null':
|
|
1637
|
+
const obj = ops.createNullPrototypeObject();
|
|
1638
|
+
hydrated[index] = obj;
|
|
1639
|
+
for (let i = 1; i < value.length; i += 2) {
|
|
1640
|
+
const key = value[i];
|
|
1641
|
+
if (typeof key !== 'string') {
|
|
1642
|
+
throw new Error('Cannot parse an object with a non-string key');
|
|
1643
|
+
}
|
|
1644
|
+
|
|
1645
|
+
if (key === '__proto__') {
|
|
1646
|
+
throw new Error('Cannot parse an object with a `__proto__` property');
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1649
|
+
ops.set(obj, key, hydrate(value[i + 1]));
|
|
1650
|
+
}
|
|
1651
|
+
break;
|
|
1652
|
+
|
|
1653
|
+
case 'Int8Array':
|
|
1654
|
+
case 'Uint8Array':
|
|
1655
|
+
case 'Uint8ClampedArray':
|
|
1656
|
+
case 'Int16Array':
|
|
1657
|
+
case 'Uint16Array':
|
|
1658
|
+
case 'Float16Array':
|
|
1659
|
+
case 'Int32Array':
|
|
1660
|
+
case 'Uint32Array':
|
|
1661
|
+
case 'Float32Array':
|
|
1662
|
+
case 'Float64Array':
|
|
1663
|
+
case 'BigInt64Array':
|
|
1664
|
+
case 'BigUint64Array':
|
|
1665
|
+
case 'DataView': {
|
|
1666
|
+
if (values[value[1]][0] !== 'ArrayBuffer') {
|
|
1667
|
+
// without this, if we receive malformed input we could
|
|
1668
|
+
// end up trying to hydrate in a circle or allocate
|
|
1669
|
+
// huge amounts of memory when we call `new TypedArrayConstructor(buffer)`
|
|
1670
|
+
throw new Error('Invalid data');
|
|
1671
|
+
}
|
|
1672
|
+
|
|
1673
|
+
const buffer = hydrate(value[1]);
|
|
1674
|
+
|
|
1675
|
+
hydrated[index] = ops.fromViewInfo(type, buffer, value[2], value[3]);
|
|
1676
|
+
|
|
1677
|
+
break;
|
|
1678
|
+
}
|
|
1679
|
+
|
|
1680
|
+
case 'ArrayBuffer': {
|
|
1681
|
+
const base64 = value[1];
|
|
1682
|
+
if (typeof base64 !== 'string') {
|
|
1683
|
+
throw new Error('Invalid ArrayBuffer encoding');
|
|
1684
|
+
}
|
|
1685
|
+
hydrated[index] = ops.fromArrayBuffer(decode64(base64));
|
|
1686
|
+
break;
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
case 'URL':
|
|
1690
|
+
case 'URLSearchParams':
|
|
1691
|
+
case 'Temporal.Duration':
|
|
1692
|
+
case 'Temporal.Instant':
|
|
1693
|
+
case 'Temporal.PlainDate':
|
|
1694
|
+
case 'Temporal.PlainTime':
|
|
1695
|
+
case 'Temporal.PlainDateTime':
|
|
1696
|
+
case 'Temporal.PlainMonthDay':
|
|
1697
|
+
case 'Temporal.PlainYearMonth':
|
|
1698
|
+
case 'Temporal.ZonedDateTime': {
|
|
1699
|
+
// the same tags `toStringValue` serializes on the stringify side
|
|
1700
|
+
hydrated[index] = ops.fromStringValue(type, value[1]);
|
|
1701
|
+
break;
|
|
1702
|
+
}
|
|
1703
|
+
|
|
1704
|
+
default:
|
|
1705
|
+
throw new Error(`Unknown type ${type}`);
|
|
1706
|
+
}
|
|
1707
|
+
} else if (value[0] === SPARSE) {
|
|
1708
|
+
// Sparse array encoding: [SPARSE, length, idx, val, idx, val, ...]
|
|
1709
|
+
const len = value[1];
|
|
1710
|
+
|
|
1711
|
+
if (!is_valid_array_len(len)) {
|
|
1712
|
+
throw new Error('Invalid input');
|
|
1713
|
+
}
|
|
1714
|
+
|
|
1715
|
+
// `len` comes from the input rather than being bounded by it, so
|
|
1716
|
+
// `createSparseArray` is responsible for not allocating storage
|
|
1717
|
+
// proportional to it.
|
|
1718
|
+
const array = ops.createSparseArray(len);
|
|
1719
|
+
hydrated[index] = array;
|
|
1720
|
+
|
|
1721
|
+
for (let i = 2; i < value.length; i += 2) {
|
|
1722
|
+
const idx = value[i];
|
|
1723
|
+
|
|
1724
|
+
if (!is_valid_array_index(idx) || idx >= len) {
|
|
1725
|
+
throw new Error('Invalid input');
|
|
1726
|
+
}
|
|
1727
|
+
|
|
1728
|
+
ops.set(array, idx, hydrate(value[i + 1]));
|
|
1729
|
+
}
|
|
1730
|
+
} else {
|
|
1731
|
+
const array = ops.createArray(value.length);
|
|
1732
|
+
hydrated[index] = array;
|
|
1733
|
+
|
|
1734
|
+
for (let i = 0; i < value.length; i += 1) {
|
|
1735
|
+
const n = value[i];
|
|
1736
|
+
if (n === HOLE) continue;
|
|
1737
|
+
|
|
1738
|
+
ops.set(array, i, hydrate(n));
|
|
1739
|
+
}
|
|
1740
|
+
}
|
|
1741
|
+
} else {
|
|
1742
|
+
const object = ops.createObject();
|
|
1743
|
+
hydrated[index] = object;
|
|
1744
|
+
|
|
1745
|
+
for (const key of Object.keys(value)) {
|
|
1746
|
+
if (key === '__proto__') {
|
|
1747
|
+
throw new Error('Cannot parse an object with a `__proto__` property');
|
|
1748
|
+
}
|
|
1749
|
+
|
|
1750
|
+
ops.set(object, key, hydrate(value[key]));
|
|
1751
|
+
}
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
return hydrated[index];
|
|
1755
|
+
}
|
|
1756
|
+
|
|
1757
|
+
return hydrate(0);
|
|
1758
|
+
}
|
|
1759
|
+
|
|
1760
|
+
/**
|
|
1761
|
+
* Turn a value into a JSON string that can be parsed with `devalue.parse`
|
|
1762
|
+
* @param {any} value
|
|
1763
|
+
* @param {Record<string, (value: any) => any>} [reducers]
|
|
1764
|
+
* @param {import('./types.js').StringifyOptions} [options]
|
|
1765
|
+
*/
|
|
1766
|
+
function stringify$1(value, reducers, options) {
|
|
1767
|
+
const stringified = run(false, value, reducers);
|
|
1768
|
+
return typeof stringified === 'string' ? stringified : `[${stringified.join(',')}]`;
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1771
|
+
/**
|
|
1772
|
+
* @param {boolean} async
|
|
1773
|
+
* @param {any} value
|
|
1774
|
+
* @param {Record<string, (value: any) => any>} [reducers]
|
|
1775
|
+
* @param {import('./types.js').StringifyOptions} [options]
|
|
1776
|
+
*/
|
|
1777
|
+
function run(async, value, reducers, options) {
|
|
1778
|
+
const ops = merge_operations(default_stringify_operations);
|
|
1779
|
+
|
|
1780
|
+
/** @type {any[]} */
|
|
1781
|
+
const stringified = [];
|
|
1782
|
+
|
|
1783
|
+
/** @type {Map<any, number>} */
|
|
1784
|
+
const indexes = new Map();
|
|
1785
|
+
|
|
1786
|
+
/** @type {Array<{ key: string, fn: (value: any) => any }>} */
|
|
1787
|
+
const custom = [];
|
|
1788
|
+
if (reducers) {
|
|
1789
|
+
for (const key of Object.getOwnPropertyNames(reducers)) {
|
|
1790
|
+
custom.push({ key, fn: reducers[key] });
|
|
1791
|
+
}
|
|
1792
|
+
}
|
|
1793
|
+
|
|
1794
|
+
/** @type {string[]} */
|
|
1795
|
+
const keys = [];
|
|
1796
|
+
|
|
1797
|
+
let p = 0;
|
|
1798
|
+
|
|
1799
|
+
/**
|
|
1800
|
+
* @param {any} thing
|
|
1801
|
+
* @param {number} [index]
|
|
1802
|
+
*/
|
|
1803
|
+
function flatten(thing, index) {
|
|
1804
|
+
const type = ops.typeOf(thing);
|
|
1805
|
+
|
|
1806
|
+
if (type === 'undefined') return UNDEFINED;
|
|
1807
|
+
|
|
1808
|
+
/** @type {number | undefined} */
|
|
1809
|
+
let number;
|
|
1810
|
+
|
|
1811
|
+
// `ops.toPrimitive` is the boundary between the value being serialized and
|
|
1812
|
+
// plain host JavaScript: everything below operates on the extracted host
|
|
1813
|
+
// primitive, so native comparisons and arithmetic are correct there.
|
|
1814
|
+
if (type === 'number') {
|
|
1815
|
+
number = /** @type {number} */ (ops.toPrimitive(thing));
|
|
1816
|
+
if (Number.isNaN(number)) return NAN;
|
|
1817
|
+
if (number === Infinity) return POSITIVE_INFINITY;
|
|
1818
|
+
if (number === -Infinity) return NEGATIVE_INFINITY;
|
|
1819
|
+
if (number === 0 && 1 / number < 0) return NEGATIVE_ZERO;
|
|
1820
|
+
}
|
|
1821
|
+
|
|
1822
|
+
const id = ops.identify(thing);
|
|
1823
|
+
|
|
1824
|
+
if (indexes.has(id)) return /** @type {number} */ (indexes.get(id));
|
|
1825
|
+
|
|
1826
|
+
index ??= p++;
|
|
1827
|
+
indexes.set(id, index);
|
|
1828
|
+
|
|
1829
|
+
for (const { key, fn } of custom) {
|
|
1830
|
+
const value = fn(thing);
|
|
1831
|
+
if (value) {
|
|
1832
|
+
stringified[index] = `["${key}",${flatten(value)}]`;
|
|
1833
|
+
return index;
|
|
1834
|
+
}
|
|
1835
|
+
}
|
|
1836
|
+
|
|
1837
|
+
if (type === 'function') {
|
|
1838
|
+
throw new DevalueError(`Cannot stringify a function`, keys, thing, value);
|
|
1839
|
+
} else if (type === 'symbol') {
|
|
1840
|
+
throw new DevalueError(`Cannot stringify a Symbol primitive`, keys, thing, value);
|
|
1841
|
+
}
|
|
1842
|
+
|
|
1843
|
+
/** @type {string | Promise<any>} */
|
|
1844
|
+
let str = '';
|
|
1845
|
+
|
|
1846
|
+
if (type !== 'object') {
|
|
1847
|
+
str = stringify_primitive(type === 'number' ? number : ops.toPrimitive(thing));
|
|
1848
|
+
} else if (ops.isThenable(thing)) {
|
|
1849
|
+
{
|
|
1850
|
+
throw new DevalueError(
|
|
1851
|
+
`Cannot stringify a Promise or thenable — use stringifyAsync instead`,
|
|
1852
|
+
keys,
|
|
1853
|
+
thing,
|
|
1854
|
+
value
|
|
1855
|
+
);
|
|
1856
|
+
}
|
|
1857
|
+
} else {
|
|
1858
|
+
const tag = ops.tagOf(thing);
|
|
1859
|
+
|
|
1860
|
+
switch (tag) {
|
|
1861
|
+
case 'Number':
|
|
1862
|
+
case 'String':
|
|
1863
|
+
case 'Boolean':
|
|
1864
|
+
case 'BigInt':
|
|
1865
|
+
str = `["Object",${flatten(ops.unbox(thing))}]`;
|
|
1866
|
+
break;
|
|
1867
|
+
|
|
1868
|
+
case 'Date':
|
|
1869
|
+
str = `["Date","${ops.toISOString(thing)}"]`;
|
|
1870
|
+
break;
|
|
1871
|
+
|
|
1872
|
+
case 'URL':
|
|
1873
|
+
str = `["URL",${stringify_string(ops.toStringValue(thing))}]`;
|
|
1874
|
+
break;
|
|
1875
|
+
|
|
1876
|
+
case 'URLSearchParams':
|
|
1877
|
+
str = `["URLSearchParams",${stringify_string(ops.toStringValue(thing))}]`;
|
|
1878
|
+
break;
|
|
1879
|
+
|
|
1880
|
+
case 'RegExp':
|
|
1881
|
+
const { source, flags } = ops.regExpInfo(thing);
|
|
1882
|
+
str = flags
|
|
1883
|
+
? `["RegExp",${stringify_string(source)},"${flags}"]`
|
|
1884
|
+
: `["RegExp",${stringify_string(source)}]`;
|
|
1885
|
+
break;
|
|
1886
|
+
|
|
1887
|
+
case 'Array': {
|
|
1888
|
+
// For dense arrays (no holes), we iterate normally.
|
|
1889
|
+
// When we encounter the first hole, we call Object.keys
|
|
1890
|
+
// to determine the sparseness, then decide between:
|
|
1891
|
+
// - HOLE encoding: [-2, val, -2, ...] (default)
|
|
1892
|
+
// - Sparse encoding: [-7, length, idx, val, ...] (for very sparse arrays)
|
|
1893
|
+
// Only the sparse path avoids iterating every slot, which
|
|
1894
|
+
// is what protects against the DoS of e.g. `arr[1000000] = 1`.
|
|
1895
|
+
let mostly_dense = false;
|
|
1896
|
+
|
|
1897
|
+
const length = ops.lengthOf(thing);
|
|
1898
|
+
|
|
1899
|
+
str = '[';
|
|
1900
|
+
|
|
1901
|
+
for (let i = 0; i < length; i += 1) {
|
|
1902
|
+
if (i > 0) str += ',';
|
|
1903
|
+
|
|
1904
|
+
if (ops.hasOwn(thing, i)) {
|
|
1905
|
+
keys.push(`[${i}]`);
|
|
1906
|
+
str += flatten(ops.get(thing, i));
|
|
1907
|
+
keys.pop();
|
|
1908
|
+
} else if (mostly_dense) {
|
|
1909
|
+
// Use dense encoding. The heuristic guarantees the
|
|
1910
|
+
// array is only mildly sparse, so iterating over every
|
|
1911
|
+
// slot is fine.
|
|
1912
|
+
str += HOLE;
|
|
1913
|
+
} else {
|
|
1914
|
+
// Decide between HOLE encoding and sparse encoding.
|
|
1915
|
+
//
|
|
1916
|
+
// HOLE encoding: each hole is serialized as the HOLE
|
|
1917
|
+
// sentinel (-2). For example, [, "a", ,] becomes
|
|
1918
|
+
// [-2, 0, -2]. Each hole costs 3 chars ("-2" + comma).
|
|
1919
|
+
//
|
|
1920
|
+
// Sparse encoding: lists only populated indices.
|
|
1921
|
+
// For example, [, "a", ,] becomes [-7, 3, 1, 0] — the
|
|
1922
|
+
// -7 sentinel, the array length (3), then index-value
|
|
1923
|
+
// pairs. This avoids paying per-hole, but each element
|
|
1924
|
+
// costs extra chars to write its index.
|
|
1925
|
+
//
|
|
1926
|
+
// The values are the same size either way, so the
|
|
1927
|
+
// choice comes down to structural overhead:
|
|
1928
|
+
//
|
|
1929
|
+
// HOLE overhead:
|
|
1930
|
+
// 3 chars per hole ("-2" + comma)
|
|
1931
|
+
// = (L - P) * 3
|
|
1932
|
+
//
|
|
1933
|
+
// Sparse overhead:
|
|
1934
|
+
// "-7," — 3 chars (sparse sentinel + comma)
|
|
1935
|
+
// + length + "," — (d + 1) chars (array length + comma)
|
|
1936
|
+
// + per element: index + "," — (d + 1) chars
|
|
1937
|
+
// = (4 + d) + P * (d + 1)
|
|
1938
|
+
//
|
|
1939
|
+
// where L is the array length, P is the number of
|
|
1940
|
+
// populated elements, and d is the number of digits
|
|
1941
|
+
// in L (an upper bound on the digits in any index).
|
|
1942
|
+
//
|
|
1943
|
+
// Sparse encoding is cheaper when:
|
|
1944
|
+
// (4 + d) + P * (d + 1) < (L - P) * 3
|
|
1945
|
+
const populated_keys = ops.indicesOf(thing);
|
|
1946
|
+
const population = populated_keys.length;
|
|
1947
|
+
const d = String(length).length;
|
|
1948
|
+
|
|
1949
|
+
const hole_cost = (length - population) * 3;
|
|
1950
|
+
const sparse_cost = 4 + d + population * (d + 1);
|
|
1951
|
+
|
|
1952
|
+
if (hole_cost > sparse_cost) {
|
|
1953
|
+
str = '[' + SPARSE + ',' + length;
|
|
1954
|
+
for (let j = 0; j < populated_keys.length; j++) {
|
|
1955
|
+
const key = populated_keys[j];
|
|
1956
|
+
keys.push(`[${key}]`);
|
|
1957
|
+
str += ',' + key + ',' + flatten(ops.get(thing, key));
|
|
1958
|
+
keys.pop();
|
|
1959
|
+
}
|
|
1960
|
+
break;
|
|
1961
|
+
} else {
|
|
1962
|
+
mostly_dense = true;
|
|
1963
|
+
str += HOLE;
|
|
1964
|
+
}
|
|
1965
|
+
}
|
|
1966
|
+
}
|
|
1967
|
+
|
|
1968
|
+
str += ']';
|
|
1969
|
+
|
|
1970
|
+
break;
|
|
1971
|
+
}
|
|
1972
|
+
|
|
1973
|
+
case 'Set':
|
|
1974
|
+
str = '["Set"';
|
|
1975
|
+
|
|
1976
|
+
for (const value of ops.valuesOf(thing)) {
|
|
1977
|
+
str += `,${flatten(value)}`;
|
|
1978
|
+
}
|
|
1979
|
+
|
|
1980
|
+
str += ']';
|
|
1981
|
+
break;
|
|
1982
|
+
|
|
1983
|
+
case 'Map':
|
|
1984
|
+
str = '["Map"';
|
|
1985
|
+
|
|
1986
|
+
for (const [key, value] of ops.entriesOf(thing)) {
|
|
1987
|
+
const key_type = ops.typeOf(key);
|
|
1988
|
+
const key_is_primitive =
|
|
1989
|
+
key_type !== 'object' && key_type !== 'function' && key_type !== 'symbol';
|
|
1990
|
+
keys.push(
|
|
1991
|
+
`.get(${key_is_primitive ? stringify_primitive(ops.toPrimitive(key)) : '...'})`
|
|
1992
|
+
);
|
|
1993
|
+
str += `,${flatten(key)},${flatten(value)}`;
|
|
1994
|
+
keys.pop();
|
|
1995
|
+
}
|
|
1996
|
+
|
|
1997
|
+
str += ']';
|
|
1998
|
+
break;
|
|
1999
|
+
|
|
2000
|
+
case 'Int8Array':
|
|
2001
|
+
case 'Uint8Array':
|
|
2002
|
+
case 'Uint8ClampedArray':
|
|
2003
|
+
case 'Int16Array':
|
|
2004
|
+
case 'Uint16Array':
|
|
2005
|
+
case 'Float16Array':
|
|
2006
|
+
case 'Int32Array':
|
|
2007
|
+
case 'Uint32Array':
|
|
2008
|
+
case 'Float32Array':
|
|
2009
|
+
case 'Float64Array':
|
|
2010
|
+
case 'BigInt64Array':
|
|
2011
|
+
case 'BigUint64Array': {
|
|
2012
|
+
const info = ops.viewInfo(thing);
|
|
2013
|
+
str = '["' + tag + '",' + flatten(info.buffer);
|
|
2014
|
+
|
|
2015
|
+
// handle subarrays
|
|
2016
|
+
if (info.byteLength !== info.bufferByteLength) {
|
|
2017
|
+
str += `,${info.byteOffset},${info.length}`;
|
|
2018
|
+
}
|
|
2019
|
+
|
|
2020
|
+
str += ']';
|
|
2021
|
+
break;
|
|
2022
|
+
}
|
|
2023
|
+
|
|
2024
|
+
case 'DataView': {
|
|
2025
|
+
const info = ops.viewInfo(thing);
|
|
2026
|
+
str = '["' + tag + '",' + flatten(info.buffer);
|
|
2027
|
+
|
|
2028
|
+
if (info.byteLength !== info.bufferByteLength) {
|
|
2029
|
+
str += `,${info.byteOffset},${info.byteLength}`;
|
|
2030
|
+
}
|
|
2031
|
+
|
|
2032
|
+
str += ']';
|
|
2033
|
+
break;
|
|
2034
|
+
}
|
|
2035
|
+
|
|
2036
|
+
case 'ArrayBuffer': {
|
|
2037
|
+
const base64 = encode64(ops.toArrayBuffer(thing));
|
|
2038
|
+
|
|
2039
|
+
str = `["ArrayBuffer","${base64}"]`;
|
|
2040
|
+
break;
|
|
2041
|
+
}
|
|
2042
|
+
|
|
2043
|
+
case 'Temporal.Duration':
|
|
2044
|
+
case 'Temporal.Instant':
|
|
2045
|
+
case 'Temporal.PlainDate':
|
|
2046
|
+
case 'Temporal.PlainTime':
|
|
2047
|
+
case 'Temporal.PlainDateTime':
|
|
2048
|
+
case 'Temporal.PlainMonthDay':
|
|
2049
|
+
case 'Temporal.PlainYearMonth':
|
|
2050
|
+
case 'Temporal.ZonedDateTime':
|
|
2051
|
+
str = `["${tag}",${stringify_string(ops.toStringValue(thing))}]`;
|
|
2052
|
+
break;
|
|
2053
|
+
|
|
2054
|
+
default: {
|
|
2055
|
+
const shape = ops.shapeOf(thing);
|
|
2056
|
+
|
|
2057
|
+
if (shape.kind === 'not-plain') {
|
|
2058
|
+
throw new DevalueError(`Cannot stringify arbitrary non-POJOs`, keys, thing, value);
|
|
2059
|
+
}
|
|
2060
|
+
|
|
2061
|
+
if (shape.kind === 'symbol-keys') {
|
|
2062
|
+
throw new DevalueError(`Cannot stringify POJOs with symbolic keys`, keys, thing, value);
|
|
2063
|
+
}
|
|
2064
|
+
|
|
2065
|
+
if (shape.kind === 'null-proto') {
|
|
2066
|
+
str = '["null"';
|
|
2067
|
+
for (const key of shape.keys) {
|
|
2068
|
+
if (key === '__proto__') {
|
|
2069
|
+
throw new DevalueError(
|
|
2070
|
+
`Cannot stringify objects with __proto__ keys`,
|
|
2071
|
+
keys,
|
|
2072
|
+
thing,
|
|
2073
|
+
value
|
|
2074
|
+
);
|
|
2075
|
+
}
|
|
2076
|
+
|
|
2077
|
+
keys.push(stringify_key(key));
|
|
2078
|
+
str += `,${stringify_string(key)},${flatten(ops.get(thing, key))}`;
|
|
2079
|
+
keys.pop();
|
|
2080
|
+
}
|
|
2081
|
+
str += ']';
|
|
2082
|
+
} else {
|
|
2083
|
+
str = '{';
|
|
2084
|
+
let started = false;
|
|
2085
|
+
for (const key of shape.keys) {
|
|
2086
|
+
if (key === '__proto__') {
|
|
2087
|
+
throw new DevalueError(
|
|
2088
|
+
`Cannot stringify objects with __proto__ keys`,
|
|
2089
|
+
keys,
|
|
2090
|
+
thing,
|
|
2091
|
+
value
|
|
2092
|
+
);
|
|
2093
|
+
}
|
|
2094
|
+
|
|
2095
|
+
if (started) str += ',';
|
|
2096
|
+
started = true;
|
|
2097
|
+
keys.push(stringify_key(key));
|
|
2098
|
+
str += `${stringify_string(key)}:${flatten(ops.get(thing, key))}`;
|
|
2099
|
+
keys.pop();
|
|
2100
|
+
}
|
|
2101
|
+
str += '}';
|
|
2102
|
+
}
|
|
2103
|
+
}
|
|
2104
|
+
}
|
|
2105
|
+
}
|
|
2106
|
+
|
|
2107
|
+
stringified[index] = str;
|
|
2108
|
+
return index;
|
|
2109
|
+
}
|
|
2110
|
+
|
|
2111
|
+
const index = flatten(value);
|
|
2112
|
+
|
|
2113
|
+
// special case — value is represented as a negative index
|
|
2114
|
+
if (index < 0) return `${index}`;
|
|
2115
|
+
|
|
2116
|
+
return stringified;
|
|
2117
|
+
}
|
|
2118
|
+
|
|
2119
|
+
/**
|
|
2120
|
+
* @param {any} thing
|
|
2121
|
+
* @returns {string}
|
|
2122
|
+
*/
|
|
2123
|
+
function stringify_primitive(thing) {
|
|
2124
|
+
const type = typeof thing;
|
|
2125
|
+
if (type === 'string') return stringify_string(thing);
|
|
2126
|
+
if (thing === void 0) return UNDEFINED.toString();
|
|
2127
|
+
if (thing === 0 && 1 / thing < 0) return NEGATIVE_ZERO.toString();
|
|
2128
|
+
if (type === 'bigint') return `["BigInt","${thing}"]`;
|
|
2129
|
+
return String(thing);
|
|
2130
|
+
}
|
|
2131
|
+
|
|
2132
|
+
const text_encoder = new TextEncoder();
|
|
2133
|
+
|
|
2134
|
+
/** @import { StandardSchemaV1 } from '@standard-schema/spec' */
|
|
2135
|
+
|
|
2136
|
+
|
|
2137
|
+
// TODO 3.0: remove these types as they are not used anymore (we can't remove them yet because that would be a breaking change)
|
|
2138
|
+
/**
|
|
2139
|
+
* @template {number} TNumber
|
|
2140
|
+
* @template {any[]} [TArray=[]]
|
|
2141
|
+
* @typedef {TNumber extends TArray['length'] ? TArray[number] : LessThan<TNumber, [...TArray, TArray['length']]>} LessThan
|
|
2142
|
+
*/
|
|
2143
|
+
|
|
2144
|
+
/**
|
|
2145
|
+
* @template {number} TStart
|
|
2146
|
+
* @template {number} TEnd
|
|
2147
|
+
* @typedef {Exclude<TEnd | LessThan<TEnd>, LessThan<TStart>>} NumericRange
|
|
2148
|
+
*/
|
|
2149
|
+
|
|
2150
|
+
// Keep the status codes as `number` because restricting to certain numbers makes it unnecessarily hard to use compared to the benefits
|
|
2151
|
+
// (we have runtime errors already to check for invalid codes). Also see https://github.com/sveltejs/kit/issues/11780
|
|
2152
|
+
|
|
2153
|
+
// we have to repeat the JSDoc because the display for function overloads is broken
|
|
2154
|
+
// see https://github.com/microsoft/TypeScript/issues/55056
|
|
2155
|
+
|
|
2156
|
+
/**
|
|
2157
|
+
* Throws an error with a HTTP status code and an optional message.
|
|
2158
|
+
* When called during request handling, this will cause SvelteKit to
|
|
2159
|
+
* return an error response without invoking `handleError`.
|
|
2160
|
+
* Make sure you're not catching the thrown error, which would prevent SvelteKit from handling it.
|
|
2161
|
+
* @param {number} status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses). Must be in the range 400-599.
|
|
2162
|
+
* @param {App.Error} body An object that conforms to the App.Error type. If a string is passed, it will be used as the message property.
|
|
2163
|
+
* @overload
|
|
2164
|
+
* @param {number} status
|
|
2165
|
+
* @param {App.Error} body
|
|
2166
|
+
* @return {never}
|
|
2167
|
+
* @throws {HttpError} This error instructs SvelteKit to initiate HTTP error handling.
|
|
2168
|
+
* @throws {Error} If the provided status is invalid (not between 400 and 599).
|
|
2169
|
+
*/
|
|
2170
|
+
/**
|
|
2171
|
+
* Throws an error with a HTTP status code and an optional message.
|
|
2172
|
+
* When called during request handling, this will cause SvelteKit to
|
|
2173
|
+
* return an error response without invoking `handleError`.
|
|
2174
|
+
* Make sure you're not catching the thrown error, which would prevent SvelteKit from handling it.
|
|
2175
|
+
* @param {number} status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses). Must be in the range 400-599.
|
|
2176
|
+
* @param {{ message: string } extends App.Error ? App.Error | string | undefined : never} [body] An object that conforms to the App.Error type. If a string is passed, it will be used as the message property.
|
|
2177
|
+
* @overload
|
|
2178
|
+
* @param {number} status
|
|
2179
|
+
* @param {{ message: string } extends App.Error ? App.Error | string | undefined : never} [body]
|
|
2180
|
+
* @return {never}
|
|
2181
|
+
* @throws {HttpError} This error instructs SvelteKit to initiate HTTP error handling.
|
|
2182
|
+
* @throws {Error} If the provided status is invalid (not between 400 and 599).
|
|
2183
|
+
*/
|
|
2184
|
+
/**
|
|
2185
|
+
* Throws an error with a HTTP status code and an optional message.
|
|
2186
|
+
* When called during request handling, this will cause SvelteKit to
|
|
2187
|
+
* return an error response without invoking `handleError`.
|
|
2188
|
+
* Make sure you're not catching the thrown error, which would prevent SvelteKit from handling it.
|
|
2189
|
+
* @param {number} status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses). Must be in the range 400-599.
|
|
2190
|
+
* @param {{ message: string } extends App.Error ? App.Error | string | undefined : never} body An object that conforms to the App.Error type. If a string is passed, it will be used as the message property.
|
|
2191
|
+
* @return {never}
|
|
2192
|
+
* @throws {HttpError} This error instructs SvelteKit to initiate HTTP error handling.
|
|
2193
|
+
* @throws {Error} If the provided status is invalid (not between 400 and 599).
|
|
2194
|
+
*/
|
|
2195
|
+
function error(status, body) {
|
|
2196
|
+
if ((isNaN(status) || status < 400 || status > 599)) {
|
|
2197
|
+
throw new Error(`HTTP error status codes must be between 400 and 599 — ${status} is invalid`);
|
|
2198
|
+
}
|
|
2199
|
+
|
|
2200
|
+
throw new HttpError(status, body);
|
|
2201
|
+
}
|
|
2202
|
+
|
|
2203
|
+
/**
|
|
2204
|
+
* Redirect a request. When called during request handling, SvelteKit will return a redirect response.
|
|
2205
|
+
* Make sure you're not catching the thrown redirect, which would prevent SvelteKit from handling it.
|
|
2206
|
+
*
|
|
2207
|
+
* Most common status codes:
|
|
2208
|
+
* * `303 See Other`: redirect as a GET request (often used after a form POST request)
|
|
2209
|
+
* * `307 Temporary Redirect`: redirect will keep the request method
|
|
2210
|
+
* * `308 Permanent Redirect`: redirect will keep the request method, SEO will be transferred to the new page
|
|
2211
|
+
*
|
|
2212
|
+
* [See all redirect status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#redirection_messages)
|
|
2213
|
+
*
|
|
2214
|
+
* @param {300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | ({} & number)} status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#redirection_messages). Must be in the range 300-308.
|
|
2215
|
+
* @param {string | URL} location The location to redirect to.
|
|
2216
|
+
* @throws {Redirect} This error instructs SvelteKit to redirect to the specified location.
|
|
2217
|
+
* @throws {Error} If the provided status is invalid or the location cannot be used as a header value.
|
|
2218
|
+
* @return {never}
|
|
2219
|
+
*/
|
|
2220
|
+
function redirect(status, location) {
|
|
2221
|
+
if ((isNaN(status) || status < 300 || status > 308)) {
|
|
2222
|
+
throw new Error('Invalid status code');
|
|
2223
|
+
}
|
|
2224
|
+
|
|
2225
|
+
throw new Redirect(
|
|
2226
|
+
// @ts-ignore
|
|
2227
|
+
status,
|
|
2228
|
+
location.toString()
|
|
2229
|
+
);
|
|
2230
|
+
}
|
|
2231
|
+
|
|
2232
|
+
/**
|
|
2233
|
+
* Checks whether this is a redirect thrown by {@link redirect}.
|
|
2234
|
+
* @param {unknown} e The object to check.
|
|
2235
|
+
* @return {e is Redirect}
|
|
2236
|
+
*/
|
|
2237
|
+
function isRedirect(e) {
|
|
2238
|
+
return e instanceof Redirect;
|
|
2239
|
+
}
|
|
2240
|
+
|
|
2241
|
+
/**
|
|
2242
|
+
* Create a JSON `Response` object from the supplied data.
|
|
2243
|
+
* @param {any} data The value that will be serialized as JSON.
|
|
2244
|
+
* @param {ResponseInit} [init] Options such as `status` and `headers` that will be added to the response. `Content-Type: application/json` and `Content-Length` headers will be added automatically.
|
|
2245
|
+
*/
|
|
2246
|
+
function json(data, init) {
|
|
2247
|
+
// TODO deprecate this in favour of `Response.json` when it's
|
|
2248
|
+
// more widely supported
|
|
2249
|
+
const body = JSON.stringify(data);
|
|
2250
|
+
|
|
2251
|
+
// we can't just do `text(JSON.stringify(data), init)` because
|
|
2252
|
+
// it will set a default `content-type` header. duplicated code
|
|
2253
|
+
// means less duplicated work
|
|
2254
|
+
const headers = new Headers(init?.headers);
|
|
2255
|
+
if (!headers.has('content-length')) {
|
|
2256
|
+
headers.set('content-length', text_encoder.encode(body).byteLength.toString());
|
|
2257
|
+
}
|
|
2258
|
+
|
|
2259
|
+
if (!headers.has('content-type')) {
|
|
2260
|
+
headers.set('content-type', 'application/json');
|
|
2261
|
+
}
|
|
2262
|
+
|
|
2263
|
+
return new Response(body, {
|
|
2264
|
+
...init,
|
|
2265
|
+
headers
|
|
2266
|
+
});
|
|
2267
|
+
}
|
|
2268
|
+
|
|
2269
|
+
/**
|
|
2270
|
+
* Create a `Response` object from the supplied body.
|
|
2271
|
+
* @param {string} body The value that will be used as-is.
|
|
2272
|
+
* @param {ResponseInit} [init] Options such as `status` and `headers` that will be added to the response. A `Content-Length` header will be added automatically.
|
|
2273
|
+
*/
|
|
2274
|
+
function text(body, init) {
|
|
2275
|
+
const headers = new Headers(init?.headers);
|
|
2276
|
+
if (!headers.has('content-length')) {
|
|
2277
|
+
const encoded = text_encoder.encode(body);
|
|
2278
|
+
headers.set('content-length', encoded.byteLength.toString());
|
|
2279
|
+
return new Response(encoded, {
|
|
2280
|
+
...init,
|
|
2281
|
+
headers
|
|
2282
|
+
});
|
|
2283
|
+
}
|
|
2284
|
+
|
|
2285
|
+
return new Response(body, {
|
|
2286
|
+
...init,
|
|
2287
|
+
headers
|
|
2288
|
+
});
|
|
2289
|
+
}
|
|
2290
|
+
|
|
2291
|
+
// eslint-disable-next-line n/prefer-global/process
|
|
2292
|
+
const IN_WEBCONTAINER = !!globalThis.process?.versions?.webcontainer;
|
|
2293
|
+
|
|
2294
|
+
/** @import { RequestEvent } from '@sveltejs/kit' */
|
|
2295
|
+
/** @import { RequestStore } from 'types' */
|
|
2296
|
+
/** @import { AsyncLocalStorage } from 'node:async_hooks' */
|
|
2297
|
+
|
|
2298
|
+
|
|
2299
|
+
/** @type {RequestStore | null} */
|
|
2300
|
+
let sync_store = null;
|
|
2301
|
+
|
|
2302
|
+
/** @type {AsyncLocalStorage<RequestStore | null> | null} */
|
|
2303
|
+
let als;
|
|
2304
|
+
|
|
2305
|
+
import('node:async_hooks')
|
|
2306
|
+
.then((hooks) => (als = new hooks.AsyncLocalStorage()))
|
|
2307
|
+
.catch(() => {
|
|
2308
|
+
// can't use AsyncLocalStorage, but can still call getRequestEvent synchronously.
|
|
2309
|
+
// this isn't behind `supports` because it's basically just StackBlitz (i.e.
|
|
2310
|
+
// in-browser usage) that doesn't support it AFAICT
|
|
2311
|
+
});
|
|
2312
|
+
|
|
2313
|
+
/**
|
|
2314
|
+
* @template T
|
|
2315
|
+
* @param {RequestStore | null} store
|
|
2316
|
+
* @param {() => T} fn
|
|
2317
|
+
*/
|
|
2318
|
+
function with_request_store(store, fn) {
|
|
2319
|
+
try {
|
|
2320
|
+
sync_store = store;
|
|
2321
|
+
return als ? als.run(store, fn) : fn();
|
|
2322
|
+
} finally {
|
|
2323
|
+
// Since AsyncLocalStorage is not working in webcontainers, we don't reset `sync_store`
|
|
2324
|
+
// and handle only one request at a time in `src/runtime/server/index.js`.
|
|
2325
|
+
if (!IN_WEBCONTAINER) {
|
|
2326
|
+
sync_store = null;
|
|
2327
|
+
}
|
|
2328
|
+
}
|
|
2329
|
+
}
|
|
2330
|
+
|
|
2331
|
+
/**
|
|
2332
|
+
* @template {{ tracing: { enabled: boolean, root: import('@opentelemetry/api').Span, current: import('@opentelemetry/api').Span } }} T
|
|
2333
|
+
* @param {T} event_like
|
|
2334
|
+
* @param {import('@opentelemetry/api').Span} current
|
|
2335
|
+
* @returns {T}
|
|
2336
|
+
*/
|
|
2337
|
+
function merge_tracing(event_like, current) {
|
|
2338
|
+
return {
|
|
2339
|
+
...event_like,
|
|
2340
|
+
tracing: {
|
|
2341
|
+
...event_like.tracing,
|
|
2342
|
+
current
|
|
2343
|
+
}
|
|
2344
|
+
};
|
|
2345
|
+
}
|
|
2346
|
+
|
|
2347
|
+
const SVELTE_KIT_ASSETS = "/_svelte_kit_assets";
|
|
2348
|
+
const ENDPOINT_METHODS = ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"];
|
|
2349
|
+
const PAGE_METHODS = ["GET", "POST", "HEAD"];
|
|
2350
|
+
function noop() {
|
|
2351
|
+
}
|
|
2352
|
+
function once(fn) {
|
|
2353
|
+
let done = false;
|
|
2354
|
+
let result;
|
|
2355
|
+
return () => {
|
|
2356
|
+
if (done) return result;
|
|
2357
|
+
done = true;
|
|
2358
|
+
return result = fn();
|
|
2359
|
+
};
|
|
2360
|
+
}
|
|
2361
|
+
const decoder = new TextDecoder();
|
|
2362
|
+
function set_nested_value(object, path_string, value) {
|
|
2363
|
+
if (path_string.startsWith("n:")) {
|
|
2364
|
+
path_string = path_string.slice(2);
|
|
2365
|
+
value = value === "" ? void 0 : parseFloat(value);
|
|
2366
|
+
} else if (path_string.startsWith("b:")) {
|
|
2367
|
+
path_string = path_string.slice(2);
|
|
2368
|
+
value = value === "on";
|
|
2369
|
+
}
|
|
2370
|
+
deep_set(object, split_path(path_string), value);
|
|
2371
|
+
}
|
|
2372
|
+
const DELETE_KEY = {};
|
|
2373
|
+
function convert_formdata(data) {
|
|
2374
|
+
const result = {};
|
|
2375
|
+
for (let key of data.keys()) {
|
|
2376
|
+
const is_array = key.endsWith("[]");
|
|
2377
|
+
let values = data.getAll(key);
|
|
2378
|
+
if (is_array) key = key.slice(0, -2);
|
|
2379
|
+
values = values.filter(
|
|
2380
|
+
(entry) => typeof entry === "string" || entry.name !== "" || entry.size > 0
|
|
2381
|
+
);
|
|
2382
|
+
if (values.length === 0 && !is_array) continue;
|
|
2383
|
+
if (key.startsWith("n:")) {
|
|
2384
|
+
key = key.slice(2);
|
|
2385
|
+
values = values.map((v) => v === "" ? void 0 : parseFloat(
|
|
2386
|
+
/** @type {string} */
|
|
2387
|
+
v
|
|
2388
|
+
));
|
|
2389
|
+
} else if (key.startsWith("b:")) {
|
|
2390
|
+
key = key.slice(2);
|
|
2391
|
+
values = values.map((v) => v === "on");
|
|
2392
|
+
}
|
|
2393
|
+
if (values.length > 1 && !is_array) {
|
|
2394
|
+
throw new Error(`Form cannot contain duplicated keys — "${key}" has ${values.length} values`);
|
|
2395
|
+
}
|
|
2396
|
+
set_nested_value(result, key, is_array ? values : values[0]);
|
|
2397
|
+
}
|
|
2398
|
+
return result;
|
|
2399
|
+
}
|
|
2400
|
+
const BINARY_FORM_CONTENT_TYPE = "application/x-sveltekit-formdata";
|
|
2401
|
+
const BINARY_FORM_VERSION = 0;
|
|
2402
|
+
const HEADER_BYTES = 1 + 4 + 2;
|
|
2403
|
+
async function deserialize_binary_form(request) {
|
|
2404
|
+
if (request.headers.get("content-type") !== BINARY_FORM_CONTENT_TYPE) {
|
|
2405
|
+
const form_data = await request.formData();
|
|
2406
|
+
return { data: convert_formdata(form_data), meta: {}, form_data };
|
|
2407
|
+
}
|
|
2408
|
+
if (!request.body) {
|
|
2409
|
+
throw deserialize_error("no body");
|
|
2410
|
+
}
|
|
2411
|
+
const reader = request.body.getReader();
|
|
2412
|
+
const chunks = [];
|
|
2413
|
+
function get_chunk(index) {
|
|
2414
|
+
if (index in chunks) return chunks[index];
|
|
2415
|
+
let i = chunks.length;
|
|
2416
|
+
while (i <= index) {
|
|
2417
|
+
chunks[i] = reader.read().then((chunk) => chunk.value);
|
|
2418
|
+
i++;
|
|
2419
|
+
}
|
|
2420
|
+
return chunks[index];
|
|
2421
|
+
}
|
|
2422
|
+
async function get_buffer(offset, length) {
|
|
2423
|
+
let start_chunk;
|
|
2424
|
+
let chunk_start = 0;
|
|
2425
|
+
let chunk_index;
|
|
2426
|
+
for (chunk_index = 0; ; chunk_index++) {
|
|
2427
|
+
const chunk = await get_chunk(chunk_index);
|
|
2428
|
+
if (!chunk) return null;
|
|
2429
|
+
const chunk_end = chunk_start + chunk.byteLength;
|
|
2430
|
+
if (offset >= chunk_start && offset < chunk_end) {
|
|
2431
|
+
start_chunk = chunk;
|
|
2432
|
+
break;
|
|
2433
|
+
}
|
|
2434
|
+
chunk_start = chunk_end;
|
|
2435
|
+
}
|
|
2436
|
+
if (offset + length <= chunk_start + start_chunk.byteLength) {
|
|
2437
|
+
return start_chunk.subarray(offset - chunk_start, offset + length - chunk_start);
|
|
2438
|
+
}
|
|
2439
|
+
const chunks2 = [start_chunk.subarray(offset - chunk_start)];
|
|
2440
|
+
let cursor = start_chunk.byteLength - offset + chunk_start;
|
|
2441
|
+
while (cursor < length) {
|
|
2442
|
+
chunk_index++;
|
|
2443
|
+
let chunk = await get_chunk(chunk_index);
|
|
2444
|
+
if (!chunk) return null;
|
|
2445
|
+
if (chunk.byteLength > length - cursor) {
|
|
2446
|
+
chunk = chunk.subarray(0, length - cursor);
|
|
2447
|
+
}
|
|
2448
|
+
chunks2.push(chunk);
|
|
2449
|
+
cursor += chunk.byteLength;
|
|
2450
|
+
}
|
|
2451
|
+
const buffer = new Uint8Array(length);
|
|
2452
|
+
cursor = 0;
|
|
2453
|
+
for (const chunk of chunks2) {
|
|
2454
|
+
buffer.set(chunk, cursor);
|
|
2455
|
+
cursor += chunk.byteLength;
|
|
2456
|
+
}
|
|
2457
|
+
return buffer;
|
|
2458
|
+
}
|
|
2459
|
+
const header = await get_buffer(0, HEADER_BYTES);
|
|
2460
|
+
if (!header) throw deserialize_error("too short");
|
|
2461
|
+
if (header[0] !== BINARY_FORM_VERSION) {
|
|
2462
|
+
throw deserialize_error(`got version ${header[0]}, expected version ${BINARY_FORM_VERSION}`);
|
|
2463
|
+
}
|
|
2464
|
+
const header_view = new DataView(header.buffer, header.byteOffset, header.byteLength);
|
|
2465
|
+
const data_length = header_view.getUint32(1, true);
|
|
2466
|
+
const file_offsets_length = header_view.getUint16(5, true);
|
|
2467
|
+
const data_buffer = await get_buffer(HEADER_BYTES, data_length);
|
|
2468
|
+
if (!data_buffer) throw deserialize_error("data too short");
|
|
2469
|
+
let file_offsets;
|
|
2470
|
+
let files_start_offset;
|
|
2471
|
+
if (file_offsets_length > 0) {
|
|
2472
|
+
const file_offsets_buffer = await get_buffer(HEADER_BYTES + data_length, file_offsets_length);
|
|
2473
|
+
if (!file_offsets_buffer) throw deserialize_error("file offset table too short");
|
|
2474
|
+
const parsed_offsets = JSON.parse(decoder.decode(file_offsets_buffer));
|
|
2475
|
+
if (!Array.isArray(parsed_offsets) || parsed_offsets.some((n) => typeof n !== "number" || !Number.isInteger(n) || n < 0)) {
|
|
2476
|
+
throw deserialize_error("invalid file offset table");
|
|
2477
|
+
}
|
|
2478
|
+
file_offsets = /** @type {Array<number>} */
|
|
2479
|
+
parsed_offsets;
|
|
2480
|
+
files_start_offset = HEADER_BYTES + data_length + file_offsets_length;
|
|
2481
|
+
}
|
|
2482
|
+
const file_spans = [];
|
|
2483
|
+
const [data, meta] = parse(decoder.decode(data_buffer), {
|
|
2484
|
+
File: ([name, type, size, last_modified, index]) => {
|
|
2485
|
+
if (typeof name !== "string" || typeof type !== "string" || typeof size !== "number" || typeof last_modified !== "number" || typeof index !== "number") {
|
|
2486
|
+
throw deserialize_error("invalid file metadata");
|
|
2487
|
+
}
|
|
2488
|
+
let offset = file_offsets[index];
|
|
2489
|
+
if (offset === void 0) {
|
|
2490
|
+
throw deserialize_error("duplicate file offset table index");
|
|
2491
|
+
}
|
|
2492
|
+
file_offsets[index] = void 0;
|
|
2493
|
+
offset += files_start_offset;
|
|
2494
|
+
file_spans.push({ offset, size });
|
|
2495
|
+
return new Proxy(new LazyFile(name, type, size, last_modified, get_chunk, offset), {
|
|
2496
|
+
getPrototypeOf() {
|
|
2497
|
+
return File.prototype;
|
|
2498
|
+
}
|
|
2499
|
+
});
|
|
2500
|
+
}
|
|
2501
|
+
});
|
|
2502
|
+
file_spans.sort((a, b) => a.offset - b.offset || a.size - b.size);
|
|
2503
|
+
for (let i = 1; i < file_spans.length; i++) {
|
|
2504
|
+
const previous = file_spans[i - 1];
|
|
2505
|
+
const current = file_spans[i];
|
|
2506
|
+
const previous_end = previous.offset + previous.size;
|
|
2507
|
+
if (previous_end < current.offset) {
|
|
2508
|
+
throw deserialize_error("gaps in file data");
|
|
2509
|
+
}
|
|
2510
|
+
if (previous_end > current.offset) {
|
|
2511
|
+
throw deserialize_error("overlapping file data");
|
|
2512
|
+
}
|
|
2513
|
+
}
|
|
2514
|
+
void (async () => {
|
|
2515
|
+
let has_more = true;
|
|
2516
|
+
while (has_more) {
|
|
2517
|
+
const chunk = await get_chunk(chunks.length);
|
|
2518
|
+
has_more = !!chunk;
|
|
2519
|
+
}
|
|
2520
|
+
})().catch(noop);
|
|
2521
|
+
return { data, meta, form_data: null };
|
|
2522
|
+
}
|
|
2523
|
+
function deserialize_error(message) {
|
|
2524
|
+
return new SvelteKitError(400, "Bad Request", `Could not deserialize binary form: ${message}`);
|
|
2525
|
+
}
|
|
2526
|
+
class LazyFile {
|
|
2527
|
+
/** @type {(index: number) => Promise<Uint8Array<ArrayBuffer> | undefined>} */
|
|
2528
|
+
#get_chunk;
|
|
2529
|
+
/** @type {number} */
|
|
2530
|
+
#offset;
|
|
2531
|
+
/**
|
|
2532
|
+
* @param {string} name
|
|
2533
|
+
* @param {string} type
|
|
2534
|
+
* @param {number} size
|
|
2535
|
+
* @param {number} last_modified
|
|
2536
|
+
* @param {(index: number) => Promise<Uint8Array<ArrayBuffer> | undefined>} get_chunk
|
|
2537
|
+
* @param {number} offset
|
|
2538
|
+
*/
|
|
2539
|
+
constructor(name, type, size, last_modified, get_chunk, offset) {
|
|
2540
|
+
this.name = name;
|
|
2541
|
+
this.type = type;
|
|
2542
|
+
this.size = size;
|
|
2543
|
+
this.lastModified = last_modified;
|
|
2544
|
+
this.webkitRelativePath = "";
|
|
2545
|
+
this.#get_chunk = get_chunk;
|
|
2546
|
+
this.#offset = offset;
|
|
2547
|
+
this.arrayBuffer = this.arrayBuffer.bind(this);
|
|
2548
|
+
this.bytes = this.bytes.bind(this);
|
|
2549
|
+
this.slice = this.slice.bind(this);
|
|
2550
|
+
this.stream = this.stream.bind(this);
|
|
2551
|
+
this.text = this.text.bind(this);
|
|
2552
|
+
}
|
|
2553
|
+
/** @type {ArrayBuffer | undefined} */
|
|
2554
|
+
#buffer;
|
|
2555
|
+
async arrayBuffer() {
|
|
2556
|
+
this.#buffer ??= await new Response(this.stream()).arrayBuffer();
|
|
2557
|
+
return this.#buffer;
|
|
2558
|
+
}
|
|
2559
|
+
async bytes() {
|
|
2560
|
+
return new Uint8Array(await this.arrayBuffer());
|
|
2561
|
+
}
|
|
2562
|
+
/**
|
|
2563
|
+
* @param {number=} start
|
|
2564
|
+
* @param {number=} end
|
|
2565
|
+
* @param {string=} contentType
|
|
2566
|
+
*/
|
|
2567
|
+
slice(start = 0, end = this.size, contentType = this.type) {
|
|
2568
|
+
if (start < 0) {
|
|
2569
|
+
start = Math.max(this.size + start, 0);
|
|
2570
|
+
} else {
|
|
2571
|
+
start = Math.min(start, this.size);
|
|
2572
|
+
}
|
|
2573
|
+
if (end < 0) {
|
|
2574
|
+
end = Math.max(this.size + end, 0);
|
|
2575
|
+
} else {
|
|
2576
|
+
end = Math.min(end, this.size);
|
|
2577
|
+
}
|
|
2578
|
+
const size = Math.max(end - start, 0);
|
|
2579
|
+
const file = new LazyFile(
|
|
2580
|
+
this.name,
|
|
2581
|
+
contentType,
|
|
2582
|
+
size,
|
|
2583
|
+
this.lastModified,
|
|
2584
|
+
this.#get_chunk,
|
|
2585
|
+
this.#offset + start
|
|
2586
|
+
);
|
|
2587
|
+
return file;
|
|
2588
|
+
}
|
|
2589
|
+
stream() {
|
|
2590
|
+
let cursor = 0;
|
|
2591
|
+
let chunk_index = 0;
|
|
2592
|
+
return new ReadableStream({
|
|
2593
|
+
start: async (controller) => {
|
|
2594
|
+
let chunk_start = 0;
|
|
2595
|
+
let start_chunk;
|
|
2596
|
+
for (chunk_index = 0; ; chunk_index++) {
|
|
2597
|
+
const chunk = await this.#get_chunk(chunk_index);
|
|
2598
|
+
if (!chunk) return null;
|
|
2599
|
+
const chunk_end = chunk_start + chunk.byteLength;
|
|
2600
|
+
if (this.#offset >= chunk_start && this.#offset < chunk_end) {
|
|
2601
|
+
start_chunk = chunk;
|
|
2602
|
+
break;
|
|
2603
|
+
}
|
|
2604
|
+
chunk_start = chunk_end;
|
|
2605
|
+
}
|
|
2606
|
+
if (this.#offset + this.size <= chunk_start + start_chunk.byteLength) {
|
|
2607
|
+
controller.enqueue(
|
|
2608
|
+
start_chunk.subarray(this.#offset - chunk_start, this.#offset + this.size - chunk_start)
|
|
2609
|
+
);
|
|
2610
|
+
controller.close();
|
|
2611
|
+
} else {
|
|
2612
|
+
controller.enqueue(start_chunk.subarray(this.#offset - chunk_start));
|
|
2613
|
+
cursor = start_chunk.byteLength - this.#offset + chunk_start;
|
|
2614
|
+
}
|
|
2615
|
+
},
|
|
2616
|
+
pull: async (controller) => {
|
|
2617
|
+
chunk_index++;
|
|
2618
|
+
let chunk = await this.#get_chunk(chunk_index);
|
|
2619
|
+
if (!chunk) {
|
|
2620
|
+
controller.error("incomplete file data");
|
|
2621
|
+
controller.close();
|
|
2622
|
+
return;
|
|
2623
|
+
}
|
|
2624
|
+
if (chunk.byteLength > this.size - cursor) {
|
|
2625
|
+
chunk = chunk.subarray(0, this.size - cursor);
|
|
2626
|
+
}
|
|
2627
|
+
controller.enqueue(chunk);
|
|
2628
|
+
cursor += chunk.byteLength;
|
|
2629
|
+
if (cursor >= this.size) {
|
|
2630
|
+
controller.close();
|
|
2631
|
+
}
|
|
2632
|
+
}
|
|
2633
|
+
});
|
|
2634
|
+
}
|
|
2635
|
+
async text() {
|
|
2636
|
+
return decoder.decode(await this.arrayBuffer());
|
|
2637
|
+
}
|
|
2638
|
+
}
|
|
2639
|
+
const path_regex = /^[a-zA-Z_$]\w*(\.[a-zA-Z_$]\w*|\[\d+\])*$/;
|
|
2640
|
+
function split_path(path) {
|
|
2641
|
+
if (!path_regex.test(path)) {
|
|
2642
|
+
throw new Error(`Invalid path ${path}`);
|
|
2643
|
+
}
|
|
2644
|
+
return path.split(/\.|\[|\]/).filter(Boolean);
|
|
2645
|
+
}
|
|
2646
|
+
function check_prototype_pollution(key) {
|
|
2647
|
+
if (key === "__proto__" || key === "constructor" || key === "prototype") {
|
|
2648
|
+
throw new Error(
|
|
2649
|
+
`Invalid key "${key}"`
|
|
2650
|
+
);
|
|
2651
|
+
}
|
|
2652
|
+
}
|
|
2653
|
+
function deep_set(object, keys, value) {
|
|
2654
|
+
let current = object;
|
|
2655
|
+
for (let i = 0; i < keys.length - 1; i += 1) {
|
|
2656
|
+
const key = keys[i];
|
|
2657
|
+
check_prototype_pollution(key);
|
|
2658
|
+
const is_array = /^\d+$/.test(keys[i + 1]);
|
|
2659
|
+
const inner = Object.hasOwn(current, key) ? current[key] : void 0;
|
|
2660
|
+
const exists = inner != null;
|
|
2661
|
+
if (exists && is_array !== Array.isArray(inner)) {
|
|
2662
|
+
throw new Error(`Invalid array key ${keys[i + 1]}`);
|
|
2663
|
+
}
|
|
2664
|
+
if (!exists) {
|
|
2665
|
+
if (value === DELETE_KEY) {
|
|
2666
|
+
return;
|
|
2667
|
+
}
|
|
2668
|
+
current[key] = is_array ? [] : {};
|
|
2669
|
+
}
|
|
2670
|
+
current = current[key];
|
|
2671
|
+
}
|
|
2672
|
+
const final_key = keys[keys.length - 1];
|
|
2673
|
+
check_prototype_pollution(final_key);
|
|
2674
|
+
if (value === DELETE_KEY) {
|
|
2675
|
+
delete current[final_key];
|
|
2676
|
+
} else {
|
|
2677
|
+
current[final_key] = value;
|
|
2678
|
+
}
|
|
2679
|
+
}
|
|
2680
|
+
const INVALIDATED_PARAM = "x-sveltekit-invalidated";
|
|
2681
|
+
const TRAILING_SLASH_PARAM = "x-sveltekit-trailing-slash";
|
|
2682
|
+
function stringify(data, transport) {
|
|
2683
|
+
const encoders = Object.fromEntries(Object.entries(transport).map(([k, v]) => [k, v.encode]));
|
|
2684
|
+
return stringify$1(data, encoders);
|
|
2685
|
+
}
|
|
2686
|
+
const remote_object = "__skrao";
|
|
2687
|
+
const remote_map = "__skram";
|
|
2688
|
+
const remote_set = "__skras";
|
|
2689
|
+
const remote_file = "__skraf";
|
|
2690
|
+
function create_remote_arg_revivers(transport) {
|
|
2691
|
+
const remote_fns_revivers = {
|
|
2692
|
+
/** @type {(value: unknown) => unknown} */
|
|
2693
|
+
[remote_object]: (value) => value,
|
|
2694
|
+
/** @type {(value: unknown) => Map<unknown, unknown>} */
|
|
2695
|
+
[remote_map]: (value) => {
|
|
2696
|
+
if (!Array.isArray(value)) {
|
|
2697
|
+
throw new Error("Invalid data for Map reviver");
|
|
2698
|
+
}
|
|
2699
|
+
const map = /* @__PURE__ */ new Map();
|
|
2700
|
+
for (const item of value) {
|
|
2701
|
+
if (!Array.isArray(item) || item.length !== 2 || typeof item[0] !== "string" || typeof item[1] !== "string") {
|
|
2702
|
+
throw new Error("Invalid data for Map reviver");
|
|
2703
|
+
}
|
|
2704
|
+
const [key, val] = item;
|
|
2705
|
+
map.set(parse$1(key), parse$1(val));
|
|
2706
|
+
}
|
|
2707
|
+
return map;
|
|
2708
|
+
},
|
|
2709
|
+
/** @type {(value: unknown) => Set<unknown>} */
|
|
2710
|
+
[remote_set]: (value) => {
|
|
2711
|
+
if (!Array.isArray(value)) {
|
|
2712
|
+
throw new Error("Invalid data for Set reviver");
|
|
2713
|
+
}
|
|
2714
|
+
const set = /* @__PURE__ */ new Set();
|
|
2715
|
+
for (const item of value) {
|
|
2716
|
+
if (typeof item !== "string") {
|
|
2717
|
+
throw new Error("Invalid data for Set reviver");
|
|
2718
|
+
}
|
|
2719
|
+
set.add(parse$1(item));
|
|
2720
|
+
}
|
|
2721
|
+
return set;
|
|
2722
|
+
},
|
|
2723
|
+
/** @type {(value: any) => File} */
|
|
2724
|
+
[remote_file]: (value) => {
|
|
2725
|
+
if (!value || typeof value !== "object" || typeof value.name !== "string" || typeof value.type !== "string" || typeof value.size !== "number" || typeof value.lastModified !== "number" || !(value.data instanceof ArrayBuffer)) {
|
|
2726
|
+
throw new Error("Invalid data for File reviver");
|
|
2727
|
+
}
|
|
2728
|
+
const { data, name, ...meta } = value;
|
|
2729
|
+
return new File([data], name, meta);
|
|
2730
|
+
}
|
|
2731
|
+
};
|
|
2732
|
+
const user_revivers = Object.fromEntries(
|
|
2733
|
+
Object.entries(transport).map(([k, v]) => [k, v.decode])
|
|
2734
|
+
);
|
|
2735
|
+
const all_revivers = { ...user_revivers, ...remote_fns_revivers };
|
|
2736
|
+
const parse$1 = (data) => parse(data, all_revivers);
|
|
2737
|
+
return all_revivers;
|
|
2738
|
+
}
|
|
2739
|
+
function parse_remote_arg(string, transport) {
|
|
2740
|
+
if (!string) return void 0;
|
|
2741
|
+
const json_string = new TextDecoder().decode(
|
|
2742
|
+
// no need to add back `=` characters, atob can handle it
|
|
2743
|
+
base64_decode(string.replaceAll("-", "+").replaceAll("_", "/"))
|
|
2744
|
+
);
|
|
2745
|
+
return parse(json_string, create_remote_arg_revivers(transport));
|
|
2746
|
+
}
|
|
2747
|
+
function create_remote_key(id, payload) {
|
|
2748
|
+
return id + "/" + payload;
|
|
2749
|
+
}
|
|
2750
|
+
function split_remote_key(key) {
|
|
2751
|
+
const i = key.lastIndexOf("/");
|
|
2752
|
+
if (i === -1) {
|
|
2753
|
+
throw new Error(`Invalid remote key: ${key}`);
|
|
2754
|
+
}
|
|
2755
|
+
return {
|
|
2756
|
+
id: key.slice(0, i),
|
|
2757
|
+
payload: key.slice(i + 1)
|
|
2758
|
+
};
|
|
2759
|
+
}
|
|
2760
|
+
function coalesce_to_error(err) {
|
|
2761
|
+
return err instanceof Error || err && /** @type {any} */
|
|
2762
|
+
err.name && /** @type {any} */
|
|
2763
|
+
err.message ? (
|
|
2764
|
+
/** @type {Error} */
|
|
2765
|
+
err
|
|
2766
|
+
) : new Error(JSON.stringify(err));
|
|
2767
|
+
}
|
|
2768
|
+
function normalize_error(error) {
|
|
2769
|
+
return (
|
|
2770
|
+
/** @type {import('../exports/internal/index.js').Redirect | HttpError | SvelteKitError | Error} */
|
|
2771
|
+
error
|
|
2772
|
+
);
|
|
2773
|
+
}
|
|
2774
|
+
function get_status(error) {
|
|
2775
|
+
return error instanceof HttpError || error instanceof SvelteKitError ? error.status : 500;
|
|
2776
|
+
}
|
|
2777
|
+
function get_message(error) {
|
|
2778
|
+
return error instanceof SvelteKitError ? error.text : "Internal Error";
|
|
2779
|
+
}
|
|
2780
|
+
function negotiate(accept, types) {
|
|
2781
|
+
const parts = [];
|
|
2782
|
+
accept.split(",").forEach((str, i) => {
|
|
2783
|
+
const match = /^[ \t]*([^/ \t]+)\/([^; \t]+)[ \t]*(?:;[ \t]*q=([0-9.]+))?/.exec(str);
|
|
2784
|
+
if (match) {
|
|
2785
|
+
const [, type, subtype, q = "1"] = match;
|
|
2786
|
+
parts.push({ type, subtype, q: +q, i });
|
|
2787
|
+
}
|
|
2788
|
+
});
|
|
2789
|
+
parts.sort((a, b) => {
|
|
2790
|
+
if (a.q !== b.q) {
|
|
2791
|
+
return b.q - a.q;
|
|
2792
|
+
}
|
|
2793
|
+
if (a.subtype === "*" !== (b.subtype === "*")) {
|
|
2794
|
+
return a.subtype === "*" ? 1 : -1;
|
|
2795
|
+
}
|
|
2796
|
+
if (a.type === "*" !== (b.type === "*")) {
|
|
2797
|
+
return a.type === "*" ? 1 : -1;
|
|
2798
|
+
}
|
|
2799
|
+
return a.i - b.i;
|
|
2800
|
+
});
|
|
2801
|
+
let accepted;
|
|
2802
|
+
let min_priority = Infinity;
|
|
2803
|
+
for (const mimetype of types) {
|
|
2804
|
+
const [type, subtype] = mimetype.split("/");
|
|
2805
|
+
const priority = parts.findIndex(
|
|
2806
|
+
(part) => (part.type === type || part.type === "*") && (part.subtype === subtype || part.subtype === "*")
|
|
2807
|
+
);
|
|
2808
|
+
if (priority !== -1 && priority < min_priority) {
|
|
2809
|
+
accepted = mimetype;
|
|
2810
|
+
min_priority = priority;
|
|
2811
|
+
}
|
|
2812
|
+
}
|
|
2813
|
+
return accepted;
|
|
2814
|
+
}
|
|
2815
|
+
function get_set_cookies(headers) {
|
|
2816
|
+
if (typeof headers.getSetCookie === "function") {
|
|
2817
|
+
return headers.getSetCookie();
|
|
2818
|
+
}
|
|
2819
|
+
const set_cookie = headers.get("set-cookie");
|
|
2820
|
+
return set_cookie ? splitCookiesString(set_cookie) : [];
|
|
2821
|
+
}
|
|
2822
|
+
function is_content_type(request, ...types) {
|
|
2823
|
+
const type = request.headers.get("content-type")?.split(";", 1)[0].trim() ?? "";
|
|
2824
|
+
return types.includes(type.toLowerCase());
|
|
2825
|
+
}
|
|
2826
|
+
function is_form_content_type(request) {
|
|
2827
|
+
return is_content_type(
|
|
2828
|
+
request,
|
|
2829
|
+
"application/x-www-form-urlencoded",
|
|
2830
|
+
"multipart/form-data",
|
|
2831
|
+
"text/plain",
|
|
2832
|
+
BINARY_FORM_CONTENT_TYPE
|
|
2833
|
+
);
|
|
2834
|
+
}
|
|
2835
|
+
const escape_html_attr_dict = {
|
|
2836
|
+
"&": "&",
|
|
2837
|
+
'"': """
|
|
2838
|
+
// Svelte also escapes < because the escape function could be called inside a `noscript` there
|
|
2839
|
+
// https://github.com/sveltejs/svelte/security/advisories/GHSA-8266-84wp-wv5c
|
|
2840
|
+
// However, that doesn't apply in SvelteKit
|
|
2841
|
+
};
|
|
2842
|
+
const escape_html_dict = {
|
|
2843
|
+
"&": "&",
|
|
2844
|
+
"<": "<"
|
|
2845
|
+
};
|
|
2846
|
+
const surrogates = (
|
|
2847
|
+
// high surrogate without paired low surrogate
|
|
2848
|
+
"[\\ud800-\\udbff](?![\\udc00-\\udfff])|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\udc00-\\udfff]"
|
|
2849
|
+
);
|
|
2850
|
+
const escape_html_attr_regex = new RegExp(
|
|
2851
|
+
`[${Object.keys(escape_html_attr_dict).join("")}]|` + surrogates,
|
|
2852
|
+
"g"
|
|
2853
|
+
);
|
|
2854
|
+
const escape_html_regex = new RegExp(
|
|
2855
|
+
`[${Object.keys(escape_html_dict).join("")}]|` + surrogates,
|
|
2856
|
+
"g"
|
|
2857
|
+
);
|
|
2858
|
+
function escape_html(str, is_attr) {
|
|
2859
|
+
const dict = is_attr ? escape_html_attr_dict : escape_html_dict;
|
|
2860
|
+
const escaped_str = str.replace(is_attr ? escape_html_attr_regex : escape_html_regex, (match) => {
|
|
2861
|
+
if (match.length === 2) {
|
|
2862
|
+
return match;
|
|
2863
|
+
}
|
|
2864
|
+
return dict[match] ?? `&#${match.charCodeAt(0)};`;
|
|
2865
|
+
});
|
|
2866
|
+
return escaped_str;
|
|
2867
|
+
}
|
|
2868
|
+
function method_not_allowed(mod, method) {
|
|
2869
|
+
return text(`${method} method not allowed`, {
|
|
2870
|
+
status: 405,
|
|
2871
|
+
headers: {
|
|
2872
|
+
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405
|
|
2873
|
+
// "The server must generate an Allow header field in a 405 status code response"
|
|
2874
|
+
allow: allowed_methods(mod).join(", ")
|
|
2875
|
+
}
|
|
2876
|
+
});
|
|
2877
|
+
}
|
|
2878
|
+
function allowed_methods(mod) {
|
|
2879
|
+
const allowed = ENDPOINT_METHODS.filter((method) => method in mod);
|
|
2880
|
+
if ("GET" in mod && !("HEAD" in mod)) {
|
|
2881
|
+
allowed.push("HEAD");
|
|
2882
|
+
}
|
|
2883
|
+
return allowed;
|
|
2884
|
+
}
|
|
2885
|
+
function get_global_name(options) {
|
|
2886
|
+
return `__sveltekit_${options.version_hash}`;
|
|
2887
|
+
}
|
|
2888
|
+
function static_error_page(options, status, message) {
|
|
2889
|
+
let page = options.templates.error({ status, message: escape_html(message) });
|
|
2890
|
+
return text(page, {
|
|
2891
|
+
headers: { "content-type": "text/html; charset=utf-8" },
|
|
2892
|
+
status
|
|
2893
|
+
});
|
|
2894
|
+
}
|
|
2895
|
+
async function handle_fatal_error(event, state, options, error) {
|
|
2896
|
+
error = error instanceof HttpError ? error : coalesce_to_error(error);
|
|
2897
|
+
const status = get_status(error);
|
|
2898
|
+
const body = await handle_error_and_jsonify(event, state, options, error);
|
|
2899
|
+
const type = negotiate(event.request.headers.get("accept") || "text/html", [
|
|
2900
|
+
"application/json",
|
|
2901
|
+
"text/html"
|
|
2902
|
+
]);
|
|
2903
|
+
if (event.isDataRequest || type === "application/json") {
|
|
2904
|
+
return json(body, {
|
|
2905
|
+
status
|
|
2906
|
+
});
|
|
2907
|
+
}
|
|
2908
|
+
return static_error_page(options, status, body.message);
|
|
2909
|
+
}
|
|
2910
|
+
async function handle_error_and_jsonify(event, state, options, error) {
|
|
2911
|
+
if (error instanceof HttpError) {
|
|
2912
|
+
return { message: "Unknown Error", ...error.body };
|
|
2913
|
+
}
|
|
2914
|
+
const status = get_status(error);
|
|
2915
|
+
const message = get_message(error);
|
|
2916
|
+
return await with_request_store(
|
|
2917
|
+
{ event, state },
|
|
2918
|
+
() => options.hooks.handleError({ error, event, status, message })
|
|
2919
|
+
) ?? { message };
|
|
2920
|
+
}
|
|
2921
|
+
function redirect_response(status, location) {
|
|
2922
|
+
const response = new Response(void 0, {
|
|
2923
|
+
status,
|
|
2924
|
+
headers: { location }
|
|
2925
|
+
});
|
|
2926
|
+
return response;
|
|
2927
|
+
}
|
|
2928
|
+
function clarify_devalue_error(event, error) {
|
|
2929
|
+
if (error.path) {
|
|
2930
|
+
return `Data returned from \`load\` while rendering ${event.route.id} is not serializable: ${error.message} (${error.path}). If you need to serialize/deserialize custom types, use transport hooks: https://svelte.dev/docs/kit/hooks#transport.`;
|
|
2931
|
+
}
|
|
2932
|
+
if (error.path === "") {
|
|
2933
|
+
return `Data returned from \`load\` while rendering ${event.route.id} is not a plain object`;
|
|
2934
|
+
}
|
|
2935
|
+
return error.message;
|
|
2936
|
+
}
|
|
2937
|
+
function serialize_uses(node) {
|
|
2938
|
+
const uses = {};
|
|
2939
|
+
if (node.uses && node.uses.dependencies.size > 0) {
|
|
2940
|
+
uses.dependencies = Array.from(node.uses.dependencies);
|
|
2941
|
+
}
|
|
2942
|
+
if (node.uses && node.uses.search_params.size > 0) {
|
|
2943
|
+
uses.search_params = Array.from(node.uses.search_params);
|
|
2944
|
+
}
|
|
2945
|
+
if (node.uses && node.uses.params.size > 0) {
|
|
2946
|
+
uses.params = Array.from(node.uses.params);
|
|
2947
|
+
}
|
|
2948
|
+
if (node.uses?.parent) uses.parent = 1;
|
|
2949
|
+
if (node.uses?.route) uses.route = 1;
|
|
2950
|
+
if (node.uses?.url) uses.url = 1;
|
|
2951
|
+
return uses;
|
|
2952
|
+
}
|
|
2953
|
+
function has_prerendered_path(manifest, pathname) {
|
|
2954
|
+
return manifest._.prerendered_routes.has(pathname) || pathname.at(-1) === "/" && manifest._.prerendered_routes.has(pathname.slice(0, -1));
|
|
2955
|
+
}
|
|
2956
|
+
function format_server_error(status, error, event) {
|
|
2957
|
+
const formatted_text = `
|
|
2958
|
+
\x1B[1;31m[${status}] ${event.request.method} ${event.url.pathname}\x1B[0m`;
|
|
2959
|
+
if (status === 404) {
|
|
2960
|
+
return formatted_text;
|
|
2961
|
+
}
|
|
2962
|
+
return `${formatted_text}
|
|
2963
|
+
${error.stack}`;
|
|
2964
|
+
}
|
|
2965
|
+
function get_node_type(node_id) {
|
|
2966
|
+
const parts = node_id?.split("/");
|
|
2967
|
+
const filename = parts?.at(-1);
|
|
2968
|
+
if (!filename) return "unknown";
|
|
2969
|
+
const dot_parts = filename.split(".");
|
|
2970
|
+
return dot_parts.slice(0, -1).join(".");
|
|
2971
|
+
}
|
|
2972
|
+
function create_replacer(transport) {
|
|
2973
|
+
const replacer = (thing) => {
|
|
2974
|
+
for (const key in transport) {
|
|
2975
|
+
const encoded = transport[key].encode(thing);
|
|
2976
|
+
if (encoded) {
|
|
2977
|
+
return `app.decode('${key}', ${uneval(encoded, replacer)})`;
|
|
2978
|
+
}
|
|
2979
|
+
}
|
|
2980
|
+
};
|
|
2981
|
+
return replacer;
|
|
2982
|
+
}
|
|
2983
|
+
|
|
2984
|
+
export { escape_html as A, create_remote_key as B, error as C, parse_remote_arg as D, ENDPOINT_METHODS as E, deserialize_binary_form as F, stringify as G, HttpError as H, INVALIDATED_PARAM as I, stringify$1 as J, ActionFailure as K, split_remote_key as L, SVELTE_KIT_ASSETS as M, redirect as N, splitCookiesString as O, PAGE_METHODS as P, Redirect as R, SvelteKitError as S, TRAILING_SLASH_PARAM as T, handle_fatal_error as a, negotiate as b, method_not_allowed as c, handle_error_and_jsonify as d, get_status as e, format_server_error as f, get_set_cookies as g, has_prerendered_path as h, is_form_content_type as i, json as j, get_global_name as k, create_replacer as l, merge_tracing as m, noop as n, serialize_uses as o, parseString as p, clarify_devalue_error as q, redirect_response as r, static_error_page as s, text as t, uneval as u, once as v, with_request_store as w, normalize_error as x, get_node_type as y, isRedirect as z };
|
|
2985
|
+
//# sourceMappingURL=utils.js-BJgm9WbO.js.map
|