@nanoforge-dev/editor 0.0.1
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/LICENSE +21 -0
- package/README.md +49 -0
- package/dist/client/_app/immutable/assets/0.562EP7L3.css +1 -0
- package/dist/client/_app/immutable/assets/0.562EP7L3.css.br +0 -0
- package/dist/client/_app/immutable/assets/0.562EP7L3.css.gz +0 -0
- package/dist/client/_app/immutable/assets/2.Dl9w-_FK.css +1 -0
- package/dist/client/_app/immutable/assets/2.Dl9w-_FK.css.br +0 -0
- package/dist/client/_app/immutable/assets/2.Dl9w-_FK.css.gz +0 -0
- package/dist/client/_app/immutable/assets/api.CD54FDqW.css +1 -0
- package/dist/client/_app/immutable/assets/api.CD54FDqW.css.br +0 -0
- package/dist/client/_app/immutable/assets/api.CD54FDqW.css.gz +0 -0
- package/dist/client/_app/immutable/assets/codicon.ngg6Pgfi.ttf +0 -0
- package/dist/client/_app/immutable/assets/defaultProjectCover.BHxYINJa.png +0 -0
- package/dist/client/_app/immutable/assets/editor.BuC0XPbM.css +1 -0
- package/dist/client/_app/immutable/assets/editor.BuC0XPbM.css.br +0 -0
- package/dist/client/_app/immutable/assets/editor.BuC0XPbM.css.gz +0 -0
- package/dist/client/_app/immutable/assets/logo.DMAgjcse.png +0 -0
- package/dist/client/_app/immutable/chunks/0wEXW2Hc2.js +1 -0
- package/dist/client/_app/immutable/chunks/0wEXW2Hc2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/0wEXW2Hc2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/1rG2eYdz2.js +1 -0
- package/dist/client/_app/immutable/chunks/1rG2eYdz2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/1rG2eYdz2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/5CAt0tAC.js +1 -0
- package/dist/client/_app/immutable/chunks/5CAt0tAC.js.br +0 -0
- package/dist/client/_app/immutable/chunks/5CAt0tAC.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/5TEFcS4X2.js +1 -0
- package/dist/client/_app/immutable/chunks/5TEFcS4X2.js.br +3 -0
- package/dist/client/_app/immutable/chunks/5TEFcS4X2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/5k3Q8YWH.js +1 -0
- package/dist/client/_app/immutable/chunks/5k3Q8YWH.js.br +0 -0
- package/dist/client/_app/immutable/chunks/5k3Q8YWH.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/B0Q9zT_Q.js +1 -0
- package/dist/client/_app/immutable/chunks/B0Q9zT_Q.js.br +0 -0
- package/dist/client/_app/immutable/chunks/B0Q9zT_Q.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/B1GYE4NT.js +1 -0
- package/dist/client/_app/immutable/chunks/B1GYE4NT.js.br +0 -0
- package/dist/client/_app/immutable/chunks/B1GYE4NT.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/B1bBmRUz2.js +1 -0
- package/dist/client/_app/immutable/chunks/B1bBmRUz2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/B1bBmRUz2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/B3IjbASq.js +1 -0
- package/dist/client/_app/immutable/chunks/B3IjbASq.js.br +0 -0
- package/dist/client/_app/immutable/chunks/B3IjbASq.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/B3VOL0kZ.js +1 -0
- package/dist/client/_app/immutable/chunks/B3VOL0kZ.js.br +0 -0
- package/dist/client/_app/immutable/chunks/B3VOL0kZ.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/B5crfj0i.js +1 -0
- package/dist/client/_app/immutable/chunks/B5crfj0i.js.br +0 -0
- package/dist/client/_app/immutable/chunks/B5crfj0i.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BAtlESPp.js +1 -0
- package/dist/client/_app/immutable/chunks/BAtlESPp.js.br +3 -0
- package/dist/client/_app/immutable/chunks/BAtlESPp.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BCAAnHTF2.js +1 -0
- package/dist/client/_app/immutable/chunks/BCAAnHTF2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/BCAAnHTF2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BEN0jOJp.js +1 -0
- package/dist/client/_app/immutable/chunks/BEN0jOJp.js.br +0 -0
- package/dist/client/_app/immutable/chunks/BEN0jOJp.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BHHccBgG2.js +1 -0
- package/dist/client/_app/immutable/chunks/BHHccBgG2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/BHHccBgG2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BHxBHC3k.js +1 -0
- package/dist/client/_app/immutable/chunks/BHxBHC3k.js.br +0 -0
- package/dist/client/_app/immutable/chunks/BHxBHC3k.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BK6ghPUh.js +1 -0
- package/dist/client/_app/immutable/chunks/BK6ghPUh.js.br +0 -0
- package/dist/client/_app/immutable/chunks/BK6ghPUh.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BL9YzxJT.js +1 -0
- package/dist/client/_app/immutable/chunks/BL9YzxJT.js.br +0 -0
- package/dist/client/_app/immutable/chunks/BL9YzxJT.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BNqbTcCU.js +1 -0
- package/dist/client/_app/immutable/chunks/BNqbTcCU.js.br +0 -0
- package/dist/client/_app/immutable/chunks/BNqbTcCU.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BSRtLNCV.js +3 -0
- package/dist/client/_app/immutable/chunks/BSRtLNCV.js.br +0 -0
- package/dist/client/_app/immutable/chunks/BSRtLNCV.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BSa9oWuP.js +1 -0
- package/dist/client/_app/immutable/chunks/BSa9oWuP.js.br +0 -0
- package/dist/client/_app/immutable/chunks/BSa9oWuP.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BTEHXt4u.js +1 -0
- package/dist/client/_app/immutable/chunks/BTEHXt4u.js.br +0 -0
- package/dist/client/_app/immutable/chunks/BTEHXt4u.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BUMhJFWc.js +2 -0
- package/dist/client/_app/immutable/chunks/BUMhJFWc.js.br +0 -0
- package/dist/client/_app/immutable/chunks/BUMhJFWc.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BXNW00E2.js +1 -0
- package/dist/client/_app/immutable/chunks/BXNW00E2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/BXNW00E2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/B__0yjCH2.js +1 -0
- package/dist/client/_app/immutable/chunks/B__0yjCH2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/B__0yjCH2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/B_rYXvqX.js +1 -0
- package/dist/client/_app/immutable/chunks/B_rYXvqX.js.br +0 -0
- package/dist/client/_app/immutable/chunks/B_rYXvqX.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BaORWDBQ.js +1 -0
- package/dist/client/_app/immutable/chunks/BaORWDBQ.js.br +0 -0
- package/dist/client/_app/immutable/chunks/BaORWDBQ.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BeRB61Rp.js +1 -0
- package/dist/client/_app/immutable/chunks/BeRB61Rp.js.br +0 -0
- package/dist/client/_app/immutable/chunks/BeRB61Rp.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/Berct1R62.js +1 -0
- package/dist/client/_app/immutable/chunks/Berct1R62.js.br +0 -0
- package/dist/client/_app/immutable/chunks/Berct1R62.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/Bi01QGTh2.js +7 -0
- package/dist/client/_app/immutable/chunks/Bi01QGTh2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/Bi01QGTh2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BnEty9Zf.js +3 -0
- package/dist/client/_app/immutable/chunks/BnEty9Zf.js.br +0 -0
- package/dist/client/_app/immutable/chunks/BnEty9Zf.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/Bp42GhE_.js +1 -0
- package/dist/client/_app/immutable/chunks/Bp42GhE_.js.br +0 -0
- package/dist/client/_app/immutable/chunks/Bp42GhE_.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BqR20QL0.js +1 -0
- package/dist/client/_app/immutable/chunks/BqR20QL0.js.br +0 -0
- package/dist/client/_app/immutable/chunks/BqR20QL0.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BuvsQ_0P.js +1 -0
- package/dist/client/_app/immutable/chunks/BuvsQ_0P.js.br +0 -0
- package/dist/client/_app/immutable/chunks/BuvsQ_0P.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BwWFGvpp2.js +6 -0
- package/dist/client/_app/immutable/chunks/BwWFGvpp2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/BwWFGvpp2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BxyUv_372.js +1 -0
- package/dist/client/_app/immutable/chunks/BxyUv_372.js.br +0 -0
- package/dist/client/_app/immutable/chunks/BxyUv_372.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/C459oz3p.js +1 -0
- package/dist/client/_app/immutable/chunks/C459oz3p.js.br +0 -0
- package/dist/client/_app/immutable/chunks/C459oz3p.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/C4oBl-ul.js +1 -0
- package/dist/client/_app/immutable/chunks/C4oBl-ul.js.br +0 -0
- package/dist/client/_app/immutable/chunks/C4oBl-ul.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/C5dBxjD0.js +1 -0
- package/dist/client/_app/immutable/chunks/C5dBxjD0.js.br +0 -0
- package/dist/client/_app/immutable/chunks/C5dBxjD0.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/C7TuqZTk.js +1 -0
- package/dist/client/_app/immutable/chunks/C7TuqZTk.js.br +0 -0
- package/dist/client/_app/immutable/chunks/C7TuqZTk.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/C84aX3eL2.js +2 -0
- package/dist/client/_app/immutable/chunks/C84aX3eL2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/C84aX3eL2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/CGFoxiJT2.js +1 -0
- package/dist/client/_app/immutable/chunks/CGFoxiJT2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/CGFoxiJT2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/CGdCAl_w2.js +1 -0
- package/dist/client/_app/immutable/chunks/CGdCAl_w2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/CGdCAl_w2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/CJL4GRLV2.js +1 -0
- package/dist/client/_app/immutable/chunks/CJL4GRLV2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/CJL4GRLV2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/CKihvhpr.js +1 -0
- package/dist/client/_app/immutable/chunks/CKihvhpr.js.br +0 -0
- package/dist/client/_app/immutable/chunks/CKihvhpr.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/CKybJfA6.js +1 -0
- package/dist/client/_app/immutable/chunks/CKybJfA6.js.br +0 -0
- package/dist/client/_app/immutable/chunks/CKybJfA6.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/CQai7aNJ.js +1 -0
- package/dist/client/_app/immutable/chunks/CQai7aNJ.js.br +0 -0
- package/dist/client/_app/immutable/chunks/CQai7aNJ.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/CQghOihB.js +1 -0
- package/dist/client/_app/immutable/chunks/CQghOihB.js.br +0 -0
- package/dist/client/_app/immutable/chunks/CQghOihB.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/CTK4WrGL2.js +1 -0
- package/dist/client/_app/immutable/chunks/CTK4WrGL2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/CTK4WrGL2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/CUVqITEW2.js +1 -0
- package/dist/client/_app/immutable/chunks/CUVqITEW2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/CUVqITEW2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/CVmNMiIj.js +1 -0
- package/dist/client/_app/immutable/chunks/CVmNMiIj.js.br +0 -0
- package/dist/client/_app/immutable/chunks/CVmNMiIj.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/CW_66Q8N.js +872 -0
- package/dist/client/_app/immutable/chunks/CW_66Q8N.js.br +0 -0
- package/dist/client/_app/immutable/chunks/CW_66Q8N.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/CXBbh9s-.js +1 -0
- package/dist/client/_app/immutable/chunks/CXBbh9s-.js.br +0 -0
- package/dist/client/_app/immutable/chunks/CXBbh9s-.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/CXlfFz7D2.js +1 -0
- package/dist/client/_app/immutable/chunks/CXlfFz7D2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/CXlfFz7D2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/C_QqwttH.js +1 -0
- package/dist/client/_app/immutable/chunks/C_QqwttH.js.br +0 -0
- package/dist/client/_app/immutable/chunks/C_QqwttH.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/CbFxQFBh.js +1 -0
- package/dist/client/_app/immutable/chunks/CbFxQFBh.js.br +0 -0
- package/dist/client/_app/immutable/chunks/CbFxQFBh.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/CmjNmBcK.js +1 -0
- package/dist/client/_app/immutable/chunks/CmjNmBcK.js.br +0 -0
- package/dist/client/_app/immutable/chunks/CmjNmBcK.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/CntDmp6G.js +1 -0
- package/dist/client/_app/immutable/chunks/CntDmp6G.js.br +0 -0
- package/dist/client/_app/immutable/chunks/CntDmp6G.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/CqqoQT4S.js +2 -0
- package/dist/client/_app/immutable/chunks/CqqoQT4S.js.br +0 -0
- package/dist/client/_app/immutable/chunks/CqqoQT4S.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/CtzzCjLE2.js +1 -0
- package/dist/client/_app/immutable/chunks/CtzzCjLE2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/CtzzCjLE2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/CziQemry2.js +1 -0
- package/dist/client/_app/immutable/chunks/CziQemry2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/CziQemry2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/Czovc13W.js +1 -0
- package/dist/client/_app/immutable/chunks/Czovc13W.js.br +0 -0
- package/dist/client/_app/immutable/chunks/Czovc13W.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/D38BHtSY.js +298 -0
- package/dist/client/_app/immutable/chunks/D38BHtSY.js.br +0 -0
- package/dist/client/_app/immutable/chunks/D38BHtSY.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/DBkS_L3S.js +1 -0
- package/dist/client/_app/immutable/chunks/DBkS_L3S.js.br +0 -0
- package/dist/client/_app/immutable/chunks/DBkS_L3S.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/DEoC-BX-.js +11 -0
- package/dist/client/_app/immutable/chunks/DEoC-BX-.js.br +0 -0
- package/dist/client/_app/immutable/chunks/DEoC-BX-.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/DHkiqSLl.js +1 -0
- package/dist/client/_app/immutable/chunks/DHkiqSLl.js.br +0 -0
- package/dist/client/_app/immutable/chunks/DHkiqSLl.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/DL7ZpfJd.js +1 -0
- package/dist/client/_app/immutable/chunks/DL7ZpfJd.js.br +0 -0
- package/dist/client/_app/immutable/chunks/DL7ZpfJd.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/DUC3NMun2.js +4 -0
- package/dist/client/_app/immutable/chunks/DUC3NMun2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/DUC3NMun2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/DWUlubL2.js +1 -0
- package/dist/client/_app/immutable/chunks/DWUlubL2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/DWUlubL2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/D_HtEbjl.js +1 -0
- package/dist/client/_app/immutable/chunks/D_HtEbjl.js.br +0 -0
- package/dist/client/_app/immutable/chunks/D_HtEbjl.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/DaCLQrfC.js +1 -0
- package/dist/client/_app/immutable/chunks/DaCLQrfC.js.br +0 -0
- package/dist/client/_app/immutable/chunks/DaCLQrfC.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/DbxPn-f9.js +1 -0
- package/dist/client/_app/immutable/chunks/DbxPn-f9.js.br +0 -0
- package/dist/client/_app/immutable/chunks/DbxPn-f9.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/DhPi0T7V2.js +1 -0
- package/dist/client/_app/immutable/chunks/DhPi0T7V2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/DhPi0T7V2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/DkZEX-tr.js +1 -0
- package/dist/client/_app/immutable/chunks/DkZEX-tr.js.br +0 -0
- package/dist/client/_app/immutable/chunks/DkZEX-tr.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/Dqs1VwMg2.js +1 -0
- package/dist/client/_app/immutable/chunks/Dqs1VwMg2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/Dqs1VwMg2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/DrDIkqkr2.js +1 -0
- package/dist/client/_app/immutable/chunks/DrDIkqkr2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/DrDIkqkr2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/DunPnEs5.js +1 -0
- package/dist/client/_app/immutable/chunks/DunPnEs5.js.br +0 -0
- package/dist/client/_app/immutable/chunks/DunPnEs5.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/DxLN9Q9A.js +1 -0
- package/dist/client/_app/immutable/chunks/DxLN9Q9A.js.br +0 -0
- package/dist/client/_app/immutable/chunks/DxLN9Q9A.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/GhmjqkHA.js +1 -0
- package/dist/client/_app/immutable/chunks/GhmjqkHA.js.br +0 -0
- package/dist/client/_app/immutable/chunks/GhmjqkHA.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/H_bCfo1Z.js +1 -0
- package/dist/client/_app/immutable/chunks/H_bCfo1Z.js.br +1 -0
- package/dist/client/_app/immutable/chunks/H_bCfo1Z.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/KoMdYtDs2.js +1 -0
- package/dist/client/_app/immutable/chunks/KoMdYtDs2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/KoMdYtDs2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/OELm4xo1.js +1 -0
- package/dist/client/_app/immutable/chunks/OELm4xo1.js.br +0 -0
- package/dist/client/_app/immutable/chunks/OELm4xo1.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/OdxrjoDx.js +1 -0
- package/dist/client/_app/immutable/chunks/OdxrjoDx.js.br +0 -0
- package/dist/client/_app/immutable/chunks/OdxrjoDx.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/SlhV96tq.js +1 -0
- package/dist/client/_app/immutable/chunks/SlhV96tq.js.br +0 -0
- package/dist/client/_app/immutable/chunks/SlhV96tq.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/X9L1iai42.js +1 -0
- package/dist/client/_app/immutable/chunks/X9L1iai42.js.br +0 -0
- package/dist/client/_app/immutable/chunks/X9L1iai42.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/XIokwnxj2.js +11 -0
- package/dist/client/_app/immutable/chunks/XIokwnxj2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/XIokwnxj2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/ZmwXQQ8p.js +1 -0
- package/dist/client/_app/immutable/chunks/ZmwXQQ8p.js.br +0 -0
- package/dist/client/_app/immutable/chunks/ZmwXQQ8p.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/acVTcwNd.js +1 -0
- package/dist/client/_app/immutable/chunks/acVTcwNd.js.br +0 -0
- package/dist/client/_app/immutable/chunks/acVTcwNd.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/bLoc39kl.js +2 -0
- package/dist/client/_app/immutable/chunks/bLoc39kl.js.br +0 -0
- package/dist/client/_app/immutable/chunks/bLoc39kl.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/dm7qVrFn2.js +1 -0
- package/dist/client/_app/immutable/chunks/dm7qVrFn2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/dm7qVrFn2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/if7vWS9-.js +1 -0
- package/dist/client/_app/immutable/chunks/if7vWS9-.js.br +0 -0
- package/dist/client/_app/immutable/chunks/if7vWS9-.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/kAc38cH_.js +3 -0
- package/dist/client/_app/immutable/chunks/kAc38cH_.js.br +0 -0
- package/dist/client/_app/immutable/chunks/kAc38cH_.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/kks0AxFY2.js +1 -0
- package/dist/client/_app/immutable/chunks/kks0AxFY2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/kks0AxFY2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/mA7hbneB.js +3 -0
- package/dist/client/_app/immutable/chunks/mA7hbneB.js.br +0 -0
- package/dist/client/_app/immutable/chunks/mA7hbneB.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/qWHUp0PJ2.js +1 -0
- package/dist/client/_app/immutable/chunks/qWHUp0PJ2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/qWHUp0PJ2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/u6JPB_fg2.js +1 -0
- package/dist/client/_app/immutable/chunks/u6JPB_fg2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/u6JPB_fg2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/v_jBEYI6.js +1 -0
- package/dist/client/_app/immutable/chunks/v_jBEYI6.js.br +1 -0
- package/dist/client/_app/immutable/chunks/v_jBEYI6.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/x4VkYCou2.js +1 -0
- package/dist/client/_app/immutable/chunks/x4VkYCou2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/x4VkYCou2.js.gz +0 -0
- package/dist/client/_app/immutable/entry/app.CrM2Umgq.js +2 -0
- package/dist/client/_app/immutable/entry/app.CrM2Umgq.js.br +0 -0
- package/dist/client/_app/immutable/entry/app.CrM2Umgq.js.gz +0 -0
- package/dist/client/_app/immutable/entry/start.25Vi3KZA.js +1 -0
- package/dist/client/_app/immutable/entry/start.25Vi3KZA.js.br +0 -0
- package/dist/client/_app/immutable/entry/start.25Vi3KZA.js.gz +0 -0
- package/dist/client/_app/immutable/nodes/0.Ck5XUPzX.js +1 -0
- package/dist/client/_app/immutable/nodes/0.Ck5XUPzX.js.br +0 -0
- package/dist/client/_app/immutable/nodes/0.Ck5XUPzX.js.gz +0 -0
- package/dist/client/_app/immutable/nodes/1.Dpx0WKl2.js +1 -0
- package/dist/client/_app/immutable/nodes/1.Dpx0WKl2.js.br +0 -0
- package/dist/client/_app/immutable/nodes/1.Dpx0WKl2.js.gz +0 -0
- package/dist/client/_app/immutable/nodes/2.CwofzauD.js +4 -0
- package/dist/client/_app/immutable/nodes/2.CwofzauD.js.br +0 -0
- package/dist/client/_app/immutable/nodes/2.CwofzauD.js.gz +0 -0
- package/dist/client/_app/immutable/nodes/3.CU9DPzka.js +1 -0
- package/dist/client/_app/immutable/nodes/3.CU9DPzka.js.br +0 -0
- package/dist/client/_app/immutable/nodes/3.CU9DPzka.js.gz +0 -0
- package/dist/client/_app/immutable/nodes/4.P9ayzmJ4.js +5 -0
- package/dist/client/_app/immutable/nodes/4.P9ayzmJ4.js.br +0 -0
- package/dist/client/_app/immutable/nodes/4.P9ayzmJ4.js.gz +0 -0
- package/dist/client/_app/immutable/nodes/5.Dcsjm3Pq.js +1 -0
- package/dist/client/_app/immutable/nodes/5.Dcsjm3Pq.js.br +0 -0
- package/dist/client/_app/immutable/nodes/5.Dcsjm3Pq.js.gz +0 -0
- package/dist/client/_app/immutable/workers/css.worker-DRFWP4k7.js +89 -0
- package/dist/client/_app/immutable/workers/css.worker-DRFWP4k7.js.br +0 -0
- package/dist/client/_app/immutable/workers/css.worker-DRFWP4k7.js.gz +0 -0
- package/dist/client/_app/immutable/workers/html.worker-CXAEVlCI.js +502 -0
- package/dist/client/_app/immutable/workers/html.worker-CXAEVlCI.js.br +0 -0
- package/dist/client/_app/immutable/workers/html.worker-CXAEVlCI.js.gz +0 -0
- package/dist/client/_app/immutable/workers/json.worker-Dkwen84u.js +58 -0
- package/dist/client/_app/immutable/workers/json.worker-Dkwen84u.js.br +0 -0
- package/dist/client/_app/immutable/workers/json.worker-Dkwen84u.js.gz +0 -0
- package/dist/client/_app/immutable/workers/ts.worker-DJwDx_mp.js +67719 -0
- package/dist/client/_app/immutable/workers/ts.worker-DJwDx_mp.js.br +0 -0
- package/dist/client/_app/immutable/workers/ts.worker-DJwDx_mp.js.gz +0 -0
- package/dist/client/_app/version.json +1 -0
- package/dist/client/_app/version.json.br +0 -0
- package/dist/client/_app/version.json.gz +0 -0
- package/dist/client/favicon.svg +1 -0
- package/dist/client/favicon.svg.br +0 -0
- package/dist/client/favicon.svg.gz +0 -0
- package/dist/client/robots.txt +3 -0
- package/dist/client/robots.txt.br +0 -0
- package/dist/client/robots.txt.gz +0 -0
- package/dist/env.js +32 -0
- package/dist/handler.js +744 -0
- package/dist/index.js +49 -0
- package/dist/server/chunks/0-DmwMCtOF.js +16 -0
- package/dist/server/chunks/0-DmwMCtOF.js.map +1 -0
- package/dist/server/chunks/1-BgVLfks1.js +17 -0
- package/dist/server/chunks/1-BgVLfks1.js.map +1 -0
- package/dist/server/chunks/2-CzdRJh2P.js +30 -0
- package/dist/server/chunks/2-CzdRJh2P.js.map +1 -0
- package/dist/server/chunks/3-C6uctiU1.js +185 -0
- package/dist/server/chunks/3-C6uctiU1.js.map +1 -0
- package/dist/server/chunks/4-BO3KTp14.js +390 -0
- package/dist/server/chunks/4-BO3KTp14.js.map +1 -0
- package/dist/server/chunks/5-LbaHRTVX.js +259 -0
- package/dist/server/chunks/5-LbaHRTVX.js.map +1 -0
- package/dist/server/chunks/_layout.svelte-BzcRjvYO.js +11 -0
- package/dist/server/chunks/_layout.svelte-BzcRjvYO.js.map +1 -0
- package/dist/server/chunks/_page.svelte-CB5X_URD.js +197 -0
- package/dist/server/chunks/_page.svelte-CB5X_URD.js.map +1 -0
- package/dist/server/chunks/_page.svelte-DMwjXpw4.js +13 -0
- package/dist/server/chunks/_page.svelte-DMwjXpw4.js.map +1 -0
- package/dist/server/chunks/_page.svelte-XIYDQw7d.js +14 -0
- package/dist/server/chunks/_page.svelte-XIYDQw7d.js.map +1 -0
- package/dist/server/chunks/_page.svelte-paWD_HcG.js +4302 -0
- package/dist/server/chunks/_page.svelte-paWD_HcG.js.map +1 -0
- package/dist/server/chunks/api-9BLkbfaG.js +9126 -0
- package/dist/server/chunks/api-9BLkbfaG.js.map +1 -0
- package/dist/server/chunks/app-l-cuFP__.js +13 -0
- package/dist/server/chunks/app-l-cuFP__.js.map +1 -0
- package/dist/server/chunks/chunk-9PtDFT_4.js +37 -0
- package/dist/server/chunks/client-Dx0O-q6m.js +115 -0
- package/dist/server/chunks/client-Dx0O-q6m.js.map +1 -0
- package/dist/server/chunks/dev-7V6fUCff.js +4429 -0
- package/dist/server/chunks/dev-7V6fUCff.js.map +1 -0
- package/dist/server/chunks/error.svelte-C5CCEI9O.js +102 -0
- package/dist/server/chunks/error.svelte-C5CCEI9O.js.map +1 -0
- package/dist/server/chunks/exports-j3HcL9It.js +158 -0
- package/dist/server/chunks/exports-j3HcL9It.js.map +1 -0
- package/dist/server/chunks/forms-CffPpDq6.js +36 -0
- package/dist/server/chunks/forms-CffPpDq6.js.map +1 -0
- package/dist/server/chunks/hooks.server-DqaQ1y1I.js +858 -0
- package/dist/server/chunks/hooks.server-DqaQ1y1I.js.map +1 -0
- package/dist/server/chunks/hooks.universal-0JHSyeLw.js +7 -0
- package/dist/server/chunks/hooks.universal-0JHSyeLw.js.map +1 -0
- package/dist/server/chunks/internal-BgFVxXcc.js +66 -0
- package/dist/server/chunks/internal-BgFVxXcc.js.map +1 -0
- package/dist/server/chunks/internal-BqoJe00m.js +1671 -0
- package/dist/server/chunks/internal-BqoJe00m.js.map +1 -0
- package/dist/server/chunks/runtime-ISoc6PNh.js +703 -0
- package/dist/server/chunks/runtime-ISoc6PNh.js.map +1 -0
- package/dist/server/chunks/server-BlOy0jJl.js +91 -0
- package/dist/server/chunks/server-BlOy0jJl.js.map +1 -0
- package/dist/server/chunks/shared-server-D--cyMsO.js +23 -0
- package/dist/server/chunks/shared-server-D--cyMsO.js.map +1 -0
- package/dist/server/index.js +4183 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/manifest.js +102 -0
- package/dist/server/manifest.js.map +1 -0
- package/package.json +119 -0
|
@@ -0,0 +1,858 @@
|
|
|
1
|
+
import { a as __commonJSMin, i as with_request_store, n as get_request_store, s as __toESM, t as merge_tracing } from "./server-BlOy0jJl.js";
|
|
2
|
+
import { t as private_env } from "./shared-server-D--cyMsO.js";
|
|
3
|
+
import { a as redirect } from "./exports-j3HcL9It.js";
|
|
4
|
+
import { a as serverAsyncLocalStorage, i as overwriteServerAsyncLocalStorage, n as getStrategyForUrl, o as shouldRedirect, r as isExcludedByRouteStrategy, t as deLocalizeUrl } from "./runtime-ISoc6PNh.js";
|
|
5
|
+
import * as crypto$1 from "node:crypto";
|
|
6
|
+
//#region node_modules/.pnpm/@sveltejs+kit@2.57.1_@sveltejs+vite-plugin-svelte@7.0.0_svelte@5.55.3_@typescript-eslin_c09159cb6a183c6624321f87d00b2d27/node_modules/@sveltejs/kit/src/exports/hooks/sequence.js
|
|
7
|
+
/** @import { Handle, RequestEvent, ResolveOptions } from '@sveltejs/kit' */
|
|
8
|
+
/** @import { MaybePromise } from 'types' */
|
|
9
|
+
/**
|
|
10
|
+
* A helper function for sequencing multiple `handle` calls in a middleware-like manner.
|
|
11
|
+
* The behavior for the `handle` options is as follows:
|
|
12
|
+
* - `transformPageChunk` is applied in reverse order and merged
|
|
13
|
+
* - `preload` is applied in forward order, the first option "wins" and no `preload` options after it are called
|
|
14
|
+
* - `filterSerializedResponseHeaders` behaves the same as `preload`
|
|
15
|
+
*
|
|
16
|
+
* ```js
|
|
17
|
+
* /// file: src/hooks.server.js
|
|
18
|
+
* import { sequence } from '@sveltejs/kit/hooks';
|
|
19
|
+
*
|
|
20
|
+
* /// type: import('@sveltejs/kit').Handle
|
|
21
|
+
* async function first({ event, resolve }) {
|
|
22
|
+
* console.log('first pre-processing');
|
|
23
|
+
* const result = await resolve(event, {
|
|
24
|
+
* transformPageChunk: ({ html }) => {
|
|
25
|
+
* // transforms are applied in reverse order
|
|
26
|
+
* console.log('first transform');
|
|
27
|
+
* return html;
|
|
28
|
+
* },
|
|
29
|
+
* preload: () => {
|
|
30
|
+
* // this one wins as it's the first defined in the chain
|
|
31
|
+
* console.log('first preload');
|
|
32
|
+
* return true;
|
|
33
|
+
* }
|
|
34
|
+
* });
|
|
35
|
+
* console.log('first post-processing');
|
|
36
|
+
* return result;
|
|
37
|
+
* }
|
|
38
|
+
*
|
|
39
|
+
* /// type: import('@sveltejs/kit').Handle
|
|
40
|
+
* async function second({ event, resolve }) {
|
|
41
|
+
* console.log('second pre-processing');
|
|
42
|
+
* const result = await resolve(event, {
|
|
43
|
+
* transformPageChunk: ({ html }) => {
|
|
44
|
+
* console.log('second transform');
|
|
45
|
+
* return html;
|
|
46
|
+
* },
|
|
47
|
+
* preload: () => {
|
|
48
|
+
* console.log('second preload');
|
|
49
|
+
* return true;
|
|
50
|
+
* },
|
|
51
|
+
* filterSerializedResponseHeaders: () => {
|
|
52
|
+
* // this one wins as it's the first defined in the chain
|
|
53
|
+
* console.log('second filterSerializedResponseHeaders');
|
|
54
|
+
* return true;
|
|
55
|
+
* }
|
|
56
|
+
* });
|
|
57
|
+
* console.log('second post-processing');
|
|
58
|
+
* return result;
|
|
59
|
+
* }
|
|
60
|
+
*
|
|
61
|
+
* export const handle = sequence(first, second);
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* The example above would print:
|
|
65
|
+
*
|
|
66
|
+
* ```
|
|
67
|
+
* first pre-processing
|
|
68
|
+
* first preload
|
|
69
|
+
* second pre-processing
|
|
70
|
+
* second filterSerializedResponseHeaders
|
|
71
|
+
* second transform
|
|
72
|
+
* first transform
|
|
73
|
+
* second post-processing
|
|
74
|
+
* first post-processing
|
|
75
|
+
* ```
|
|
76
|
+
*
|
|
77
|
+
* @param {...Handle} handlers The chain of `handle` functions
|
|
78
|
+
* @returns {Handle}
|
|
79
|
+
*/
|
|
80
|
+
function sequence(...handlers) {
|
|
81
|
+
const length = handlers.length;
|
|
82
|
+
if (!length) return ({ event, resolve }) => resolve(event);
|
|
83
|
+
return ({ event, resolve }) => {
|
|
84
|
+
const { state } = get_request_store();
|
|
85
|
+
return apply_handle(0, event, {});
|
|
86
|
+
/**
|
|
87
|
+
* @param {number} i
|
|
88
|
+
* @param {RequestEvent} event
|
|
89
|
+
* @param {ResolveOptions | undefined} parent_options
|
|
90
|
+
* @returns {MaybePromise<Response>}
|
|
91
|
+
*/
|
|
92
|
+
function apply_handle(i, event, parent_options) {
|
|
93
|
+
const handle = handlers[i];
|
|
94
|
+
return state.tracing.record_span({
|
|
95
|
+
name: `sveltekit.handle.sequenced.${handle.name ? handle.name : i}`,
|
|
96
|
+
attributes: {},
|
|
97
|
+
fn: async (current) => {
|
|
98
|
+
const traced_event = merge_tracing(event, current);
|
|
99
|
+
return await with_request_store({
|
|
100
|
+
event: traced_event,
|
|
101
|
+
state
|
|
102
|
+
}, () => handle({
|
|
103
|
+
event: traced_event,
|
|
104
|
+
resolve: (event, options) => {
|
|
105
|
+
/** @type {ResolveOptions['transformPageChunk']} */
|
|
106
|
+
const transformPageChunk = async ({ html, done }) => {
|
|
107
|
+
if (options?.transformPageChunk) html = await options.transformPageChunk({
|
|
108
|
+
html,
|
|
109
|
+
done
|
|
110
|
+
}) ?? "";
|
|
111
|
+
if (parent_options?.transformPageChunk) html = await parent_options.transformPageChunk({
|
|
112
|
+
html,
|
|
113
|
+
done
|
|
114
|
+
}) ?? "";
|
|
115
|
+
return html;
|
|
116
|
+
};
|
|
117
|
+
/** @type {ResolveOptions['filterSerializedResponseHeaders']} */
|
|
118
|
+
const filterSerializedResponseHeaders = parent_options?.filterSerializedResponseHeaders ?? options?.filterSerializedResponseHeaders;
|
|
119
|
+
/** @type {ResolveOptions['preload']} */
|
|
120
|
+
const preload = parent_options?.preload ?? options?.preload;
|
|
121
|
+
return i < length - 1 ? apply_handle(i + 1, event, {
|
|
122
|
+
transformPageChunk,
|
|
123
|
+
filterSerializedResponseHeaders,
|
|
124
|
+
preload
|
|
125
|
+
}) : resolve(event, {
|
|
126
|
+
transformPageChunk,
|
|
127
|
+
filterSerializedResponseHeaders,
|
|
128
|
+
preload
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
}));
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
//#endregion
|
|
138
|
+
//#region .svelte-kit/adapter-bun/entries/hooks.server.js
|
|
139
|
+
/**
|
|
140
|
+
* Server middleware that handles locale-based routing and request processing.
|
|
141
|
+
*
|
|
142
|
+
* Configure `disableAsyncLocalStorage` when generating Paraglide with
|
|
143
|
+
* `paraglideVitePlugin()` or `compile()`, not when calling
|
|
144
|
+
* `paraglideMiddleware()`. Keep AsyncLocalStorage enabled by default and
|
|
145
|
+
* only disable it for runtimes that lack `AsyncLocalStorage` support and
|
|
146
|
+
* guarantee request isolation.
|
|
147
|
+
*
|
|
148
|
+
* This middleware performs several key functions:
|
|
149
|
+
*
|
|
150
|
+
* 1. Determines the locale for the incoming request using configured strategies
|
|
151
|
+
* 2. Handles URL localization and redirects (only for document requests)
|
|
152
|
+
* 3. Maintains locale state using AsyncLocalStorage to prevent request interference
|
|
153
|
+
*
|
|
154
|
+
* When URL strategy is used:
|
|
155
|
+
*
|
|
156
|
+
* - The locale is extracted from the URL for all request types
|
|
157
|
+
* - If URL doesn't match the determined locale, redirects to localized URL (only for document requests)
|
|
158
|
+
* - De-localizes URLs before passing to server (e.g., `/fr/about` → `/about`)
|
|
159
|
+
*
|
|
160
|
+
* @see https://inlang.com/m/gerre34r/library-inlang-paraglideJs/middleware
|
|
161
|
+
*
|
|
162
|
+
* @template T - The return type of the resolve function
|
|
163
|
+
*
|
|
164
|
+
* @param {Request} request - The incoming request object
|
|
165
|
+
* @param {(args: { request: Request, locale: import("./runtime.js").Locale }) => T | Promise<T>} resolve - Function to handle the request. The callback receives:
|
|
166
|
+
* - `request`: A modified request with a delocalized URL when the URL strategy is used (e.g., `/fr/about` → `/about`).
|
|
167
|
+
* If your framework handles URL localization itself (e.g., TanStack Router's `rewrite` option), use the original
|
|
168
|
+
* request instead to avoid redirect loops.
|
|
169
|
+
* - `locale`: The determined locale for this request.
|
|
170
|
+
* @param {{
|
|
171
|
+
* effectiveRequestUrl?: string | URL | ((request: Request) => string | URL),
|
|
172
|
+
* onRedirect?: (response: Response) => void
|
|
173
|
+
* }} [options] - Options to control middleware behavior. `effectiveRequestUrl` sets the effective request URL used for route matching, URL-based locale detection, redirects, and `getUrlOrigin()`.
|
|
174
|
+
* @returns {Promise<Response>}
|
|
175
|
+
*
|
|
176
|
+
* @example
|
|
177
|
+
* ```typescript
|
|
178
|
+
* // Basic usage in metaframeworks like NextJS, SvelteKit, Astro, Nuxt, etc.
|
|
179
|
+
* export const handle = async ({ event, resolve }) => {
|
|
180
|
+
* return paraglideMiddleware(event.request, ({ request, locale }) => {
|
|
181
|
+
* // let the framework further resolve the request
|
|
182
|
+
* return resolve(request);
|
|
183
|
+
* });
|
|
184
|
+
* };
|
|
185
|
+
* ```
|
|
186
|
+
*
|
|
187
|
+
* @example
|
|
188
|
+
* ```typescript
|
|
189
|
+
* // Usage in a framework like Express JS or Hono
|
|
190
|
+
* app.use(async (req, res, next) => {
|
|
191
|
+
* const result = await paraglideMiddleware(req, ({ request, locale }) => {
|
|
192
|
+
* // If a redirect happens this won't be called
|
|
193
|
+
* return next(request);
|
|
194
|
+
* });
|
|
195
|
+
* });
|
|
196
|
+
* ```
|
|
197
|
+
*
|
|
198
|
+
* @example
|
|
199
|
+
* ```typescript
|
|
200
|
+
* // Usage with frameworks that handle URL localization/delocalization themselves
|
|
201
|
+
* //
|
|
202
|
+
* // Some frameworks like TanStack Router handle URL localization and delocalization
|
|
203
|
+
* // themselves via their own rewrite APIs (e.g., `rewrite.input`/`rewrite.output`).
|
|
204
|
+
* //
|
|
205
|
+
* // When the framework handles this, the middleware's URL delocalization is not needed.
|
|
206
|
+
* // Using the modified `request` from the callback would cause a redirect loop because
|
|
207
|
+
* // both the middleware and the framework would attempt to delocalize the URL.
|
|
208
|
+
* //
|
|
209
|
+
* // Solution: Pass the original request to the handler instead of the modified one.
|
|
210
|
+
* // The middleware still handles locale detection, cookies, and AsyncLocalStorage context.
|
|
211
|
+
* //
|
|
212
|
+
* // ❌ WRONG - causes redirect loop when framework handles URL rewriting:
|
|
213
|
+
* // paraglideMiddleware(req, ({ request }) => handler.fetch(request))
|
|
214
|
+
* //
|
|
215
|
+
* // ✅ CORRECT - use original request when framework handles URL localization:
|
|
216
|
+
* // paraglideMiddleware(req, () => handler.fetch(req))
|
|
217
|
+
*
|
|
218
|
+
* * *
|
|
219
|
+
* export default {
|
|
220
|
+
* fetch(req: Request): Promise<Response> {
|
|
221
|
+
* // TanStack Router handles URL rewriting via deLocalizeUrl/localizeUrl
|
|
222
|
+
* // so we pass the original `req` instead of the modified `request`
|
|
223
|
+
* return paraglideMiddleware(req, () => handler.fetch(req))
|
|
224
|
+
* },
|
|
225
|
+
* }
|
|
226
|
+
* ```
|
|
227
|
+
*/
|
|
228
|
+
async function paraglideMiddleware(request, resolve, options) {
|
|
229
|
+
if (!serverAsyncLocalStorage) {
|
|
230
|
+
const { AsyncLocalStorage } = await import("async_hooks");
|
|
231
|
+
overwriteServerAsyncLocalStorage(new AsyncLocalStorage());
|
|
232
|
+
} else if (!serverAsyncLocalStorage) overwriteServerAsyncLocalStorage(createMockAsyncLocalStorage());
|
|
233
|
+
const url = resolveMiddlewareUrl(request, options?.effectiveRequestUrl);
|
|
234
|
+
const origin = url.origin;
|
|
235
|
+
if (isExcludedByRouteStrategy(url.href)) {
|
|
236
|
+
const locale = "en";
|
|
237
|
+
const newRequest = cloneRequestWithFallback(request, url);
|
|
238
|
+
/** @type {Set<string>} */
|
|
239
|
+
const messageCalls = /* @__PURE__ */ new Set();
|
|
240
|
+
return await serverAsyncLocalStorage?.run({
|
|
241
|
+
locale,
|
|
242
|
+
origin,
|
|
243
|
+
messageCalls
|
|
244
|
+
}, () => resolve({
|
|
245
|
+
locale,
|
|
246
|
+
request: newRequest
|
|
247
|
+
}));
|
|
248
|
+
}
|
|
249
|
+
const strategy = getStrategyForUrl(url.href);
|
|
250
|
+
const decision = await shouldRedirect({
|
|
251
|
+
request,
|
|
252
|
+
effectiveRequestUrl: url
|
|
253
|
+
});
|
|
254
|
+
const locale = decision.locale;
|
|
255
|
+
if (request.headers.get("Sec-Fetch-Dest") === "document" && decision.shouldRedirect && decision.redirectUrl) {
|
|
256
|
+
/** @type {Record<string, string>} */
|
|
257
|
+
const headers = {};
|
|
258
|
+
if (strategy.includes("preferredLanguage")) headers["Vary"] = "Accept-Language";
|
|
259
|
+
const response = new Response(null, {
|
|
260
|
+
status: 307,
|
|
261
|
+
headers: {
|
|
262
|
+
Location: decision.redirectUrl.href,
|
|
263
|
+
...headers
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
options?.onRedirect?.(response);
|
|
267
|
+
return response;
|
|
268
|
+
}
|
|
269
|
+
let newRequest;
|
|
270
|
+
if (strategy.includes("url")) newRequest = cloneRequestWithFallback(request, deLocalizeUrl(url));
|
|
271
|
+
else newRequest = cloneRequestWithFallback(request, url);
|
|
272
|
+
/** @type {Set<string>} */
|
|
273
|
+
const messageCalls = /* @__PURE__ */ new Set();
|
|
274
|
+
return await serverAsyncLocalStorage?.run({
|
|
275
|
+
locale,
|
|
276
|
+
origin,
|
|
277
|
+
messageCalls
|
|
278
|
+
}, () => resolve({
|
|
279
|
+
locale,
|
|
280
|
+
request: newRequest
|
|
281
|
+
}));
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* @param {Request} request
|
|
285
|
+
* @param {string | URL | ((request: Request) => string | URL) | undefined} effectiveRequestUrl
|
|
286
|
+
* @returns {URL}
|
|
287
|
+
*/
|
|
288
|
+
function resolveMiddlewareUrl(request, effectiveRequestUrl) {
|
|
289
|
+
if (typeof effectiveRequestUrl === "function") return new URL(effectiveRequestUrl(request), request.url);
|
|
290
|
+
if (typeof effectiveRequestUrl === "string" || effectiveRequestUrl instanceof URL) return new URL(effectiveRequestUrl, request.url);
|
|
291
|
+
return new URL(request.url);
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Some metaframeworks (NextJS) require a new Request object.
|
|
295
|
+
* https://github.com/opral/inlang-paraglide-js/issues/411
|
|
296
|
+
*
|
|
297
|
+
* However, some frameworks (TanStack Start 1.143+) use custom Request
|
|
298
|
+
* implementations that cannot be cloned with `new Request(request)`.
|
|
299
|
+
* https://github.com/opral/paraglide-js/issues/573
|
|
300
|
+
*
|
|
301
|
+
* Effective request URL overrides behind proxies:
|
|
302
|
+
* https://github.com/opral/paraglide-js/issues/652
|
|
303
|
+
*
|
|
304
|
+
* @param {Request} request
|
|
305
|
+
* @param {string | URL} [url]
|
|
306
|
+
* @returns {Request}
|
|
307
|
+
*/
|
|
308
|
+
function cloneRequestWithFallback(request, url = request.url) {
|
|
309
|
+
const targetUrl = typeof url === "string" ? url : url.href;
|
|
310
|
+
if (targetUrl === request.url) try {
|
|
311
|
+
return new Request(request.clone());
|
|
312
|
+
} catch {
|
|
313
|
+
try {
|
|
314
|
+
return new Request(request);
|
|
315
|
+
} catch {
|
|
316
|
+
return request;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
try {
|
|
320
|
+
return new Request(targetUrl, request.clone());
|
|
321
|
+
} catch {
|
|
322
|
+
try {
|
|
323
|
+
return new Request(targetUrl, request);
|
|
324
|
+
} catch {
|
|
325
|
+
return request;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Creates a mock AsyncLocalStorage implementation for environments where
|
|
331
|
+
* native AsyncLocalStorage is not available or disabled.
|
|
332
|
+
*
|
|
333
|
+
* This mock implementation mimics the behavior of the native AsyncLocalStorage
|
|
334
|
+
* but doesn't require the async_hooks module. It's used as a fallback when
|
|
335
|
+
* the runtime does not expose AsyncLocalStorage or when it has been disabled.
|
|
336
|
+
*
|
|
337
|
+
* @returns {import("./runtime.js").ParaglideAsyncLocalStorage}
|
|
338
|
+
*/
|
|
339
|
+
function createMockAsyncLocalStorage() {
|
|
340
|
+
/** @type {any} */
|
|
341
|
+
let currentStore = void 0;
|
|
342
|
+
return {
|
|
343
|
+
getStore() {
|
|
344
|
+
return currentStore;
|
|
345
|
+
},
|
|
346
|
+
async run(store, callback) {
|
|
347
|
+
currentStore = store;
|
|
348
|
+
try {
|
|
349
|
+
return await callback();
|
|
350
|
+
} finally {
|
|
351
|
+
currentStore = void 0;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Cookie signing and unsigning.
|
|
358
|
+
*
|
|
359
|
+
* Implemented with web crypto instead of Node.js crypto
|
|
360
|
+
* to work in Edge environments such as Cloudflare Worker.
|
|
361
|
+
*/
|
|
362
|
+
/**
|
|
363
|
+
* Convert a string to an ArrayBuffer
|
|
364
|
+
*
|
|
365
|
+
* @param {string} str string to convert to ArrayBuffer (should be the session id)
|
|
366
|
+
* @return {ArrayBuffer} buffer
|
|
367
|
+
*/
|
|
368
|
+
function str2ab(str) {
|
|
369
|
+
const buffer = new Uint8Array(str.length);
|
|
370
|
+
for (let i = 0; i < str.length; i += 1) buffer[i] = str.charCodeAt(i);
|
|
371
|
+
return buffer;
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* Sign the given `val` with `secret`.
|
|
375
|
+
* The `secret` is a secret key to sign the cookie with.
|
|
376
|
+
* This is used to detect tampering the cookie later.
|
|
377
|
+
*
|
|
378
|
+
* The `secret` can be a string or an array of strings.
|
|
379
|
+
* If an array of strings is provided, only the first element will be used to sign the cookie,
|
|
380
|
+
* but all the elements will be used to unsign the cookie.
|
|
381
|
+
*
|
|
382
|
+
* @param {string} val Cookie value to sign (should be the session id)
|
|
383
|
+
* @param {string | string[]} secret Secret string to sign with
|
|
384
|
+
* @return {Promise<string>} Signed cookie in the form of `<val>.<signature>` where `<signature>` is a base64 encoded HMAC SHA256 signature
|
|
385
|
+
*/
|
|
386
|
+
async function sign(val, secret) {
|
|
387
|
+
const keyData = str2ab(typeof secret === "string" ? secret : secret[0]);
|
|
388
|
+
const key = await crypto.subtle.importKey("raw", keyData, {
|
|
389
|
+
name: "HMAC",
|
|
390
|
+
hash: "SHA-256"
|
|
391
|
+
}, false, ["sign"]);
|
|
392
|
+
const signature = await crypto.subtle.sign("HMAC", key, str2ab(val));
|
|
393
|
+
return `${val}.${btoa(String.fromCharCode.apply(null, Array.from(new Uint8Array(signature)))).replace(/=+$/, "")}`;
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* Unsign and decode the given `input` with `secret`,
|
|
397
|
+
* returning `false` if the signature is invalid.
|
|
398
|
+
*
|
|
399
|
+
* The `secret` can be a string or an array of strings.
|
|
400
|
+
* If an array of strings is provided, only the first element will be used to sign the cookie,
|
|
401
|
+
* but all the elements will be used to unsign the cookie.
|
|
402
|
+
*
|
|
403
|
+
* @param {string} input Signed cookie to unsign
|
|
404
|
+
* @param {string | string[]} secret Secret to sign with (should be the same as the one used to sign)
|
|
405
|
+
* @return {Promise<string | null>} Unsigned cookie or `null` if signature is invalid
|
|
406
|
+
*/
|
|
407
|
+
async function unsign(input, secret) {
|
|
408
|
+
const tentativeValue = input.slice(0, input.lastIndexOf("."));
|
|
409
|
+
if (typeof secret === "string") return await sign(tentativeValue, secret) === input ? tentativeValue : null;
|
|
410
|
+
return (await Promise.all(secret.map(async (v) => {
|
|
411
|
+
return await sign(tentativeValue, v) === input ? tentativeValue : null;
|
|
412
|
+
}))).find((v) => v !== null) || null;
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* https://github.com/crypto-utils/uid-safe/tree/master
|
|
416
|
+
*
|
|
417
|
+
* Implemented with web crypto instead of Node.js crypto to work in Edge environments such as Cloudflare Worker.
|
|
418
|
+
*/
|
|
419
|
+
/**
|
|
420
|
+
* Generate a buffer with secure random bytes. *
|
|
421
|
+
* @param size The number of bytes to generate
|
|
422
|
+
* @returns buffer with secure random bytes
|
|
423
|
+
*/
|
|
424
|
+
var randomBytes = (size) => {
|
|
425
|
+
if (size < 0) throw new RangeError("argument size must not be negative");
|
|
426
|
+
return crypto.getRandomValues(new Uint8Array(size));
|
|
427
|
+
};
|
|
428
|
+
var EQUAL_END_REGEXP = /=+$/;
|
|
429
|
+
var PLUS_GLOBAL_REGEXP = /\+/g;
|
|
430
|
+
var SLASH_GLOBAL_REGEXP = /\//g;
|
|
431
|
+
var toString = (buf) => {
|
|
432
|
+
return btoa(String.fromCharCode.apply(null, buf)).replace(EQUAL_END_REGEXP, "").replace(PLUS_GLOBAL_REGEXP, "-").replace(SLASH_GLOBAL_REGEXP, "_");
|
|
433
|
+
};
|
|
434
|
+
/**
|
|
435
|
+
* Generate a UID with the given length.
|
|
436
|
+
* @param length The number of bytes to generate
|
|
437
|
+
* @returns UID(base64 string)
|
|
438
|
+
*/
|
|
439
|
+
var uidSync = (length) => toString(randomBytes(length));
|
|
440
|
+
/**
|
|
441
|
+
* Generate a session ID.
|
|
442
|
+
* @returns {string} session ID(base64 string)
|
|
443
|
+
*/
|
|
444
|
+
var generateSessionId = () => uidSync(24);
|
|
445
|
+
/**
|
|
446
|
+
* Get default cookie options.
|
|
447
|
+
* @returns {CookieSerializeOptions & { path: string }} default cookie options
|
|
448
|
+
*/
|
|
449
|
+
var defaultCookieOptions = () => ({ path: "/" });
|
|
450
|
+
/**
|
|
451
|
+
* Get the TTL in milliseconds for the given cookie options.
|
|
452
|
+
* If `expires` and `maxAge` are set, then `maxAge` takes precedence.
|
|
453
|
+
* See *Note* below for details.
|
|
454
|
+
*
|
|
455
|
+
* *Note* the {@link https://tools.ietf.org/html/rfc6265#section-5.3|cookie storage model specification}
|
|
456
|
+
* states that if both `expires` and `maxAge` are set, then `maxAge` takes precedence, but it is
|
|
457
|
+
* possible not all clients by obey this, so if both are set, they should
|
|
458
|
+
* point to the same date and time.
|
|
459
|
+
*/
|
|
460
|
+
var getTtlMs = (cookie) => {
|
|
461
|
+
const { expires, maxAge } = cookie;
|
|
462
|
+
if (maxAge) return maxAge * 1e3;
|
|
463
|
+
if (expires) {
|
|
464
|
+
const ms = new Date(expires).getTime() - Date.now();
|
|
465
|
+
return Math.ceil(ms / 1e3) * 1e3;
|
|
466
|
+
}
|
|
467
|
+
return Infinity;
|
|
468
|
+
};
|
|
469
|
+
/**
|
|
470
|
+
* Parse session cookie options.
|
|
471
|
+
* @param {SveltekitSessionConfig} options session options
|
|
472
|
+
* @param {SessionCookieOptions} cookieOptions session cookie options
|
|
473
|
+
* @returns {CookieSerializeOptions & { path: string }} cookie options
|
|
474
|
+
*/
|
|
475
|
+
var parseSessionCookieOptions = (options, cookieOptions) => {
|
|
476
|
+
const cookie = { ...cookieOptions };
|
|
477
|
+
if (options.cookie && options.cookie.encode) cookie.encode = (value) => options.cookie.encode(value);
|
|
478
|
+
if (cookie.expires) cookie.expires = new Date(cookie.expires);
|
|
479
|
+
return cookie;
|
|
480
|
+
};
|
|
481
|
+
var Session = class Session {
|
|
482
|
+
constructor(event, options) {
|
|
483
|
+
this.#id = generateSessionId();
|
|
484
|
+
this.#cookieName = options.name || "connect.sid";
|
|
485
|
+
this.#cookie = {
|
|
486
|
+
...defaultCookieOptions(),
|
|
487
|
+
...options.cookie
|
|
488
|
+
};
|
|
489
|
+
this.#sessionOptions = options;
|
|
490
|
+
this.#event = event;
|
|
491
|
+
this.#storeTtlMs = getTtlMs(options.cookie || {});
|
|
492
|
+
}
|
|
493
|
+
static async initialize(event, options) {
|
|
494
|
+
const session = new Session(event, options);
|
|
495
|
+
const { cookies } = session.#event;
|
|
496
|
+
const { secret, store, rolling, saveUninitialized } = session.#sessionOptions;
|
|
497
|
+
const unsignedSid = await unsign(cookies.get(session.#cookieName) || "", secret);
|
|
498
|
+
if (unsignedSid) {
|
|
499
|
+
const sessionData = await store.get(unsignedSid);
|
|
500
|
+
if (sessionData) {
|
|
501
|
+
session.#id = unsignedSid;
|
|
502
|
+
session.#cookie = parseSessionCookieOptions(options, sessionData.cookie);
|
|
503
|
+
session.#data = sessionData.data;
|
|
504
|
+
session.#storeTtlMs = getTtlMs(sessionData.cookie);
|
|
505
|
+
if (session.#cookie.maxAge && rolling) {
|
|
506
|
+
await store.touch(session.#id, session.#cookie.maxAge * 1e3);
|
|
507
|
+
cookies.set(session.#cookieName, await sign(session.#id, secret), session.#cookie);
|
|
508
|
+
}
|
|
509
|
+
return session;
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
if (saveUninitialized) {
|
|
513
|
+
await store.set(session.#id, {
|
|
514
|
+
cookie: session.#getParsableCookieOptions(),
|
|
515
|
+
data: session.#data
|
|
516
|
+
}, session.#storeTtlMs);
|
|
517
|
+
cookies.set(session.#cookieName, await sign(session.#id, secret), session.#cookie);
|
|
518
|
+
}
|
|
519
|
+
return session;
|
|
520
|
+
}
|
|
521
|
+
#id;
|
|
522
|
+
#cookieName;
|
|
523
|
+
#cookie;
|
|
524
|
+
#data = {};
|
|
525
|
+
#sessionOptions;
|
|
526
|
+
#event;
|
|
527
|
+
/**
|
|
528
|
+
* ttl time(milliseconds) for session store.
|
|
529
|
+
*/
|
|
530
|
+
#storeTtlMs;
|
|
531
|
+
/**
|
|
532
|
+
* Session ID.
|
|
533
|
+
*/
|
|
534
|
+
get id() {
|
|
535
|
+
return this.#id;
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* Session cookie name.
|
|
539
|
+
*/
|
|
540
|
+
get cookieName() {
|
|
541
|
+
return this.#cookieName;
|
|
542
|
+
}
|
|
543
|
+
/**
|
|
544
|
+
* Session cookie options.
|
|
545
|
+
*/
|
|
546
|
+
get cookie() {
|
|
547
|
+
return this.#cookie;
|
|
548
|
+
}
|
|
549
|
+
/**
|
|
550
|
+
* Session data.
|
|
551
|
+
*/
|
|
552
|
+
get data() {
|
|
553
|
+
return this.#data;
|
|
554
|
+
}
|
|
555
|
+
/**
|
|
556
|
+
* Session store instance.
|
|
557
|
+
*/
|
|
558
|
+
get store() {
|
|
559
|
+
return this.#sessionOptions.store;
|
|
560
|
+
}
|
|
561
|
+
#getParsableCookieOptions() {
|
|
562
|
+
const cookie = { ...this.#cookie };
|
|
563
|
+
if (cookie.encode) delete cookie.encode;
|
|
564
|
+
return cookie;
|
|
565
|
+
}
|
|
566
|
+
/**
|
|
567
|
+
* Set data in the session.
|
|
568
|
+
*
|
|
569
|
+
* If `saveUninitialized` is `true`, the session is saved without calling `save()`.
|
|
570
|
+
* Conversely, if `saveUninitialized` is `false`, call `save()` to explicitly save the session.
|
|
571
|
+
*/
|
|
572
|
+
async setData(data) {
|
|
573
|
+
this.#data = data;
|
|
574
|
+
if (this.#sessionOptions.saveUninitialized) await this.store.set(this.id, {
|
|
575
|
+
cookie: this.#getParsableCookieOptions(),
|
|
576
|
+
data: this.#data
|
|
577
|
+
}, this.#storeTtlMs);
|
|
578
|
+
}
|
|
579
|
+
/**
|
|
580
|
+
* Save the session (save session to store) and set cookie.
|
|
581
|
+
*/
|
|
582
|
+
async save() {
|
|
583
|
+
await this.#sessionOptions.store.set(this.id, {
|
|
584
|
+
cookie: this.#getParsableCookieOptions(),
|
|
585
|
+
data: this.#data
|
|
586
|
+
}, this.#storeTtlMs);
|
|
587
|
+
this.#event.cookies.set(this.#cookieName, await sign(this.#id, this.#sessionOptions.secret), this.#cookie);
|
|
588
|
+
}
|
|
589
|
+
/**
|
|
590
|
+
* Regenerate the session simply invoke the method.
|
|
591
|
+
* Once complete, a new Session and `Session` instance will be initialized.
|
|
592
|
+
*/
|
|
593
|
+
async regenerate() {
|
|
594
|
+
await this.destroy();
|
|
595
|
+
return new Session(this.#event, this.#sessionOptions);
|
|
596
|
+
}
|
|
597
|
+
/**
|
|
598
|
+
* Destroy the session.
|
|
599
|
+
*/
|
|
600
|
+
async destroy() {
|
|
601
|
+
await this.#sessionOptions.store.destroy(this.#id);
|
|
602
|
+
this.#event.cookies.delete(this.#cookieName, { ...this.#cookie });
|
|
603
|
+
}
|
|
604
|
+
};
|
|
605
|
+
var import_ttlcache = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
606
|
+
/* istanbul ignore next */
|
|
607
|
+
var perf = typeof performance === "object" && performance && typeof performance.now === "function" ? performance : Date;
|
|
608
|
+
var now = () => perf.now();
|
|
609
|
+
var isPosInt = (n) => n && n === Math.floor(n) && n > 0 && isFinite(n);
|
|
610
|
+
var isPosIntOrInf = (n) => n === Infinity || isPosInt(n);
|
|
611
|
+
module.exports = class TTLCache {
|
|
612
|
+
constructor({ max = Infinity, ttl, updateAgeOnGet = false, checkAgeOnGet = false, noUpdateTTL = false, dispose, noDisposeOnSet = false } = {}) {
|
|
613
|
+
this.expirations = Object.create(null);
|
|
614
|
+
this.data = /* @__PURE__ */ new Map();
|
|
615
|
+
this.expirationMap = /* @__PURE__ */ new Map();
|
|
616
|
+
if (ttl !== void 0 && !isPosIntOrInf(ttl)) throw new TypeError("ttl must be positive integer or Infinity if set");
|
|
617
|
+
if (!isPosIntOrInf(max)) throw new TypeError("max must be positive integer or Infinity");
|
|
618
|
+
this.ttl = ttl;
|
|
619
|
+
this.max = max;
|
|
620
|
+
this.updateAgeOnGet = !!updateAgeOnGet;
|
|
621
|
+
this.checkAgeOnGet = !!checkAgeOnGet;
|
|
622
|
+
this.noUpdateTTL = !!noUpdateTTL;
|
|
623
|
+
this.noDisposeOnSet = !!noDisposeOnSet;
|
|
624
|
+
if (dispose !== void 0) {
|
|
625
|
+
if (typeof dispose !== "function") throw new TypeError("dispose must be function if set");
|
|
626
|
+
this.dispose = dispose;
|
|
627
|
+
}
|
|
628
|
+
this.timer = void 0;
|
|
629
|
+
this.timerExpiration = void 0;
|
|
630
|
+
}
|
|
631
|
+
setTimer(expiration, ttl) {
|
|
632
|
+
if (this.timerExpiration < expiration) return;
|
|
633
|
+
if (this.timer) clearTimeout(this.timer);
|
|
634
|
+
const t = setTimeout(() => {
|
|
635
|
+
this.timer = void 0;
|
|
636
|
+
this.timerExpiration = void 0;
|
|
637
|
+
this.purgeStale();
|
|
638
|
+
for (const exp in this.expirations) {
|
|
639
|
+
this.setTimer(exp, exp - now());
|
|
640
|
+
break;
|
|
641
|
+
}
|
|
642
|
+
}, ttl);
|
|
643
|
+
/* istanbul ignore else - affordance for non-node envs */
|
|
644
|
+
if (t.unref) t.unref();
|
|
645
|
+
this.timerExpiration = expiration;
|
|
646
|
+
this.timer = t;
|
|
647
|
+
}
|
|
648
|
+
cancelTimer() {
|
|
649
|
+
if (this.timer) {
|
|
650
|
+
clearTimeout(this.timer);
|
|
651
|
+
this.timerExpiration = void 0;
|
|
652
|
+
this.timer = void 0;
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
/* istanbul ignore next */
|
|
656
|
+
cancelTimers() {
|
|
657
|
+
process.emitWarning("TTLCache.cancelTimers has been renamed to TTLCache.cancelTimer (no \"s\"), and will be removed in the next major version update");
|
|
658
|
+
return this.cancelTimer();
|
|
659
|
+
}
|
|
660
|
+
clear() {
|
|
661
|
+
const entries = this.dispose !== TTLCache.prototype.dispose ? [...this] : [];
|
|
662
|
+
this.data.clear();
|
|
663
|
+
this.expirationMap.clear();
|
|
664
|
+
this.cancelTimer();
|
|
665
|
+
this.expirations = Object.create(null);
|
|
666
|
+
for (const [key, val] of entries) this.dispose(val, key, "delete");
|
|
667
|
+
}
|
|
668
|
+
setTTL(key, ttl = this.ttl) {
|
|
669
|
+
const current = this.expirationMap.get(key);
|
|
670
|
+
if (current !== void 0) {
|
|
671
|
+
const exp = this.expirations[current];
|
|
672
|
+
if (!exp || exp.length <= 1) delete this.expirations[current];
|
|
673
|
+
else this.expirations[current] = exp.filter((k) => k !== key);
|
|
674
|
+
}
|
|
675
|
+
if (ttl !== Infinity) {
|
|
676
|
+
const expiration = Math.floor(now() + ttl);
|
|
677
|
+
this.expirationMap.set(key, expiration);
|
|
678
|
+
if (!this.expirations[expiration]) {
|
|
679
|
+
this.expirations[expiration] = [];
|
|
680
|
+
this.setTimer(expiration, ttl);
|
|
681
|
+
}
|
|
682
|
+
this.expirations[expiration].push(key);
|
|
683
|
+
} else this.expirationMap.set(key, Infinity);
|
|
684
|
+
}
|
|
685
|
+
set(key, val, { ttl = this.ttl, noUpdateTTL = this.noUpdateTTL, noDisposeOnSet = this.noDisposeOnSet } = {}) {
|
|
686
|
+
if (!isPosIntOrInf(ttl)) throw new TypeError("ttl must be positive integer or Infinity");
|
|
687
|
+
if (this.expirationMap.has(key)) {
|
|
688
|
+
if (!noUpdateTTL) this.setTTL(key, ttl);
|
|
689
|
+
const oldValue = this.data.get(key);
|
|
690
|
+
if (oldValue !== val) {
|
|
691
|
+
this.data.set(key, val);
|
|
692
|
+
if (!noDisposeOnSet) this.dispose(oldValue, key, "set");
|
|
693
|
+
}
|
|
694
|
+
} else {
|
|
695
|
+
this.setTTL(key, ttl);
|
|
696
|
+
this.data.set(key, val);
|
|
697
|
+
}
|
|
698
|
+
while (this.size > this.max) this.purgeToCapacity();
|
|
699
|
+
return this;
|
|
700
|
+
}
|
|
701
|
+
has(key) {
|
|
702
|
+
return this.data.has(key);
|
|
703
|
+
}
|
|
704
|
+
getRemainingTTL(key) {
|
|
705
|
+
const expiration = this.expirationMap.get(key);
|
|
706
|
+
return expiration === Infinity ? expiration : expiration !== void 0 ? Math.max(0, Math.ceil(expiration - now())) : 0;
|
|
707
|
+
}
|
|
708
|
+
get(key, { updateAgeOnGet = this.updateAgeOnGet, ttl = this.ttl, checkAgeOnGet = this.checkAgeOnGet } = {}) {
|
|
709
|
+
const val = this.data.get(key);
|
|
710
|
+
if (checkAgeOnGet && this.getRemainingTTL(key) === 0) {
|
|
711
|
+
this.delete(key);
|
|
712
|
+
return;
|
|
713
|
+
}
|
|
714
|
+
if (updateAgeOnGet) this.setTTL(key, ttl);
|
|
715
|
+
return val;
|
|
716
|
+
}
|
|
717
|
+
dispose(_, __) {}
|
|
718
|
+
delete(key) {
|
|
719
|
+
const current = this.expirationMap.get(key);
|
|
720
|
+
if (current !== void 0) {
|
|
721
|
+
const value = this.data.get(key);
|
|
722
|
+
this.data.delete(key);
|
|
723
|
+
this.expirationMap.delete(key);
|
|
724
|
+
const exp = this.expirations[current];
|
|
725
|
+
if (exp) if (exp.length <= 1) delete this.expirations[current];
|
|
726
|
+
else this.expirations[current] = exp.filter((k) => k !== key);
|
|
727
|
+
this.dispose(value, key, "delete");
|
|
728
|
+
if (this.size === 0) this.cancelTimer();
|
|
729
|
+
return true;
|
|
730
|
+
}
|
|
731
|
+
return false;
|
|
732
|
+
}
|
|
733
|
+
purgeToCapacity() {
|
|
734
|
+
for (const exp in this.expirations) {
|
|
735
|
+
const keys = this.expirations[exp];
|
|
736
|
+
if (this.size - keys.length >= this.max) {
|
|
737
|
+
delete this.expirations[exp];
|
|
738
|
+
const entries = [];
|
|
739
|
+
for (const key of keys) {
|
|
740
|
+
entries.push([key, this.data.get(key)]);
|
|
741
|
+
this.data.delete(key);
|
|
742
|
+
this.expirationMap.delete(key);
|
|
743
|
+
}
|
|
744
|
+
for (const [key, val] of entries) this.dispose(val, key, "evict");
|
|
745
|
+
} else {
|
|
746
|
+
const s = this.size - this.max;
|
|
747
|
+
const entries = [];
|
|
748
|
+
for (const key of keys.splice(0, s)) {
|
|
749
|
+
entries.push([key, this.data.get(key)]);
|
|
750
|
+
this.data.delete(key);
|
|
751
|
+
this.expirationMap.delete(key);
|
|
752
|
+
}
|
|
753
|
+
for (const [key, val] of entries) this.dispose(val, key, "evict");
|
|
754
|
+
return;
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
get size() {
|
|
759
|
+
return this.data.size;
|
|
760
|
+
}
|
|
761
|
+
purgeStale() {
|
|
762
|
+
const n = Math.ceil(now());
|
|
763
|
+
for (const exp in this.expirations) {
|
|
764
|
+
if (exp === "Infinity" || exp > n) return;
|
|
765
|
+
/* istanbul ignore next
|
|
766
|
+
* mysterious need for a guard here?
|
|
767
|
+
* https://github.com/isaacs/ttlcache/issues/26 */
|
|
768
|
+
const keys = [...this.expirations[exp] || []];
|
|
769
|
+
const entries = [];
|
|
770
|
+
delete this.expirations[exp];
|
|
771
|
+
for (const key of keys) {
|
|
772
|
+
entries.push([key, this.data.get(key)]);
|
|
773
|
+
this.data.delete(key);
|
|
774
|
+
this.expirationMap.delete(key);
|
|
775
|
+
}
|
|
776
|
+
for (const [key, val] of entries) this.dispose(val, key, "stale");
|
|
777
|
+
}
|
|
778
|
+
if (this.size === 0) this.cancelTimer();
|
|
779
|
+
}
|
|
780
|
+
*entries() {
|
|
781
|
+
for (const exp in this.expirations) for (const key of this.expirations[exp]) yield [key, this.data.get(key)];
|
|
782
|
+
}
|
|
783
|
+
*keys() {
|
|
784
|
+
for (const exp in this.expirations) for (const key of this.expirations[exp]) yield key;
|
|
785
|
+
}
|
|
786
|
+
*values() {
|
|
787
|
+
for (const exp in this.expirations) for (const key of this.expirations[exp]) yield this.data.get(key);
|
|
788
|
+
}
|
|
789
|
+
[Symbol.iterator]() {
|
|
790
|
+
return this.entries();
|
|
791
|
+
}
|
|
792
|
+
};
|
|
793
|
+
})))(), 1);
|
|
794
|
+
var ONE_DAY_IN_SECONDS = 86400;
|
|
795
|
+
var MemoryStore = class {
|
|
796
|
+
#sessions = new import_ttlcache.default();
|
|
797
|
+
#prefix;
|
|
798
|
+
#serializer;
|
|
799
|
+
/**
|
|
800
|
+
* Time to live in milliseconds.
|
|
801
|
+
* default: 86400 * 1000
|
|
802
|
+
*/
|
|
803
|
+
#ttl;
|
|
804
|
+
constructor(options) {
|
|
805
|
+
this.#prefix = options?.prefix || "";
|
|
806
|
+
this.#serializer = options?.serializer || JSON;
|
|
807
|
+
this.#ttl = options?.ttl || ONE_DAY_IN_SECONDS * 1e3;
|
|
808
|
+
}
|
|
809
|
+
async get(id) {
|
|
810
|
+
const key = this.#prefix + id;
|
|
811
|
+
const storeData = this.#sessions.get(key);
|
|
812
|
+
return storeData ? this.#serializer.parse(storeData) : null;
|
|
813
|
+
}
|
|
814
|
+
async set(id, storeData, ttl) {
|
|
815
|
+
const key = this.#prefix + id;
|
|
816
|
+
const serialized = this.#serializer.stringify(storeData);
|
|
817
|
+
if (ttl !== Infinity) {
|
|
818
|
+
this.#sessions.set(key, serialized, { ttl });
|
|
819
|
+
return;
|
|
820
|
+
}
|
|
821
|
+
this.#sessions.set(key, serialized, { ttl: this.#ttl });
|
|
822
|
+
}
|
|
823
|
+
async destroy(id) {
|
|
824
|
+
const key = this.#prefix + id;
|
|
825
|
+
this.#sessions.delete(key);
|
|
826
|
+
}
|
|
827
|
+
async touch(id, ttl) {
|
|
828
|
+
const key = this.#prefix + id;
|
|
829
|
+
this.#sessions.setTTL(key, ttl);
|
|
830
|
+
}
|
|
831
|
+
};
|
|
832
|
+
var memoryStore = new MemoryStore();
|
|
833
|
+
var sveltekitSessionHandle = (options) => async ({ event, resolve }) => {
|
|
834
|
+
const { locals } = event;
|
|
835
|
+
locals.session = await Session.initialize({ cookies: event.cookies }, {
|
|
836
|
+
store: memoryStore,
|
|
837
|
+
...options
|
|
838
|
+
});
|
|
839
|
+
return await resolve(event);
|
|
840
|
+
};
|
|
841
|
+
if (!private_env.SESSION_SECRET) {
|
|
842
|
+
private_env.SESSION_SECRET = crypto$1.randomBytes(20).toString("hex");
|
|
843
|
+
console.log(`SESSION_SECRET not found, generating a temporary one: ${private_env.SESSION_SECRET}`);
|
|
844
|
+
}
|
|
845
|
+
var sessionHandle = sveltekitSessionHandle({ secret: private_env.SESSION_SECRET });
|
|
846
|
+
var checkAuthorizationHandle = async ({ event, resolve }) => {
|
|
847
|
+
if (!event.locals.session.data.path && event.url.pathname !== "/load-project" && event.url.pathname + event.url.search !== "/cli?/createProject") throw redirect(302, "/load-project");
|
|
848
|
+
return resolve(event);
|
|
849
|
+
};
|
|
850
|
+
var handleParaglide = ({ event, resolve }) => paraglideMiddleware(event.request, ({ request, locale }) => {
|
|
851
|
+
event.request = request;
|
|
852
|
+
return resolve(event, { transformPageChunk: ({ html }) => html.replace("%paraglide.lang%", locale) });
|
|
853
|
+
});
|
|
854
|
+
var handle = sequence(sessionHandle, handleParaglide, checkAuthorizationHandle);
|
|
855
|
+
//#endregion
|
|
856
|
+
export { handle };
|
|
857
|
+
|
|
858
|
+
//# sourceMappingURL=hooks.server-DqaQ1y1I.js.map
|