@screenreader-speech-capture/bridge 0.0.0-stage → 0.0.2
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 +46 -2
- package/dist/cli.mjs +6291 -0
- package/dist/ui/adapter-node.js +11 -0
- package/dist/ui/client/ui/_app/immutable/assets/0.ONZWQgDA.css +1 -0
- package/dist/ui/client/ui/_app/immutable/assets/0.ONZWQgDA.css.br +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/0.ONZWQgDA.css.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/2.DSVNnDlO.css +1 -0
- package/dist/ui/client/ui/_app/immutable/assets/2.DSVNnDlO.css.br +3 -0
- package/dist/ui/client/ui/_app/immutable/assets/2.DSVNnDlO.css.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/3.WduKm4aT.css +1 -0
- package/dist/ui/client/ui/_app/immutable/assets/3.WduKm4aT.css.br +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/3.WduKm4aT.css.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/4.DyY1vjRV.css +1 -0
- package/dist/ui/client/ui/_app/immutable/assets/4.DyY1vjRV.css.br +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/4.DyY1vjRV.css.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/5.YyxFzHED.css +1 -0
- package/dist/ui/client/ui/_app/immutable/assets/5.YyxFzHED.css.br +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/5.YyxFzHED.css.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/6.C0Nhvs_m.css +1 -0
- package/dist/ui/client/ui/_app/immutable/assets/6.C0Nhvs_m.css.br +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/6.C0Nhvs_m.css.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/ExternalLink.CYXazpKA.css +1 -0
- package/dist/ui/client/ui/_app/immutable/assets/ExternalLink.CYXazpKA.css.br +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/ExternalLink.CYXazpKA.css.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/Pane.Dgdg5KMw.css +1 -0
- package/dist/ui/client/ui/_app/immutable/assets/Pane.Dgdg5KMw.css.br +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/Pane.Dgdg5KMw.css.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/material-symbols-outlined-latin-400-normal.BhEvR8fk.woff2 +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/roboto-flex-cyrillic-ext-opsz-normal.nDQikIyu.woff2 +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/roboto-flex-cyrillic-opsz-normal.SjuC5rw5.woff2 +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/roboto-flex-greek-opsz-normal.C14fFRny.woff2 +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/roboto-flex-latin-ext-opsz-normal.xNclTVCo.woff2 +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/roboto-flex-latin-opsz-normal.hy8fyBBC.woff2 +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/roboto-flex-vietnamese-opsz-normal.C-H_yGOU.woff2 +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-cyrillic-400-normal.B3hIXASd.woff +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-cyrillic-400-normal.C-_K-ZCn.woff2 +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-cyrillic-500-normal.DGZ7-lUP.woff2 +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-cyrillic-500-normal.NpUJFYX7.woff +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-cyrillic-ext-400-normal.BHxv52bw.woff2 +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-cyrillic-ext-400-normal.W26xs1TL.woff +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-cyrillic-ext-500-normal.6xdwlG7p.woff +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-cyrillic-ext-500-normal.DC57U9n8.woff2 +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-greek-400-normal.CH_u3Aru.woff2 +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-greek-400-normal.P8xe1gs1.woff +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-greek-500-normal.C2M8jX6G.woff +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-greek-500-normal.DpRFkptA.woff2 +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-latin-400-normal.DBZPkcnn.woff +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-latin-400-normal.GekRknry.woff2 +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-latin-500-normal.D6j6AMzd.woff +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-latin-500-normal.pxIOXZmA.woff2 +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-latin-ext-400-normal.BwLXVYNz.woff +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-latin-ext-400-normal.DLAV9S_w.woff2 +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-latin-ext-500-normal.B1IjfbhL.woff +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-latin-ext-500-normal.Db3ge6Oe.woff2 +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-vietnamese-400-normal.CzWHQABp.woff +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-vietnamese-400-normal.yYTFiTTs.woff2 +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-vietnamese-500-normal.Cq-quQMu.woff2 +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-vietnamese-500-normal.IxzxMIj7.woff +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/0FroJ-XN.js +3 -0
- package/dist/ui/client/ui/_app/immutable/chunks/0FroJ-XN.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/0FroJ-XN.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/4wvZDMeR.js +33 -0
- package/dist/ui/client/ui/_app/immutable/chunks/4wvZDMeR.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/4wvZDMeR.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/B1Ryegye.js +3 -0
- package/dist/ui/client/ui/_app/immutable/chunks/B1Ryegye.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/B1Ryegye.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/B1vArRqi.js +3 -0
- package/dist/ui/client/ui/_app/immutable/chunks/B1vArRqi.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/B1vArRqi.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/BS7n1gMj.js +40 -0
- package/dist/ui/client/ui/_app/immutable/chunks/BS7n1gMj.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/BS7n1gMj.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/B_ZElYu_.js +1 -0
- package/dist/ui/client/ui/_app/immutable/chunks/B_ZElYu_.js.br +2 -0
- package/dist/ui/client/ui/_app/immutable/chunks/B_ZElYu_.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/Beqi9dRN.js +72 -0
- package/dist/ui/client/ui/_app/immutable/chunks/Beqi9dRN.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/Beqi9dRN.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/BnU72Mow.js +2 -0
- package/dist/ui/client/ui/_app/immutable/chunks/BnU72Mow.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/BnU72Mow.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/Bvlvl8SZ.js +1 -0
- package/dist/ui/client/ui/_app/immutable/chunks/Bvlvl8SZ.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/Bvlvl8SZ.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/CK3uUd4t.js +48 -0
- package/dist/ui/client/ui/_app/immutable/chunks/CK3uUd4t.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/CK3uUd4t.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/CMWEX9XL.js +138 -0
- package/dist/ui/client/ui/_app/immutable/chunks/CMWEX9XL.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/CMWEX9XL.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/CVpgcnu3.js +1 -0
- package/dist/ui/client/ui/_app/immutable/chunks/CVpgcnu3.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/CVpgcnu3.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/D-2Nx62w.js +1 -0
- package/dist/ui/client/ui/_app/immutable/chunks/D-2Nx62w.js.br +4 -0
- package/dist/ui/client/ui/_app/immutable/chunks/D-2Nx62w.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/D0famktY.js +1 -0
- package/dist/ui/client/ui/_app/immutable/chunks/D0famktY.js.br +2 -0
- package/dist/ui/client/ui/_app/immutable/chunks/D0famktY.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/DHsTyp2W.js +1 -0
- package/dist/ui/client/ui/_app/immutable/chunks/DHsTyp2W.js.br +2 -0
- package/dist/ui/client/ui/_app/immutable/chunks/DHsTyp2W.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/DOY87jO2.js +1 -0
- package/dist/ui/client/ui/_app/immutable/chunks/DOY87jO2.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/DOY87jO2.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/DUTjbZNf.js +1 -0
- package/dist/ui/client/ui/_app/immutable/chunks/DUTjbZNf.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/DUTjbZNf.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/Dvxhfd7j.js +3 -0
- package/dist/ui/client/ui/_app/immutable/chunks/Dvxhfd7j.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/Dvxhfd7j.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/DzInmTUe.js +1 -0
- package/dist/ui/client/ui/_app/immutable/chunks/DzInmTUe.js.br +1 -0
- package/dist/ui/client/ui/_app/immutable/chunks/DzInmTUe.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/tKonUL5Y.js +4 -0
- package/dist/ui/client/ui/_app/immutable/chunks/tKonUL5Y.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/tKonUL5Y.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/entry/app.C8tsut3X.js +2 -0
- package/dist/ui/client/ui/_app/immutable/entry/app.C8tsut3X.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/entry/app.C8tsut3X.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/entry/payload.DSmR2FwN.js +1 -0
- package/dist/ui/client/ui/_app/immutable/entry/payload.DSmR2FwN.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/entry/payload.DSmR2FwN.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/entry/start.DqIv9xYX.js +2 -0
- package/dist/ui/client/ui/_app/immutable/entry/start.DqIv9xYX.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/entry/start.DqIv9xYX.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/0.3bVKqGbx.js +1 -0
- package/dist/ui/client/ui/_app/immutable/nodes/0.3bVKqGbx.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/0.3bVKqGbx.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/1.C81neQJL.js +1 -0
- package/dist/ui/client/ui/_app/immutable/nodes/1.C81neQJL.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/1.C81neQJL.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/2.CmlyeAx_.js +1 -0
- package/dist/ui/client/ui/_app/immutable/nodes/2.CmlyeAx_.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/2.CmlyeAx_.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/3.WT26F_BF.js +5 -0
- package/dist/ui/client/ui/_app/immutable/nodes/3.WT26F_BF.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/3.WT26F_BF.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/4.tiDJxi6M.js +160 -0
- package/dist/ui/client/ui/_app/immutable/nodes/4.tiDJxi6M.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/4.tiDJxi6M.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/5.MzfJoePg.js +6 -0
- package/dist/ui/client/ui/_app/immutable/nodes/5.MzfJoePg.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/5.MzfJoePg.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/6.bNZhqiRK.js +6 -0
- package/dist/ui/client/ui/_app/immutable/nodes/6.bNZhqiRK.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/6.bNZhqiRK.js.gz +0 -0
- package/dist/ui/client/ui/_app/version.json +1 -0
- package/dist/ui/client/ui/_app/version.json.br +0 -0
- package/dist/ui/client/ui/_app/version.json.gz +0 -0
- package/dist/ui/client/ui/robots.txt +3 -0
- package/dist/ui/client/ui/robots.txt.br +0 -0
- package/dist/ui/client/ui/robots.txt.gz +0 -0
- package/dist/ui/handler.js +1 -0
- package/dist/ui/index.js +1 -0
- package/dist/ui/server/.vite/manifest.json +761 -0
- package/dist/ui/server/_app/immutable/assets/ExternalLink.CYXazpKA.css +1 -0
- package/dist/ui/server/_app/immutable/assets/Pane.Dgdg5KMw.css +1 -0
- package/dist/ui/server/_app/immutable/assets/_layout.DSVNnDlO.css +1 -0
- package/dist/ui/server/_app/immutable/assets/_layout.ONZWQgDA.css +1 -0
- package/dist/ui/server/_app/immutable/assets/_page.C0Nhvs_m.css +1 -0
- package/dist/ui/server/_app/immutable/assets/_page.DyY1vjRV.css +1 -0
- package/dist/ui/server/_app/immutable/assets/_page.WduKm4aT.css +1 -0
- package/dist/ui/server/_app/immutable/assets/_page.YyxFzHED.css +1 -0
- package/dist/ui/server/_app/immutable/assets/material-symbols-outlined-latin-400-normal.BhEvR8fk.woff2 +0 -0
- package/dist/ui/server/_app/immutable/assets/roboto-flex-cyrillic-ext-opsz-normal.nDQikIyu.woff2 +0 -0
- package/dist/ui/server/_app/immutable/assets/roboto-flex-cyrillic-opsz-normal.SjuC5rw5.woff2 +0 -0
- package/dist/ui/server/_app/immutable/assets/roboto-flex-greek-opsz-normal.C14fFRny.woff2 +0 -0
- package/dist/ui/server/_app/immutable/assets/roboto-flex-latin-ext-opsz-normal.xNclTVCo.woff2 +0 -0
- package/dist/ui/server/_app/immutable/assets/roboto-flex-latin-opsz-normal.hy8fyBBC.woff2 +0 -0
- package/dist/ui/server/_app/immutable/assets/roboto-flex-vietnamese-opsz-normal.C-H_yGOU.woff2 +0 -0
- package/dist/ui/server/_app/immutable/assets/roboto-mono-cyrillic-400-normal.B3hIXASd.woff +0 -0
- package/dist/ui/server/_app/immutable/assets/roboto-mono-cyrillic-400-normal.C-_K-ZCn.woff2 +0 -0
- package/dist/ui/server/_app/immutable/assets/roboto-mono-cyrillic-500-normal.DGZ7-lUP.woff2 +0 -0
- package/dist/ui/server/_app/immutable/assets/roboto-mono-cyrillic-500-normal.NpUJFYX7.woff +0 -0
- package/dist/ui/server/_app/immutable/assets/roboto-mono-cyrillic-ext-400-normal.BHxv52bw.woff2 +0 -0
- package/dist/ui/server/_app/immutable/assets/roboto-mono-cyrillic-ext-400-normal.W26xs1TL.woff +0 -0
- package/dist/ui/server/_app/immutable/assets/roboto-mono-cyrillic-ext-500-normal.6xdwlG7p.woff +0 -0
- package/dist/ui/server/_app/immutable/assets/roboto-mono-cyrillic-ext-500-normal.DC57U9n8.woff2 +0 -0
- package/dist/ui/server/_app/immutable/assets/roboto-mono-greek-400-normal.CH_u3Aru.woff2 +0 -0
- package/dist/ui/server/_app/immutable/assets/roboto-mono-greek-400-normal.P8xe1gs1.woff +0 -0
- package/dist/ui/server/_app/immutable/assets/roboto-mono-greek-500-normal.C2M8jX6G.woff +0 -0
- package/dist/ui/server/_app/immutable/assets/roboto-mono-greek-500-normal.DpRFkptA.woff2 +0 -0
- package/dist/ui/server/_app/immutable/assets/roboto-mono-latin-400-normal.DBZPkcnn.woff +0 -0
- package/dist/ui/server/_app/immutable/assets/roboto-mono-latin-400-normal.GekRknry.woff2 +0 -0
- package/dist/ui/server/_app/immutable/assets/roboto-mono-latin-500-normal.D6j6AMzd.woff +0 -0
- package/dist/ui/server/_app/immutable/assets/roboto-mono-latin-500-normal.pxIOXZmA.woff2 +0 -0
- package/dist/ui/server/_app/immutable/assets/roboto-mono-latin-ext-400-normal.BwLXVYNz.woff +0 -0
- package/dist/ui/server/_app/immutable/assets/roboto-mono-latin-ext-400-normal.DLAV9S_w.woff2 +0 -0
- package/dist/ui/server/_app/immutable/assets/roboto-mono-latin-ext-500-normal.B1IjfbhL.woff +0 -0
- package/dist/ui/server/_app/immutable/assets/roboto-mono-latin-ext-500-normal.Db3ge6Oe.woff2 +0 -0
- package/dist/ui/server/_app/immutable/assets/roboto-mono-vietnamese-400-normal.CzWHQABp.woff +0 -0
- package/dist/ui/server/_app/immutable/assets/roboto-mono-vietnamese-400-normal.yYTFiTTs.woff2 +0 -0
- package/dist/ui/server/_app/immutable/assets/roboto-mono-vietnamese-500-normal.Cq-quQMu.woff2 +0 -0
- package/dist/ui/server/_app/immutable/assets/roboto-mono-vietnamese-500-normal.IxzxMIj7.woff +0 -0
- package/dist/ui/server/adapter-env.js +1 -0
- package/dist/ui/server/adapter-index.js +73 -0
- package/dist/ui/server/adapter-index.js.map +1 -0
- package/dist/ui/server/adapter-node-env.js +63 -0
- package/dist/ui/server/adapter-node-env.js.map +1 -0
- package/dist/ui/server/adapter-node-handler.js +638 -0
- package/dist/ui/server/adapter-node-handler.js.map +1 -0
- package/dist/ui/server/chunks/ExternalLink.js +12 -0
- package/dist/ui/server/chunks/ExternalLink.js.map +1 -0
- package/dist/ui/server/chunks/Pane.js +13 -0
- package/dist/ui/server/chunks/Pane.js.map +1 -0
- package/dist/ui/server/chunks/composition.js +3468 -0
- package/dist/ui/server/chunks/composition.js.map +1 -0
- package/dist/ui/server/chunks/config-state.js +21 -0
- package/dist/ui/server/chunks/config-state.js.map +1 -0
- package/dist/ui/server/chunks/config.js +145 -0
- package/dist/ui/server/chunks/config.js.map +1 -0
- package/dist/ui/server/chunks/dialog.js +592 -0
- package/dist/ui/server/chunks/dialog.js.map +1 -0
- package/dist/ui/server/chunks/exports.js +352 -0
- package/dist/ui/server/chunks/exports.js.map +1 -0
- package/dist/ui/server/chunks/filled-button.js +116 -0
- package/dist/ui/server/chunks/filled-button.js.map +1 -0
- package/dist/ui/server/chunks/functions.js +29 -0
- package/dist/ui/server/chunks/functions.js.map +1 -0
- package/dist/ui/server/chunks/icon-button.js +234 -0
- package/dist/ui/server/chunks/icon-button.js.map +1 -0
- package/dist/ui/server/chunks/icon.js +49 -0
- package/dist/ui/server/chunks/icon.js.map +1 -0
- package/dist/ui/server/chunks/index-server.js +6 -0
- package/dist/ui/server/chunks/index-server.js.map +1 -0
- package/dist/ui/server/chunks/instance.js +3577 -0
- package/dist/ui/server/chunks/instance.js.map +1 -0
- package/dist/ui/server/chunks/internal.js +3577 -0
- package/dist/ui/server/chunks/internal.js.map +1 -0
- package/dist/ui/server/chunks/navigation.js +11 -0
- package/dist/ui/server/chunks/navigation.js.map +1 -0
- package/dist/ui/server/chunks/navigation2.js +15 -0
- package/dist/ui/server/chunks/navigation2.js.map +1 -0
- package/dist/ui/server/chunks/outlined-text-field.js +1477 -0
- package/dist/ui/server/chunks/outlined-text-field.js.map +1 -0
- package/dist/ui/server/chunks/paths.js +2 -0
- package/dist/ui/server/chunks/redispatch-event.js +91 -0
- package/dist/ui/server/chunks/redispatch-event.js.map +1 -0
- package/dist/ui/server/chunks/remote-1j2tn2d.js +4 -0
- package/dist/ui/server/chunks/remote.js +1580 -0
- package/dist/ui/server/chunks/remote.js.map +1 -0
- package/dist/ui/server/chunks/scope.js +13 -0
- package/dist/ui/server/chunks/scope.js.map +1 -0
- package/dist/ui/server/chunks/server-errors.js +471 -0
- package/dist/ui/server/chunks/server-errors.js.map +1 -0
- package/dist/ui/server/chunks/server.js +8 -0
- package/dist/ui/server/chunks/server.js.map +1 -0
- package/dist/ui/server/chunks/server2.js +1960 -0
- package/dist/ui/server/chunks/server2.js.map +1 -0
- package/dist/ui/server/chunks/sessions.js +65 -0
- package/dist/ui/server/chunks/sessions.js.map +1 -0
- package/dist/ui/server/chunks/sessions.remote.js +56 -0
- package/dist/ui/server/chunks/sessions.remote.js.map +1 -0
- package/dist/ui/server/chunks/shared-errors.js +198 -0
- package/dist/ui/server/chunks/shared-errors.js.map +1 -0
- package/dist/ui/server/chunks/shared.js +85 -0
- package/dist/ui/server/chunks/shared.js.map +1 -0
- package/dist/ui/server/chunks/src.js +1217 -0
- package/dist/ui/server/chunks/src.js.map +1 -0
- package/dist/ui/server/chunks/state.js +38 -0
- package/dist/ui/server/chunks/state.js.map +1 -0
- package/dist/ui/server/chunks/static-html.js +38 -0
- package/dist/ui/server/chunks/static-html.js.map +1 -0
- package/dist/ui/server/chunks/text-button.js +307 -0
- package/dist/ui/server/chunks/text-button.js.map +1 -0
- package/dist/ui/server/entries/endpoints/api/config/_server.ts.js +19 -0
- package/dist/ui/server/entries/endpoints/api/config/_server.ts.js.map +1 -0
- package/dist/ui/server/entries/endpoints/api/input/keys/_server.ts.js +14 -0
- package/dist/ui/server/entries/endpoints/api/input/keys/_server.ts.js.map +1 -0
- package/dist/ui/server/entries/endpoints/api/markers/_server.ts.js +13 -0
- package/dist/ui/server/entries/endpoints/api/markers/_server.ts.js.map +1 -0
- package/dist/ui/server/entries/endpoints/api/sessions/_id_id_/_server.ts.js +12 -0
- package/dist/ui/server/entries/endpoints/api/sessions/_id_id_/_server.ts.js.map +1 -0
- package/dist/ui/server/entries/endpoints/api/sessions/_server.ts.js +13 -0
- package/dist/ui/server/entries/endpoints/api/sessions/_server.ts.js.map +1 -0
- package/dist/ui/server/entries/endpoints/api/sessions/end/_server.ts.js +9 -0
- package/dist/ui/server/entries/endpoints/api/sessions/end/_server.ts.js.map +1 -0
- package/dist/ui/server/entries/endpoints/api/speech/_server.ts.js +25 -0
- package/dist/ui/server/entries/endpoints/api/speech/_server.ts.js.map +1 -0
- package/dist/ui/server/entries/endpoints/api/speech/stream/_server.ts.js +19 -0
- package/dist/ui/server/entries/endpoints/api/speech/stream/_server.ts.js.map +1 -0
- package/dist/ui/server/entries/endpoints/api/status/_server.ts.js +9 -0
- package/dist/ui/server/entries/endpoints/api/status/_server.ts.js.map +1 -0
- package/dist/ui/server/entries/hooks.server.js +161 -0
- package/dist/ui/server/entries/hooks.server.js.map +1 -0
- package/dist/ui/server/entries/pages/_error.svelte.js +16 -0
- package/dist/ui/server/entries/pages/_error.svelte.js.map +1 -0
- package/dist/ui/server/entries/pages/_layout.server.ts.js +17 -0
- package/dist/ui/server/entries/pages/_layout.server.ts.js.map +1 -0
- package/dist/ui/server/entries/pages/_layout.svelte.js +175 -0
- package/dist/ui/server/entries/pages/_layout.svelte.js.map +1 -0
- package/dist/ui/server/entries/pages/_page.server.ts.js +18 -0
- package/dist/ui/server/entries/pages/_page.server.ts.js.map +1 -0
- package/dist/ui/server/entries/pages/_page.svelte.js +444 -0
- package/dist/ui/server/entries/pages/_page.svelte.js.map +1 -0
- package/dist/ui/server/entries/pages/settings/_page.server.ts.js +12 -0
- package/dist/ui/server/entries/pages/settings/_page.server.ts.js.map +1 -0
- package/dist/ui/server/entries/pages/settings/_page.svelte.js +3531 -0
- package/dist/ui/server/entries/pages/settings/_page.svelte.js.map +1 -0
- package/dist/ui/server/entries/pages/setup/_layout.svelte.js +51 -0
- package/dist/ui/server/entries/pages/setup/_layout.svelte.js.map +1 -0
- package/dist/ui/server/entries/pages/setup/_page.svelte.js +230 -0
- package/dist/ui/server/entries/pages/setup/_page.svelte.js.map +1 -0
- package/dist/ui/server/entries/pages/setup/instructions/_page.server.ts.js +12 -0
- package/dist/ui/server/entries/pages/setup/instructions/_page.server.ts.js.map +1 -0
- package/dist/ui/server/entries/pages/setup/instructions/_page.svelte.js +271 -0
- package/dist/ui/server/entries/pages/setup/instructions/_page.svelte.js.map +1 -0
- package/dist/ui/server/entries/params.js +60 -0
- package/dist/ui/server/entries/params.js.map +1 -0
- package/dist/ui/server/env.js +1 -0
- package/dist/ui/server/handler.js +1 -0
- package/dist/ui/server/index.js +67 -0
- package/dist/ui/server/index.js.map +1 -0
- package/dist/ui/server/manifest-full.js +126 -0
- package/dist/ui/server/manifest.js +126 -0
- package/dist/ui/server/nodes/0.js +10 -0
- package/dist/ui/server/nodes/1.js +8 -0
- package/dist/ui/server/nodes/2.js +8 -0
- package/dist/ui/server/nodes/3.js +10 -0
- package/dist/ui/server/nodes/4.js +10 -0
- package/dist/ui/server/nodes/5.js +8 -0
- package/dist/ui/server/nodes/6.js +10 -0
- package/dist/ui/server/remote-entry.js +1 -0
- package/dist/ui/server/server.js +128 -0
- package/package.json +39 -3
|
@@ -0,0 +1,1960 @@
|
|
|
1
|
+
// ../../node_modules/.pnpm/svelte@5.59.2_@typescript-eslint+types@8.74.0/node_modules/svelte/src/constants.js
|
|
2
|
+
var UNINITIALIZED = Symbol("uninitialized");
|
|
3
|
+
// ../../node_modules/.pnpm/svelte@5.59.2_@typescript-eslint+types@8.74.0/node_modules/svelte/src/escaping.js
|
|
4
|
+
var ATTR_REGEX = /[&"<]/g;
|
|
5
|
+
var CONTENT_REGEX = /[&<]/g;
|
|
6
|
+
/**
|
|
7
|
+
* @template V
|
|
8
|
+
* @param {V} value
|
|
9
|
+
* @param {boolean} [is_attr]
|
|
10
|
+
*/
|
|
11
|
+
function escape_html(value, is_attr) {
|
|
12
|
+
const str = String(value ?? "");
|
|
13
|
+
const pattern = is_attr ? ATTR_REGEX : CONTENT_REGEX;
|
|
14
|
+
pattern.lastIndex = 0;
|
|
15
|
+
let escaped = "";
|
|
16
|
+
let last = 0;
|
|
17
|
+
while (pattern.test(str)) {
|
|
18
|
+
const i = pattern.lastIndex - 1;
|
|
19
|
+
const ch = str[i];
|
|
20
|
+
escaped += str.substring(last, i) + (ch === "&" ? "&" : ch === "\"" ? """ : "<");
|
|
21
|
+
last = i + 1;
|
|
22
|
+
}
|
|
23
|
+
return escaped + str.substring(last);
|
|
24
|
+
}
|
|
25
|
+
// ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
26
|
+
function r(e) {
|
|
27
|
+
var t, f, n = "";
|
|
28
|
+
if ("string" == typeof e || "number" == typeof e) n += e;
|
|
29
|
+
else if ("object" == typeof e) if (Array.isArray(e)) {
|
|
30
|
+
var o = e.length;
|
|
31
|
+
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
32
|
+
} else for (f in e) e[f] && (n && (n += " "), n += f);
|
|
33
|
+
return n;
|
|
34
|
+
}
|
|
35
|
+
function clsx$1() {
|
|
36
|
+
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
37
|
+
return n;
|
|
38
|
+
}
|
|
39
|
+
// ../../node_modules/.pnpm/svelte@5.59.2_@typescript-eslint+types@8.74.0/node_modules/svelte/src/internal/shared/utils.js
|
|
40
|
+
var is_array = Array.isArray;
|
|
41
|
+
Array.prototype.indexOf;
|
|
42
|
+
Array.prototype.includes;
|
|
43
|
+
Array.from;
|
|
44
|
+
Array.prototype;
|
|
45
|
+
var has_own_property = Object.prototype.hasOwnProperty;
|
|
46
|
+
var noop = () => {};
|
|
47
|
+
/** @param {Function} fn */
|
|
48
|
+
function run(fn) {
|
|
49
|
+
return fn();
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* `array.push(...items)` overflows the stack for large `items`.
|
|
53
|
+
* @template T
|
|
54
|
+
* @param {T[]} array
|
|
55
|
+
* @param {T[]} items
|
|
56
|
+
*/
|
|
57
|
+
function push_array(array, items) {
|
|
58
|
+
for (var i = 0; i < items.length; i++) array.push(items[i]);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* TODO replace with Promise.withResolvers once supported widely enough
|
|
62
|
+
* @template [T=void]
|
|
63
|
+
*/
|
|
64
|
+
function deferred() {
|
|
65
|
+
/** @type {(value: T) => void} */
|
|
66
|
+
var resolve;
|
|
67
|
+
/** @type {(reason: any) => void} */
|
|
68
|
+
var reject;
|
|
69
|
+
return {
|
|
70
|
+
promise: new Promise((res, rej) => {
|
|
71
|
+
resolve = res;
|
|
72
|
+
reject = rej;
|
|
73
|
+
}),
|
|
74
|
+
resolve,
|
|
75
|
+
reject
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
// ../../node_modules/.pnpm/svelte@5.59.2_@typescript-eslint+types@8.74.0/node_modules/svelte/src/internal/shared/attributes.js
|
|
79
|
+
/**
|
|
80
|
+
* `<div translate={false}>` should be rendered as `<div translate="no">` and _not_
|
|
81
|
+
* `<div translate="false">`, which is equivalent to `<div translate="yes">`. There
|
|
82
|
+
* may be other odd cases that need to be added to this list in future
|
|
83
|
+
* @type {Record<string, Map<any, string>>}
|
|
84
|
+
*/
|
|
85
|
+
var replacements = { translate: /* @__PURE__ */ new Map([[true, "yes"], [false, "no"]]) };
|
|
86
|
+
/**
|
|
87
|
+
* @template V
|
|
88
|
+
* @param {string} name
|
|
89
|
+
* @param {V} value
|
|
90
|
+
* @param {boolean} [is_boolean]
|
|
91
|
+
* @returns {string}
|
|
92
|
+
*/
|
|
93
|
+
function attr(name, value, is_boolean = false) {
|
|
94
|
+
if (name === "hidden" && value !== "until-found") is_boolean = true;
|
|
95
|
+
if (value == null || is_boolean && !value && value !== "") return "";
|
|
96
|
+
const normalized = has_own_property.call(replacements, name) && replacements[name].get(value) || value;
|
|
97
|
+
return ` ${name}${is_boolean ? `=""` : `="${escape_html(normalized, true)}"`}`;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Small wrapper around clsx to preserve Svelte's (weird) handling of falsy values.
|
|
101
|
+
* TODO Svelte 6 revisit this, and likely turn all falsy values into the empty string (what clsx also does)
|
|
102
|
+
* @param {any} value
|
|
103
|
+
*/
|
|
104
|
+
function clsx(value) {
|
|
105
|
+
if (typeof value === "object") return clsx$1(value);
|
|
106
|
+
else return value ?? "";
|
|
107
|
+
}
|
|
108
|
+
var whitespace = [..." \n\r\f\xA0\v"];
|
|
109
|
+
/**
|
|
110
|
+
* @param {any} value
|
|
111
|
+
* @param {string | null} [hash]
|
|
112
|
+
* @param {Record<string, boolean>} [directives]
|
|
113
|
+
* @returns {string | null}
|
|
114
|
+
*/
|
|
115
|
+
function to_class(value, hash, directives) {
|
|
116
|
+
var classname = value == null ? "" : "" + value;
|
|
117
|
+
if (hash) classname = classname ? classname + " " + hash : hash;
|
|
118
|
+
if (directives) {
|
|
119
|
+
for (var key of Object.keys(directives)) if (directives[key]) classname = classname ? classname + " " + key : key;
|
|
120
|
+
else if (classname.length) {
|
|
121
|
+
var len = key.length;
|
|
122
|
+
var a = 0;
|
|
123
|
+
while ((a = classname.indexOf(key, a)) >= 0) {
|
|
124
|
+
var b = a + len;
|
|
125
|
+
if ((a === 0 || whitespace.includes(classname[a - 1])) && (b === classname.length || whitespace.includes(classname[b]))) classname = (a === 0 ? "" : classname.substring(0, a)) + classname.substring(b + 1);
|
|
126
|
+
else a = b;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return classname === "" ? null : classname;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
*
|
|
134
|
+
* @param {Record<string,any>} styles
|
|
135
|
+
* @param {boolean} important
|
|
136
|
+
*/
|
|
137
|
+
function append_styles(styles, important = false) {
|
|
138
|
+
var separator = important ? " !important;" : ";";
|
|
139
|
+
var css = "";
|
|
140
|
+
for (var key of Object.keys(styles)) {
|
|
141
|
+
var value = styles[key];
|
|
142
|
+
if (value != null && value !== "") css += " " + key + ": " + value + separator;
|
|
143
|
+
}
|
|
144
|
+
return css;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* @param {string} name
|
|
148
|
+
* @returns {string}
|
|
149
|
+
*/
|
|
150
|
+
function to_css_name(name) {
|
|
151
|
+
if (name[0] !== "-" || name[1] !== "-") return name.toLowerCase();
|
|
152
|
+
return name;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* @param {any} value
|
|
156
|
+
* @param {Record<string, any> | [Record<string, any>, Record<string, any>]} [styles]
|
|
157
|
+
* @returns {string | null}
|
|
158
|
+
*/
|
|
159
|
+
function to_style(value, styles) {
|
|
160
|
+
if (styles) {
|
|
161
|
+
var new_style = "";
|
|
162
|
+
/** @type {Record<string,any> | undefined} */
|
|
163
|
+
var normal_styles;
|
|
164
|
+
/** @type {Record<string,any> | undefined} */
|
|
165
|
+
var important_styles;
|
|
166
|
+
if (Array.isArray(styles)) {
|
|
167
|
+
normal_styles = styles[0];
|
|
168
|
+
important_styles = styles[1];
|
|
169
|
+
} else normal_styles = styles;
|
|
170
|
+
if (value) {
|
|
171
|
+
value = String(value).replaceAll(/\/\*.*?\*\//g, "").trim();
|
|
172
|
+
/** @type {boolean | '"' | "'"} */
|
|
173
|
+
var in_str = false;
|
|
174
|
+
var in_apo = 0;
|
|
175
|
+
var in_comment = false;
|
|
176
|
+
var reserved_names = [];
|
|
177
|
+
if (normal_styles) reserved_names.push(...Object.keys(normal_styles).map(to_css_name));
|
|
178
|
+
if (important_styles) reserved_names.push(...Object.keys(important_styles).map(to_css_name));
|
|
179
|
+
var start_index = 0;
|
|
180
|
+
var name_index = -1;
|
|
181
|
+
const len = value.length;
|
|
182
|
+
for (var i = 0; i < len; i++) {
|
|
183
|
+
var c = value[i];
|
|
184
|
+
if (in_comment) {
|
|
185
|
+
if (c === "/" && value[i - 1] === "*") in_comment = false;
|
|
186
|
+
} else if (in_str) {
|
|
187
|
+
if (in_str === c) in_str = false;
|
|
188
|
+
} else if (c === "/" && value[i + 1] === "*") in_comment = true;
|
|
189
|
+
else if (c === "\"" || c === "'") in_str = c;
|
|
190
|
+
else if (c === "(") in_apo++;
|
|
191
|
+
else if (c === ")") in_apo--;
|
|
192
|
+
if (!in_comment && in_str === false && in_apo === 0) {
|
|
193
|
+
if (c === ":" && name_index === -1) name_index = i;
|
|
194
|
+
else if (c === ";" || i === len - 1) {
|
|
195
|
+
if (name_index !== -1) {
|
|
196
|
+
var name = to_css_name(value.substring(start_index, name_index).trim());
|
|
197
|
+
if (!reserved_names.includes(name)) {
|
|
198
|
+
if (c !== ";") i++;
|
|
199
|
+
var property = value.substring(start_index, i).trim();
|
|
200
|
+
new_style += " " + property + ";";
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
start_index = i + 1;
|
|
204
|
+
name_index = -1;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
if (normal_styles) new_style += append_styles(normal_styles);
|
|
210
|
+
if (important_styles) new_style += append_styles(important_styles, true);
|
|
211
|
+
new_style = new_style.trim();
|
|
212
|
+
return new_style === "" ? null : new_style;
|
|
213
|
+
}
|
|
214
|
+
return value == null ? null : String(value);
|
|
215
|
+
}
|
|
216
|
+
// ../../node_modules/.pnpm/svelte@5.59.2_@typescript-eslint+types@8.74.0/node_modules/svelte/src/internal/client/constants.js
|
|
217
|
+
/** allow users to ignore aborted signal errors if `reason.name === 'StaleReactionError` */
|
|
218
|
+
var STALE_REACTION = new class StaleReactionError extends Error {
|
|
219
|
+
name = "StaleReactionError";
|
|
220
|
+
message = "The reaction that called `getAbortSignal()` was re-run or destroyed";
|
|
221
|
+
}();
|
|
222
|
+
globalThis.document?.contentType;
|
|
223
|
+
// ../../node_modules/.pnpm/svelte@5.59.2_@typescript-eslint+types@8.74.0/node_modules/svelte/src/internal/shared/errors.js
|
|
224
|
+
/**
|
|
225
|
+
* `%name%(...)` can only be used during component initialisation
|
|
226
|
+
* @param {string} name
|
|
227
|
+
* @returns {never}
|
|
228
|
+
*/
|
|
229
|
+
function lifecycle_outside_component(name) {
|
|
230
|
+
throw new Error(`https://svelte.dev/e/lifecycle_outside_component`);
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* `setContext` must be called when a component first initializes, not in a subsequent effect or after an `await` expression
|
|
234
|
+
* @returns {never}
|
|
235
|
+
*/
|
|
236
|
+
function set_context_after_init() {
|
|
237
|
+
throw new Error(`https://svelte.dev/e/set_context_after_init`);
|
|
238
|
+
}
|
|
239
|
+
// ../../node_modules/.pnpm/svelte@5.59.2_@typescript-eslint+types@8.74.0/node_modules/svelte/src/internal/shared/context.js
|
|
240
|
+
/**
|
|
241
|
+
* @typedef {{ p: Context | null, c: Map<unknown, unknown> | null }} Context
|
|
242
|
+
*/
|
|
243
|
+
/**
|
|
244
|
+
* @param {Context} context
|
|
245
|
+
* @returns {Map<unknown, unknown> | null}
|
|
246
|
+
*/
|
|
247
|
+
function get_parent_context(context) {
|
|
248
|
+
let parent = context.p;
|
|
249
|
+
while (parent !== null && parent.c === null) parent = parent.p;
|
|
250
|
+
return parent?.c ?? null;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* @param {Context | null} context
|
|
254
|
+
* @param {string} name
|
|
255
|
+
* @returns {Map<unknown, unknown>}
|
|
256
|
+
*/
|
|
257
|
+
function get_or_init_context_map(context, name) {
|
|
258
|
+
if (context === null) lifecycle_outside_component(name);
|
|
259
|
+
return context.c ??= new Map(get_parent_context(context) || void 0);
|
|
260
|
+
}
|
|
261
|
+
// ../../node_modules/.pnpm/svelte@5.59.2_@typescript-eslint+types@8.74.0/node_modules/svelte/src/internal/server/hydration.js
|
|
262
|
+
var BLOCK_OPEN = `<!--[-->`;
|
|
263
|
+
var BLOCK_CLOSE = `<!--]-->`;
|
|
264
|
+
var EMPTY_COMMENT = `<!---->`;
|
|
265
|
+
// ../../node_modules/.pnpm/svelte@5.59.2_@typescript-eslint+types@8.74.0/node_modules/svelte/src/utils.js
|
|
266
|
+
/**
|
|
267
|
+
* Attributes that are boolean, i.e. they are present or not present.
|
|
268
|
+
*/
|
|
269
|
+
var DOM_BOOLEAN_ATTRIBUTES = [
|
|
270
|
+
"allowfullscreen",
|
|
271
|
+
"async",
|
|
272
|
+
"autofocus",
|
|
273
|
+
"autoplay",
|
|
274
|
+
"checked",
|
|
275
|
+
"controls",
|
|
276
|
+
"default",
|
|
277
|
+
"disabled",
|
|
278
|
+
"formnovalidate",
|
|
279
|
+
"indeterminate",
|
|
280
|
+
"inert",
|
|
281
|
+
"ismap",
|
|
282
|
+
"loop",
|
|
283
|
+
"multiple",
|
|
284
|
+
"muted",
|
|
285
|
+
"nomodule",
|
|
286
|
+
"novalidate",
|
|
287
|
+
"open",
|
|
288
|
+
"playsinline",
|
|
289
|
+
"readonly",
|
|
290
|
+
"required",
|
|
291
|
+
"reversed",
|
|
292
|
+
"seamless",
|
|
293
|
+
"selected",
|
|
294
|
+
"webkitdirectory",
|
|
295
|
+
"defer",
|
|
296
|
+
"disablepictureinpicture",
|
|
297
|
+
"disableremoteplayback"
|
|
298
|
+
];
|
|
299
|
+
/**
|
|
300
|
+
* Returns `true` if `name` is a boolean attribute
|
|
301
|
+
* @param {string} name
|
|
302
|
+
*/
|
|
303
|
+
function is_boolean_attribute(name) {
|
|
304
|
+
return DOM_BOOLEAN_ATTRIBUTES.includes(name);
|
|
305
|
+
}
|
|
306
|
+
[...DOM_BOOLEAN_ATTRIBUTES];
|
|
307
|
+
// ../../node_modules/.pnpm/svelte@5.59.2_@typescript-eslint+types@8.74.0/node_modules/svelte/src/internal/server/errors.js
|
|
308
|
+
/**
|
|
309
|
+
* The node API `AsyncLocalStorage` is not available, but is required to use async server rendering.
|
|
310
|
+
* @returns {never}
|
|
311
|
+
*/
|
|
312
|
+
function async_local_storage_unavailable() {
|
|
313
|
+
const error = /* @__PURE__ */ new Error(`async_local_storage_unavailable\nThe node API \`AsyncLocalStorage\` is not available, but is required to use async server rendering.\nhttps://svelte.dev/e/async_local_storage_unavailable`);
|
|
314
|
+
error.name = "Svelte error";
|
|
315
|
+
throw error;
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Encountered asynchronous work while rendering synchronously.
|
|
319
|
+
* @returns {never}
|
|
320
|
+
*/
|
|
321
|
+
function await_invalid() {
|
|
322
|
+
const error = /* @__PURE__ */ new Error(`await_invalid\nEncountered asynchronous work while rendering synchronously.\nhttps://svelte.dev/e/await_invalid`);
|
|
323
|
+
error.name = "Svelte error";
|
|
324
|
+
throw error;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* `csp.nonce` was set while `csp.hash` was `true`. These options cannot be used simultaneously.
|
|
328
|
+
* @returns {never}
|
|
329
|
+
*/
|
|
330
|
+
function invalid_csp() {
|
|
331
|
+
const error = /* @__PURE__ */ new Error(`invalid_csp\n\`csp.nonce\` was set while \`csp.hash\` was \`true\`. These options cannot be used simultaneously.\nhttps://svelte.dev/e/invalid_csp`);
|
|
332
|
+
error.name = "Svelte error";
|
|
333
|
+
throw error;
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* The `idPrefix` option cannot include `--`.
|
|
337
|
+
* @returns {never}
|
|
338
|
+
*/
|
|
339
|
+
function invalid_id_prefix() {
|
|
340
|
+
const error = /* @__PURE__ */ new Error(`invalid_id_prefix\nThe \`idPrefix\` option cannot include \`--\`.\nhttps://svelte.dev/e/invalid_id_prefix`);
|
|
341
|
+
error.name = "Svelte error";
|
|
342
|
+
throw error;
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Could not resolve `render` context.
|
|
346
|
+
* @returns {never}
|
|
347
|
+
*/
|
|
348
|
+
function server_context_required() {
|
|
349
|
+
const error = /* @__PURE__ */ new Error(`server_context_required\nCould not resolve \`render\` context.\nhttps://svelte.dev/e/server_context_required`);
|
|
350
|
+
error.name = "Svelte error";
|
|
351
|
+
throw error;
|
|
352
|
+
}
|
|
353
|
+
// ../../node_modules/.pnpm/svelte@5.59.2_@typescript-eslint+types@8.74.0/node_modules/svelte/src/internal/server/context.js
|
|
354
|
+
/** @import { SSRContext } from '#server' */
|
|
355
|
+
/** @type {SSRContext | null} */
|
|
356
|
+
var ssr_context = null;
|
|
357
|
+
/** @param {SSRContext | null} v */
|
|
358
|
+
function set_ssr_context(v) {
|
|
359
|
+
ssr_context = v;
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* @template T
|
|
363
|
+
* @param {any} key
|
|
364
|
+
* @returns {T}
|
|
365
|
+
*/
|
|
366
|
+
function getContext(key) {
|
|
367
|
+
return get_or_init_context_map(ssr_context, "getContext").get(key);
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* @template T
|
|
371
|
+
* @param {any} key
|
|
372
|
+
* @param {T} context
|
|
373
|
+
* @returns {T}
|
|
374
|
+
*/
|
|
375
|
+
function setContext(key, context) {
|
|
376
|
+
const context_map = get_or_init_context_map(ssr_context, "setContext");
|
|
377
|
+
if (ssr_context.i) set_context_after_init();
|
|
378
|
+
context_map.set(key, context);
|
|
379
|
+
return context;
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* @param {Function} [fn]
|
|
383
|
+
*/
|
|
384
|
+
function push(fn) {
|
|
385
|
+
ssr_context = {
|
|
386
|
+
p: ssr_context,
|
|
387
|
+
c: null,
|
|
388
|
+
r: null,
|
|
389
|
+
i: false
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
function pop() {
|
|
393
|
+
ssr_context = ssr_context.p;
|
|
394
|
+
}
|
|
395
|
+
// ../../node_modules/.pnpm/svelte@5.59.2_@typescript-eslint+types@8.74.0/node_modules/svelte/src/internal/server/warnings.js
|
|
396
|
+
/**
|
|
397
|
+
* A `hydratable` value with key `%key%` was created, but at least part of it was not used during the render.
|
|
398
|
+
*
|
|
399
|
+
* The `hydratable` was initialized in:
|
|
400
|
+
* %stack%
|
|
401
|
+
* @param {string} key
|
|
402
|
+
* @param {string} stack
|
|
403
|
+
*/
|
|
404
|
+
function unresolved_hydratable(key, stack) {
|
|
405
|
+
console.warn(`https://svelte.dev/e/unresolved_hydratable`);
|
|
406
|
+
}
|
|
407
|
+
// ../../node_modules/.pnpm/svelte@5.59.2_@typescript-eslint+types@8.74.0/node_modules/svelte/src/internal/server/render-context.js
|
|
408
|
+
/** @import { AsyncLocalStorage } from 'node:async_hooks' */
|
|
409
|
+
/** @import { RenderContext } from '#server' */
|
|
410
|
+
/** @type {Promise<void> | null} */
|
|
411
|
+
var current_render = null;
|
|
412
|
+
/** @type {RenderContext | null} */
|
|
413
|
+
var context = null;
|
|
414
|
+
/** @returns {RenderContext} */
|
|
415
|
+
function get_render_context() {
|
|
416
|
+
const store = context ?? als?.getStore();
|
|
417
|
+
if (!store) server_context_required();
|
|
418
|
+
return store;
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* @template T
|
|
422
|
+
* @param {() => Promise<T>} fn
|
|
423
|
+
* @returns {Promise<T>}
|
|
424
|
+
*/
|
|
425
|
+
async function with_render_context(fn) {
|
|
426
|
+
context = { hydratable: {
|
|
427
|
+
lookup: /* @__PURE__ */ new Map(),
|
|
428
|
+
comparisons: [],
|
|
429
|
+
unresolved_promises: /* @__PURE__ */ new Map()
|
|
430
|
+
} };
|
|
431
|
+
if (in_webcontainer()) {
|
|
432
|
+
const { promise, resolve } = deferred();
|
|
433
|
+
const previous_render = current_render;
|
|
434
|
+
current_render = promise;
|
|
435
|
+
await previous_render;
|
|
436
|
+
return fn().finally(resolve);
|
|
437
|
+
}
|
|
438
|
+
try {
|
|
439
|
+
if (als === null) async_local_storage_unavailable();
|
|
440
|
+
return als.run(context, fn);
|
|
441
|
+
} finally {
|
|
442
|
+
context = null;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
/** @type {AsyncLocalStorage<RenderContext | null> | null} */
|
|
446
|
+
var als = null;
|
|
447
|
+
/** @type {Promise<void> | null} */
|
|
448
|
+
var als_import = null;
|
|
449
|
+
/**
|
|
450
|
+
*
|
|
451
|
+
* @returns {Promise<void>}
|
|
452
|
+
*/
|
|
453
|
+
function init_render_context() {
|
|
454
|
+
als_import ??= import("node:async_hooks").then((hooks) => {
|
|
455
|
+
als = new hooks.AsyncLocalStorage();
|
|
456
|
+
}).then(noop, noop);
|
|
457
|
+
return als_import;
|
|
458
|
+
}
|
|
459
|
+
function in_webcontainer() {
|
|
460
|
+
return !!globalThis.process?.versions?.webcontainer;
|
|
461
|
+
}
|
|
462
|
+
// ../../node_modules/.pnpm/svelte@5.59.2_@typescript-eslint+types@8.74.0/node_modules/svelte/src/internal/server/crypto.js
|
|
463
|
+
var text_encoder;
|
|
464
|
+
var crypto;
|
|
465
|
+
/** @param {string} module_name */
|
|
466
|
+
var obfuscated_import = (module_name) => import(
|
|
467
|
+
/* @vite-ignore */
|
|
468
|
+
module_name
|
|
469
|
+
);
|
|
470
|
+
/** @param {string} data */
|
|
471
|
+
async function sha256(data) {
|
|
472
|
+
text_encoder ??= new TextEncoder();
|
|
473
|
+
crypto ??= globalThis.crypto?.subtle?.digest ? globalThis.crypto : (await obfuscated_import("node:crypto")).webcrypto;
|
|
474
|
+
return base64_encode(await crypto.subtle.digest("SHA-256", text_encoder.encode(data)));
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* @param {Uint8Array} bytes
|
|
478
|
+
* @returns {string}
|
|
479
|
+
*/
|
|
480
|
+
function base64_encode(bytes) {
|
|
481
|
+
if (globalThis.Buffer) return globalThis.Buffer.from(bytes).toString("base64");
|
|
482
|
+
let binary = "";
|
|
483
|
+
for (let i = 0; i < bytes.length; i++) binary += String.fromCharCode(bytes[i]);
|
|
484
|
+
return btoa(binary);
|
|
485
|
+
}
|
|
486
|
+
// ../../node_modules/.pnpm/devalue@6.0.4/node_modules/devalue/src/javascript-source.js
|
|
487
|
+
var SOURCE = Symbol("JavaScriptSource");
|
|
488
|
+
var JavaScriptSource = class JavaScriptSource {
|
|
489
|
+
/**
|
|
490
|
+
* @param {TemplateStringsArray} strings
|
|
491
|
+
* @param {unknown[]} values
|
|
492
|
+
*/
|
|
493
|
+
constructor(strings, values) {
|
|
494
|
+
this.strings = strings;
|
|
495
|
+
this.values = values;
|
|
496
|
+
}
|
|
497
|
+
/**
|
|
498
|
+
* @param {(value: unknown) => string} fn
|
|
499
|
+
*/
|
|
500
|
+
render(fn) {
|
|
501
|
+
const { strings, values } = this;
|
|
502
|
+
let result = strings[0];
|
|
503
|
+
for (let i = 0; i < values.length; i++) {
|
|
504
|
+
const value = values[i];
|
|
505
|
+
result += JavaScriptSource.is_fragment(value) ? JavaScriptSource.from(value).render(fn) : fn(value);
|
|
506
|
+
result += strings[i + 1];
|
|
507
|
+
}
|
|
508
|
+
return result;
|
|
509
|
+
}
|
|
510
|
+
/**
|
|
511
|
+
* @param {(value: unknown) => void} fn
|
|
512
|
+
* @param {Set<string>} reserved
|
|
513
|
+
* @param {Set<readonly string[]>} templates
|
|
514
|
+
*/
|
|
515
|
+
visit(fn, reserved, templates) {
|
|
516
|
+
const { strings, values } = this;
|
|
517
|
+
if (!templates.has(strings)) {
|
|
518
|
+
templates.add(strings);
|
|
519
|
+
for (const string of strings) {
|
|
520
|
+
const decoded = string.replace(/\\u(?:([\da-f]{4})|\{([\da-f]+)\})/gi, (escape, hex, code_point) => {
|
|
521
|
+
const code = parseInt(hex || code_point, 16);
|
|
522
|
+
return code < 128 ? String.fromCharCode(code) : escape;
|
|
523
|
+
});
|
|
524
|
+
for (const name of decoded.match(/[a-zA-Z_$][\w$]*/g) || []) reserved.add(name);
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
for (const value of values) if (JavaScriptSource.is_fragment(value)) JavaScriptSource.from(value).visit(fn, reserved, templates);
|
|
528
|
+
else fn(value);
|
|
529
|
+
}
|
|
530
|
+
/**
|
|
531
|
+
* @param {unknown} value
|
|
532
|
+
* @returns {value is JavaScriptFragment}
|
|
533
|
+
*/
|
|
534
|
+
static is_fragment(value) {
|
|
535
|
+
return typeof value === "object" && value !== null && SOURCE in value;
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* @param {JavaScriptFragment} fragment
|
|
539
|
+
* @returns {JavaScriptSource}
|
|
540
|
+
*/
|
|
541
|
+
static from(fragment) {
|
|
542
|
+
if (!JavaScriptSource.is_fragment(fragment)) throw new TypeError("Invalid JavaScript fragment");
|
|
543
|
+
return fragment[SOURCE];
|
|
544
|
+
}
|
|
545
|
+
};
|
|
546
|
+
/**
|
|
547
|
+
* @param {TemplateStringsArray} strings
|
|
548
|
+
* @param {...unknown} values
|
|
549
|
+
* @returns {JavaScriptFragment}
|
|
550
|
+
*/
|
|
551
|
+
function js(strings, ...values) {
|
|
552
|
+
if (!Array.isArray(strings) || !Array.isArray(strings.raw)) throw new TypeError("`js` must be used as a tagged template, but was called as a regular function");
|
|
553
|
+
return { [SOURCE]: new JavaScriptSource(strings, values) };
|
|
554
|
+
}
|
|
555
|
+
var MAX_ARRAY_INDEX = 2 ** 32 - 1 - 1;
|
|
556
|
+
// ../../node_modules/.pnpm/devalue@6.0.4/node_modules/devalue/src/utils.js
|
|
557
|
+
var name_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$";
|
|
558
|
+
var reserved_names = /^(?: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)$/;
|
|
559
|
+
/** @type {Record<string, string>} */
|
|
560
|
+
var escaped = {
|
|
561
|
+
"<": "\\u003C",
|
|
562
|
+
"\\": "\\\\",
|
|
563
|
+
"\b": "\\b",
|
|
564
|
+
"\f": "\\f",
|
|
565
|
+
"\n": "\\n",
|
|
566
|
+
"\r": "\\r",
|
|
567
|
+
" ": "\\t",
|
|
568
|
+
"\u2028": "\\u2028",
|
|
569
|
+
"\u2029": "\\u2029"
|
|
570
|
+
};
|
|
571
|
+
var DevalueError = class extends Error {
|
|
572
|
+
/**
|
|
573
|
+
* @param {string} message
|
|
574
|
+
* @param {string[]} keys
|
|
575
|
+
* @param {any} [value] - The value that failed to be serialized
|
|
576
|
+
* @param {any} [root] - The root value being serialized
|
|
577
|
+
*/
|
|
578
|
+
constructor(message, keys, value, root) {
|
|
579
|
+
super(message);
|
|
580
|
+
this.name = "DevalueError";
|
|
581
|
+
this.path = keys.join("");
|
|
582
|
+
this.value = value;
|
|
583
|
+
this.root = root;
|
|
584
|
+
}
|
|
585
|
+
};
|
|
586
|
+
/**
|
|
587
|
+
* Marks a Map key on the path being serialized. The key itself is recorded
|
|
588
|
+
* right after the marker, so nothing is formatted or allocated per entry.
|
|
589
|
+
*/
|
|
590
|
+
var MAP_KEY = Symbol();
|
|
591
|
+
/**
|
|
592
|
+
* Formats the path recorded on the way to the value being serialized — a
|
|
593
|
+
* property key, an array index, or `MAP_KEY` followed by a Map key — into
|
|
594
|
+
* the segments a `DevalueError` joins. Only runs when an error is raised.
|
|
595
|
+
* @param {any[]} keys
|
|
596
|
+
* @param {(key: any) => string} format_map_key
|
|
597
|
+
* @returns {string[]}
|
|
598
|
+
*/
|
|
599
|
+
function format_path(keys, format_map_key) {
|
|
600
|
+
/** @type {string[]} */
|
|
601
|
+
const path = [];
|
|
602
|
+
for (let i = 0; i < keys.length; i += 1) {
|
|
603
|
+
const segment = keys[i];
|
|
604
|
+
if (segment === MAP_KEY) path.push(`.get(${format_map_key(keys[++i])})`);
|
|
605
|
+
else if (typeof segment === "number") path.push(`[${segment}]`);
|
|
606
|
+
else path.push(stringify_key(segment));
|
|
607
|
+
}
|
|
608
|
+
return path;
|
|
609
|
+
}
|
|
610
|
+
/** @param {any} thing */
|
|
611
|
+
function is_primitive(thing) {
|
|
612
|
+
return thing === null || typeof thing !== "object" && typeof thing !== "function";
|
|
613
|
+
}
|
|
614
|
+
var object_proto_names = /* @__PURE__ */ Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
|
|
615
|
+
/** @param {any} thing */
|
|
616
|
+
function is_plain_object(thing) {
|
|
617
|
+
const proto = Object.getPrototypeOf(thing);
|
|
618
|
+
return proto === Object.prototype || proto === null || Object.getPrototypeOf(proto) === null || Object.getOwnPropertyNames(proto).sort().join("\0") === object_proto_names;
|
|
619
|
+
}
|
|
620
|
+
/** @param {any} thing */
|
|
621
|
+
function get_type(thing) {
|
|
622
|
+
return Object.prototype.toString.call(thing).slice(8, -1);
|
|
623
|
+
}
|
|
624
|
+
/** @param {any} thing */
|
|
625
|
+
function is_buffer(thing) {
|
|
626
|
+
return typeof Buffer !== "undefined" && Buffer.isBuffer(thing);
|
|
627
|
+
}
|
|
628
|
+
/**
|
|
629
|
+
* Emit an array whose storage is not proportional to its declared length.
|
|
630
|
+
* Touching and deleting the largest valid index forces dictionary elements
|
|
631
|
+
* before setting the length; assigning .length on [] can still eagerly allocate.
|
|
632
|
+
* @param {number} length
|
|
633
|
+
*/
|
|
634
|
+
function stringify_sparse_array(length) {
|
|
635
|
+
return `(function(a){a[${MAX_ARRAY_INDEX}]=0;delete a[${MAX_ARRAY_INDEX}];a.length=${length};return a}([]))`;
|
|
636
|
+
}
|
|
637
|
+
/** Returns the compact JavaScript identifier at `index`. @param {number} index */
|
|
638
|
+
function get_name(index) {
|
|
639
|
+
let name = "";
|
|
640
|
+
do {
|
|
641
|
+
name = name_chars[index % 54] + name;
|
|
642
|
+
index = ~~(index / 54) - 1;
|
|
643
|
+
} while (index >= 0);
|
|
644
|
+
return reserved_names.test(name) ? `${name}0` : name;
|
|
645
|
+
}
|
|
646
|
+
var needs_escape = /["<\\\u0000-\u001f\u2028\u2029]/;
|
|
647
|
+
var surrogate = /[\ud800-\udfff]/;
|
|
648
|
+
/** @type {(str: string) => boolean} */
|
|
649
|
+
var is_well_formed = typeof String.prototype.isWellFormed === "function" ? (str) => str.isWellFormed() : (str) => !surrogate.test(str);
|
|
650
|
+
var json_leaves_raw = /[<\u2028\u2029]/g;
|
|
651
|
+
/** @type {Record<string, string>} */
|
|
652
|
+
var raw_escapes = {
|
|
653
|
+
"<": "\\u003C",
|
|
654
|
+
"\u2028": "\\u2028",
|
|
655
|
+
"\u2029": "\\u2029"
|
|
656
|
+
};
|
|
657
|
+
/** @param {string} char */
|
|
658
|
+
function escape_raw(char) {
|
|
659
|
+
return raw_escapes[char];
|
|
660
|
+
}
|
|
661
|
+
/** @param {string} str */
|
|
662
|
+
function stringify_string(str) {
|
|
663
|
+
if (!needs_escape.test(str) && is_well_formed(str)) return `"${str}"`;
|
|
664
|
+
return JSON.stringify(str).replace(json_leaves_raw, escape_raw);
|
|
665
|
+
}
|
|
666
|
+
/** @param {Record<string | symbol, any>} object */
|
|
667
|
+
function enumerable_symbols(object) {
|
|
668
|
+
const symbols = Object.getOwnPropertySymbols(object);
|
|
669
|
+
return symbols.length === 0 ? symbols : symbols.filter((symbol) => Object.getOwnPropertyDescriptor(object, symbol)?.enumerable);
|
|
670
|
+
}
|
|
671
|
+
var is_identifier = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;
|
|
672
|
+
/** @param {string} key */
|
|
673
|
+
function stringify_key(key) {
|
|
674
|
+
return is_identifier.test(key) ? "." + key : "[" + JSON.stringify(key) + "]";
|
|
675
|
+
}
|
|
676
|
+
/** @param {number} n */
|
|
677
|
+
function is_valid_array_index(n) {
|
|
678
|
+
if (!Number.isInteger(n)) return false;
|
|
679
|
+
if (n < 0) return false;
|
|
680
|
+
if (n > MAX_ARRAY_INDEX) return false;
|
|
681
|
+
return true;
|
|
682
|
+
}
|
|
683
|
+
/** @param {string} s */
|
|
684
|
+
function is_valid_array_index_string(s) {
|
|
685
|
+
if (s.length === 0) return false;
|
|
686
|
+
if (s.length > 1 && s.charCodeAt(0) === 48) return false;
|
|
687
|
+
for (let i = 0; i < s.length; i++) {
|
|
688
|
+
const c = s.charCodeAt(i);
|
|
689
|
+
if (c < 48 || c > 57) return false;
|
|
690
|
+
}
|
|
691
|
+
return is_valid_array_index(+s);
|
|
692
|
+
}
|
|
693
|
+
/**
|
|
694
|
+
* Returns the length of the leading run of valid array indices in `keys`.
|
|
695
|
+
* @param {readonly string[]} keys
|
|
696
|
+
*/
|
|
697
|
+
function array_index_cut(keys) {
|
|
698
|
+
for (var i = keys.length - 1; i >= 0; i--) if (is_valid_array_index_string(keys[i])) break;
|
|
699
|
+
return i + 1;
|
|
700
|
+
}
|
|
701
|
+
/**
|
|
702
|
+
* Finds the populated indices of an array.
|
|
703
|
+
* @param {unknown[]} array
|
|
704
|
+
*/
|
|
705
|
+
function valid_array_indices(array) {
|
|
706
|
+
const keys = Object.keys(array);
|
|
707
|
+
keys.length = array_index_cut(keys);
|
|
708
|
+
return keys;
|
|
709
|
+
}
|
|
710
|
+
// ../../node_modules/.pnpm/devalue@6.0.4/node_modules/devalue/src/uneval.js
|
|
711
|
+
/**
|
|
712
|
+
* @import { UnevalReplacer } from './types.js';
|
|
713
|
+
*/
|
|
714
|
+
var unsafe_chars = /[<\b\f\n\r\t\0\u2028\u2029]/g;
|
|
715
|
+
var MIN_STRING_LENGTH = 128;
|
|
716
|
+
/**
|
|
717
|
+
* Turn a value into the JavaScript that creates an equivalent value
|
|
718
|
+
* @param {any} value
|
|
719
|
+
* @param {UnevalReplacer} [replacer]
|
|
720
|
+
*/
|
|
721
|
+
function uneval(value, replacer) {
|
|
722
|
+
/** @type {Map<any, string>} */
|
|
723
|
+
const names = /* @__PURE__ */ new Map();
|
|
724
|
+
const reserved = /* @__PURE__ */ new Set();
|
|
725
|
+
const templates = /* @__PURE__ */ new Set();
|
|
726
|
+
const seen = /* @__PURE__ */ new Set();
|
|
727
|
+
/** @type {any[]} */
|
|
728
|
+
const keys = [];
|
|
729
|
+
/** @type {Map<any, JavaScriptSource>} */
|
|
730
|
+
const custom = /* @__PURE__ */ new Map();
|
|
731
|
+
/**
|
|
732
|
+
* @param {string} message
|
|
733
|
+
* @param {any} thing
|
|
734
|
+
* @returns {never}
|
|
735
|
+
*/
|
|
736
|
+
function error(message, thing) {
|
|
737
|
+
throw new DevalueError(message, format_path(keys, (key) => is_primitive(key) ? stringify_primitive(key) : "..."), thing, value);
|
|
738
|
+
}
|
|
739
|
+
/** @type {Map<string | bigint, number> | undefined} */
|
|
740
|
+
let primitive_counts;
|
|
741
|
+
/** @type {Map<string | bigint, string> | undefined} */
|
|
742
|
+
let primitives;
|
|
743
|
+
/** @param {any} thing */
|
|
744
|
+
function stringify_cached_primitive(thing) {
|
|
745
|
+
if (typeof thing === "string" && thing.length >= MIN_STRING_LENGTH || typeof thing === "bigint") {
|
|
746
|
+
primitives ??= /* @__PURE__ */ new Map();
|
|
747
|
+
let literal = primitives.get(thing);
|
|
748
|
+
if (literal === void 0) {
|
|
749
|
+
literal = stringify_primitive(thing);
|
|
750
|
+
primitives.set(thing, literal);
|
|
751
|
+
}
|
|
752
|
+
return literal;
|
|
753
|
+
}
|
|
754
|
+
return stringify_primitive(thing);
|
|
755
|
+
}
|
|
756
|
+
/** @param {any} thing */
|
|
757
|
+
function walk(thing) {
|
|
758
|
+
if (!is_primitive(thing)) {
|
|
759
|
+
if (seen.has(thing)) {
|
|
760
|
+
if (!names.has(thing)) names.set(thing, "");
|
|
761
|
+
return;
|
|
762
|
+
}
|
|
763
|
+
seen.add(thing);
|
|
764
|
+
if (replacer) {
|
|
765
|
+
const fragment = replacer(thing, js);
|
|
766
|
+
if (fragment) {
|
|
767
|
+
const source = JavaScriptSource.from(fragment);
|
|
768
|
+
custom.set(thing, source);
|
|
769
|
+
source.visit(walk, reserved, templates);
|
|
770
|
+
return;
|
|
771
|
+
}
|
|
772
|
+
if (fragment !== void 0 && fragment !== null && fragment !== false) throw new TypeError("Invalid uneval replacer result");
|
|
773
|
+
}
|
|
774
|
+
if (typeof thing === "function") error(`Cannot stringify a function`, thing);
|
|
775
|
+
switch (get_type(thing)) {
|
|
776
|
+
case "BigInt":
|
|
777
|
+
case "String":
|
|
778
|
+
walk(thing.valueOf());
|
|
779
|
+
return;
|
|
780
|
+
case "Number":
|
|
781
|
+
case "Boolean":
|
|
782
|
+
case "Date":
|
|
783
|
+
case "RegExp":
|
|
784
|
+
case "URL":
|
|
785
|
+
case "URLSearchParams": return;
|
|
786
|
+
case "Array":
|
|
787
|
+
for (const i of valid_array_indices(thing)) {
|
|
788
|
+
keys.push(+i);
|
|
789
|
+
walk(thing[i]);
|
|
790
|
+
keys.pop();
|
|
791
|
+
}
|
|
792
|
+
break;
|
|
793
|
+
case "Set":
|
|
794
|
+
for (const value of thing) walk(value);
|
|
795
|
+
break;
|
|
796
|
+
case "Map":
|
|
797
|
+
for (const [key, value] of thing) {
|
|
798
|
+
keys.push(MAP_KEY, key);
|
|
799
|
+
walk(key);
|
|
800
|
+
walk(value);
|
|
801
|
+
keys.pop();
|
|
802
|
+
keys.pop();
|
|
803
|
+
}
|
|
804
|
+
break;
|
|
805
|
+
case "Int8Array":
|
|
806
|
+
case "Uint8Array":
|
|
807
|
+
case "Uint8ClampedArray":
|
|
808
|
+
case "Int16Array":
|
|
809
|
+
case "Uint16Array":
|
|
810
|
+
case "Float16Array":
|
|
811
|
+
case "Int32Array":
|
|
812
|
+
case "Uint32Array":
|
|
813
|
+
case "Float32Array":
|
|
814
|
+
case "Float64Array":
|
|
815
|
+
case "BigInt64Array":
|
|
816
|
+
case "BigUint64Array":
|
|
817
|
+
case "DataView":
|
|
818
|
+
if (!is_buffer(thing)) walk(thing.buffer);
|
|
819
|
+
return;
|
|
820
|
+
case "ArrayBuffer": return;
|
|
821
|
+
case "Temporal.Duration":
|
|
822
|
+
case "Temporal.Instant":
|
|
823
|
+
case "Temporal.PlainDate":
|
|
824
|
+
case "Temporal.PlainTime":
|
|
825
|
+
case "Temporal.PlainDateTime":
|
|
826
|
+
case "Temporal.PlainMonthDay":
|
|
827
|
+
case "Temporal.PlainYearMonth":
|
|
828
|
+
case "Temporal.ZonedDateTime": return;
|
|
829
|
+
default:
|
|
830
|
+
if (!is_plain_object(thing)) error(`Cannot stringify arbitrary non-POJOs`, thing);
|
|
831
|
+
if (enumerable_symbols(thing).length > 0) error(`Cannot stringify POJOs with symbolic keys`, thing);
|
|
832
|
+
for (const key of Object.keys(thing)) {
|
|
833
|
+
if (key === "__proto__") error(`Cannot stringify objects with __proto__ keys`, thing);
|
|
834
|
+
keys.push(key);
|
|
835
|
+
walk(thing[key]);
|
|
836
|
+
keys.pop();
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
} else if (typeof thing === "symbol") error(`Cannot stringify a Symbol primitive`, thing);
|
|
840
|
+
else if (typeof thing === "string" && thing.length >= MIN_STRING_LENGTH || typeof thing === "bigint") {
|
|
841
|
+
primitive_counts ??= /* @__PURE__ */ new Map();
|
|
842
|
+
primitive_counts.set(thing, (primitive_counts.get(thing) || 0) + 1);
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
walk(value);
|
|
846
|
+
let name_index = 0;
|
|
847
|
+
function next_name() {
|
|
848
|
+
let name;
|
|
849
|
+
do
|
|
850
|
+
name = get_name(name_index++);
|
|
851
|
+
while (reserved.has(name));
|
|
852
|
+
return name;
|
|
853
|
+
}
|
|
854
|
+
for (const thing of names.keys()) names.set(thing, next_name());
|
|
855
|
+
if (primitive_counts) for (const [thing, count] of primitive_counts) {
|
|
856
|
+
if (count < 2) continue;
|
|
857
|
+
const name = next_name();
|
|
858
|
+
const length = stringify_cached_primitive(thing).length;
|
|
859
|
+
if (length * count > length + (count + 1) * name.length + 40) names.set(thing, name);
|
|
860
|
+
}
|
|
861
|
+
seen.clear();
|
|
862
|
+
const inlining = custom.size > 0 ? /* @__PURE__ */ new Set() : null;
|
|
863
|
+
/** @type {Map<any, () => void>} */
|
|
864
|
+
const initializers = /* @__PURE__ */ new Map();
|
|
865
|
+
/** @type {string[]} */
|
|
866
|
+
const statements = [];
|
|
867
|
+
/**
|
|
868
|
+
* @param {any} thing
|
|
869
|
+
* @returns {string}
|
|
870
|
+
*/
|
|
871
|
+
function stringify(thing) {
|
|
872
|
+
const name = names.get(thing);
|
|
873
|
+
if (name) {
|
|
874
|
+
if (!seen.has(thing)) {
|
|
875
|
+
if (is_primitive(thing)) {
|
|
876
|
+
seen.add(thing);
|
|
877
|
+
statements.push(`let ${name}=${stringify_cached_primitive(thing)}`);
|
|
878
|
+
return name;
|
|
879
|
+
}
|
|
880
|
+
const type = custom.has(thing) ? null : get_type(thing);
|
|
881
|
+
switch (type) {
|
|
882
|
+
case "Object":
|
|
883
|
+
seen.add(thing);
|
|
884
|
+
statements.push(`let ${name}=${Object.getPrototypeOf(thing) === null ? "Object.create(null)" : "{}"}`);
|
|
885
|
+
Object.keys(thing).forEach((key) => {
|
|
886
|
+
statements.push(`${name}${safe_prop(key)}=${stringify(thing[key])}`);
|
|
887
|
+
});
|
|
888
|
+
break;
|
|
889
|
+
case "Array": {
|
|
890
|
+
seen.add(thing);
|
|
891
|
+
const indices = valid_array_indices(thing);
|
|
892
|
+
const array = thing.length > 32 + 2 * indices.length ? stringify_sparse_array(thing.length) : `Array(${thing.length})`;
|
|
893
|
+
statements.push(`let ${name}=${array}`);
|
|
894
|
+
for (const i of indices) statements.push(`${name}[${i}]=${stringify(thing[i])}`);
|
|
895
|
+
break;
|
|
896
|
+
}
|
|
897
|
+
case "Set":
|
|
898
|
+
case "Map": {
|
|
899
|
+
seen.add(thing);
|
|
900
|
+
/** @type {string[]} */
|
|
901
|
+
const entries = [];
|
|
902
|
+
let initialized = false;
|
|
903
|
+
let statement_index = -1;
|
|
904
|
+
const initialize = () => {
|
|
905
|
+
if (initialized) return;
|
|
906
|
+
initialized = true;
|
|
907
|
+
initializers.delete(thing);
|
|
908
|
+
statements.push(`let ${name}=new ${type}${entries.length ? `([${entries.join(",")}])` : ""}`);
|
|
909
|
+
};
|
|
910
|
+
initializers.set(thing, initialize);
|
|
911
|
+
for (const entry of thing) {
|
|
912
|
+
const args = type === "Map" ? `${stringify(entry[0])},${stringify(entry[1])}` : stringify(entry);
|
|
913
|
+
if (!initialized) entries.push(type === "Map" ? `[${args}]` : args);
|
|
914
|
+
else {
|
|
915
|
+
const call = `.${type === "Map" ? "set" : "add"}(${args})`;
|
|
916
|
+
if (statement_index === statements.length - 1) statements[statement_index] += call;
|
|
917
|
+
else statement_index = statements.push(name + call) - 1;
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
initialize();
|
|
921
|
+
break;
|
|
922
|
+
}
|
|
923
|
+
default:
|
|
924
|
+
const str = actually_stringify(thing);
|
|
925
|
+
if (!seen.has(thing)) statements.push(`let ${name}=${str}`);
|
|
926
|
+
seen.add(thing);
|
|
927
|
+
}
|
|
928
|
+
} else initializers.get(thing)?.();
|
|
929
|
+
return name;
|
|
930
|
+
}
|
|
931
|
+
if (is_primitive(thing)) return stringify_cached_primitive(thing);
|
|
932
|
+
if (inlining === null) return actually_stringify(thing);
|
|
933
|
+
if (inlining.has(thing)) {
|
|
934
|
+
names.set(thing, next_name());
|
|
935
|
+
return stringify(thing);
|
|
936
|
+
}
|
|
937
|
+
inlining.add(thing);
|
|
938
|
+
const str = actually_stringify(thing);
|
|
939
|
+
inlining.delete(thing);
|
|
940
|
+
return names.get(thing) || str;
|
|
941
|
+
}
|
|
942
|
+
/**
|
|
943
|
+
* @param {any} thing
|
|
944
|
+
* @returns {string}
|
|
945
|
+
*/
|
|
946
|
+
function actually_stringify(thing) {
|
|
947
|
+
const source = custom.get(thing);
|
|
948
|
+
if (source) return source.render(stringify);
|
|
949
|
+
const type = get_type(thing);
|
|
950
|
+
switch (type) {
|
|
951
|
+
case "Number":
|
|
952
|
+
case "String":
|
|
953
|
+
case "Boolean":
|
|
954
|
+
case "BigInt": return `Object(${stringify(thing.valueOf())})`;
|
|
955
|
+
case "RegExp":
|
|
956
|
+
const { source, flags } = thing;
|
|
957
|
+
return flags ? `new RegExp(${stringify_string(source)},"${flags}")` : `new RegExp(${stringify_string(source)})`;
|
|
958
|
+
case "Date": return `new Date(${thing.getTime()})`;
|
|
959
|
+
case "URL": return `new URL(${stringify_string(thing.toString())})`;
|
|
960
|
+
case "URLSearchParams": return `new URLSearchParams(${stringify_string(thing.toString())})`;
|
|
961
|
+
case "Array": {
|
|
962
|
+
let has_holes = false;
|
|
963
|
+
let result = "[";
|
|
964
|
+
for (let i = 0; i < thing.length; i += 1) {
|
|
965
|
+
if (i > 0) result += ",";
|
|
966
|
+
if (Object.hasOwn(thing, i)) result += stringify(thing[i]);
|
|
967
|
+
else if (!has_holes) {
|
|
968
|
+
const populated_keys = valid_array_indices(thing);
|
|
969
|
+
const population = populated_keys.length;
|
|
970
|
+
const d = String(thing.length).length;
|
|
971
|
+
const array = stringify_sparse_array(thing.length);
|
|
972
|
+
if (thing.length + 2 > array.length + 18 + population * (d + 2)) return `Object.assign(${array},{${populated_keys.map((k) => `${k}:${stringify(thing[k])}`).join(",")}})`;
|
|
973
|
+
has_holes = true;
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
const tail = thing.length === 0 || Object.hasOwn(thing, thing.length - 1) ? "" : ",";
|
|
977
|
+
return result + tail + "]";
|
|
978
|
+
}
|
|
979
|
+
case "Set": return `new Set([${Array.from(thing, stringify).join(",")}])`;
|
|
980
|
+
case "Map": return `new Map([${Array.from(thing, ([k, v]) => `[${stringify(k)},${stringify(v)}]`).join(",")}])`;
|
|
981
|
+
case "Int8Array":
|
|
982
|
+
case "Uint8Array":
|
|
983
|
+
case "Uint8ClampedArray":
|
|
984
|
+
case "Int16Array":
|
|
985
|
+
case "Uint16Array":
|
|
986
|
+
case "Float16Array":
|
|
987
|
+
case "Int32Array":
|
|
988
|
+
case "Uint32Array":
|
|
989
|
+
case "Float32Array":
|
|
990
|
+
case "Float64Array":
|
|
991
|
+
case "BigInt64Array":
|
|
992
|
+
case "BigUint64Array": {
|
|
993
|
+
if (is_buffer(thing)) thing = new Uint8Array(thing);
|
|
994
|
+
if (thing.buffer.byteLength % thing.BYTES_PER_ELEMENT !== 0) return `new ${type}(${stringify(thing.buffer)},${thing.byteOffset},${thing.length})`;
|
|
995
|
+
let str = `new ${type}`;
|
|
996
|
+
if (!names.has(thing.buffer)) str += `([${stringify_typed_array_elements(type, thing.buffer)}])`;
|
|
997
|
+
else str += `(${stringify(thing.buffer)})`;
|
|
998
|
+
if (thing.byteLength !== thing.buffer.byteLength) {
|
|
999
|
+
const start = thing.byteOffset / thing.BYTES_PER_ELEMENT;
|
|
1000
|
+
const end = start + thing.length;
|
|
1001
|
+
str += `.subarray(${start},${end})`;
|
|
1002
|
+
}
|
|
1003
|
+
return str;
|
|
1004
|
+
}
|
|
1005
|
+
case "DataView": {
|
|
1006
|
+
let str = `new DataView`;
|
|
1007
|
+
if (!names.has(thing.buffer)) str += `(new Uint8Array([${new Uint8Array(thing.buffer)}]).buffer`;
|
|
1008
|
+
else str += `(${stringify(thing.buffer)}`;
|
|
1009
|
+
if (thing.byteLength !== thing.buffer.byteLength) str += `,${thing.byteOffset},${thing.byteLength}`;
|
|
1010
|
+
return str + ")";
|
|
1011
|
+
}
|
|
1012
|
+
case "ArrayBuffer": return `new Uint8Array([${new Uint8Array(thing).toString()}]).buffer`;
|
|
1013
|
+
case "Temporal.Duration":
|
|
1014
|
+
case "Temporal.Instant":
|
|
1015
|
+
case "Temporal.PlainDate":
|
|
1016
|
+
case "Temporal.PlainTime":
|
|
1017
|
+
case "Temporal.PlainDateTime":
|
|
1018
|
+
case "Temporal.PlainMonthDay":
|
|
1019
|
+
case "Temporal.PlainYearMonth":
|
|
1020
|
+
case "Temporal.ZonedDateTime": return `${type}.from(${stringify_string(thing.toString())})`;
|
|
1021
|
+
default:
|
|
1022
|
+
const keys = Object.keys(thing);
|
|
1023
|
+
const obj = keys.map((key) => `${safe_key(key)}:${stringify(thing[key])}`).join(",");
|
|
1024
|
+
if (Object.getPrototypeOf(thing) === null) return keys.length > 0 ? `{${obj},__proto__:null}` : `{__proto__:null}`;
|
|
1025
|
+
return `{${obj}}`;
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
const str = stringify(value);
|
|
1029
|
+
if (statements.length === 0) return str;
|
|
1030
|
+
return `(function(){${statements.join(";")};return ${str}}())`;
|
|
1031
|
+
}
|
|
1032
|
+
/**
|
|
1033
|
+
* Serialize the elements of `buffer`, read as `type`, as a comma-separated list.
|
|
1034
|
+
* The view is created from `type` rather than from the serialized value's own
|
|
1035
|
+
* constructor, which may be a subclass like Node's `Buffer` whose `toString`
|
|
1036
|
+
* decodes the bytes instead of listing them.
|
|
1037
|
+
* `BigInt64Array`/`BigUint64Array` elements are bigints and must be written
|
|
1038
|
+
* with an `n` suffix, otherwise the emitted `new BigInt64Array([...])` throws.
|
|
1039
|
+
* @param {string} type
|
|
1040
|
+
* @param {ArrayBufferLike} buffer
|
|
1041
|
+
*/
|
|
1042
|
+
function stringify_typed_array_elements(type, buffer) {
|
|
1043
|
+
const array = new globalThis[type](buffer);
|
|
1044
|
+
if (type === "BigInt64Array" || type === "BigUint64Array") return Array.from(array, (element) => `${element}n`).join(",");
|
|
1045
|
+
if (array instanceof Float32Array || array instanceof Float64Array || typeof Float16Array !== "undefined" && array instanceof Float16Array) return Array.from(array, (element) => Object.is(element, -0) ? "-0" : `${element}`).join(",");
|
|
1046
|
+
return array.toString();
|
|
1047
|
+
}
|
|
1048
|
+
/** @param {string} c */
|
|
1049
|
+
function escape_unsafe_char(c) {
|
|
1050
|
+
return escaped[c] || c;
|
|
1051
|
+
}
|
|
1052
|
+
/** @param {string} str */
|
|
1053
|
+
function escape_unsafe_chars(str) {
|
|
1054
|
+
return str.replace(unsafe_chars, escape_unsafe_char);
|
|
1055
|
+
}
|
|
1056
|
+
/** @param {string} key */
|
|
1057
|
+
function safe_key(key) {
|
|
1058
|
+
return /^[_$a-zA-Z][_$a-zA-Z0-9]*$/.test(key) ? key : escape_unsafe_chars(JSON.stringify(key));
|
|
1059
|
+
}
|
|
1060
|
+
/** @param {string} key */
|
|
1061
|
+
function safe_prop(key) {
|
|
1062
|
+
return /^[_$a-zA-Z][_$a-zA-Z0-9]*$/.test(key) ? `.${key}` : `[${escape_unsafe_chars(JSON.stringify(key))}]`;
|
|
1063
|
+
}
|
|
1064
|
+
/** @param {any} thing */
|
|
1065
|
+
function stringify_primitive(thing) {
|
|
1066
|
+
const type = typeof thing;
|
|
1067
|
+
if (type === "string") return stringify_string(thing);
|
|
1068
|
+
if (thing === void 0) return "void 0";
|
|
1069
|
+
if (thing === 0 && 1 / thing < 0) return "-0";
|
|
1070
|
+
const str = String(thing);
|
|
1071
|
+
if (type === "number") return str.replace(/^(-)?0\./, "$1.");
|
|
1072
|
+
if (type === "bigint") return thing + "n";
|
|
1073
|
+
return str;
|
|
1074
|
+
}
|
|
1075
|
+
// ../../node_modules/.pnpm/svelte@5.59.2_@typescript-eslint+types@8.74.0/node_modules/svelte/src/internal/server/renderer.js
|
|
1076
|
+
/** @import { Component } from 'svelte' */
|
|
1077
|
+
/** @import { HydratableContext, SSRContext } from './types.js' */
|
|
1078
|
+
/** @import { Csp, RenderOutput, SyncRenderOutput, Sha256Source } from '../../server/public.js' */
|
|
1079
|
+
/** @import { MaybePromise } from '#shared' */
|
|
1080
|
+
/** @typedef {'head' | 'body'} RendererType */
|
|
1081
|
+
/** @typedef {{ [key in RendererType]: string }} AccumulatedContent */
|
|
1082
|
+
/**
|
|
1083
|
+
* @typedef {string | Renderer} RendererItem
|
|
1084
|
+
*/
|
|
1085
|
+
var RenderResult = class {
|
|
1086
|
+
/** @type {() => AccumulatedContent} */
|
|
1087
|
+
#render;
|
|
1088
|
+
/** @type {() => Promise<AccumulatedContent & { hashes: { script: Sha256Source[] } }>} */
|
|
1089
|
+
#render_async;
|
|
1090
|
+
/** @type {AccumulatedContent | undefined} */
|
|
1091
|
+
#sync;
|
|
1092
|
+
/** @type {{ script: '' }} */
|
|
1093
|
+
#hashes = { script: "" };
|
|
1094
|
+
/** @type {Promise<AccumulatedContent & { hashes: { script: Sha256Source[] } }> | undefined} */
|
|
1095
|
+
#promise;
|
|
1096
|
+
/**
|
|
1097
|
+
* @param {() => AccumulatedContent} render
|
|
1098
|
+
* @param {() => Promise<AccumulatedContent & { hashes: { script: Sha256Source[] } }>} render_async
|
|
1099
|
+
*/
|
|
1100
|
+
constructor(render, render_async) {
|
|
1101
|
+
this.#render = render;
|
|
1102
|
+
this.#render_async = render_async;
|
|
1103
|
+
}
|
|
1104
|
+
#get() {
|
|
1105
|
+
return this.#sync ??= this.#render();
|
|
1106
|
+
}
|
|
1107
|
+
get html() {
|
|
1108
|
+
return this.#get().body;
|
|
1109
|
+
}
|
|
1110
|
+
get head() {
|
|
1111
|
+
return this.#get().head;
|
|
1112
|
+
}
|
|
1113
|
+
get body() {
|
|
1114
|
+
return this.#get().body;
|
|
1115
|
+
}
|
|
1116
|
+
get hashes() {
|
|
1117
|
+
return this.#hashes;
|
|
1118
|
+
}
|
|
1119
|
+
/**
|
|
1120
|
+
* This is not type-safe, but honestly it's the best I can do right now, and it's a straightforward function.
|
|
1121
|
+
*
|
|
1122
|
+
* @template TResult1
|
|
1123
|
+
* @template [TResult2=never]
|
|
1124
|
+
* @param {(value: SyncRenderOutput) => TResult1} onfulfilled
|
|
1125
|
+
* @param {(reason: unknown) => TResult2} onrejected
|
|
1126
|
+
*/
|
|
1127
|
+
then(onfulfilled, onrejected) {
|
|
1128
|
+
{
|
|
1129
|
+
const result = this.#get();
|
|
1130
|
+
const user_result = onfulfilled({
|
|
1131
|
+
head: result.head,
|
|
1132
|
+
body: result.body,
|
|
1133
|
+
html: result.body,
|
|
1134
|
+
hashes: { script: [] }
|
|
1135
|
+
});
|
|
1136
|
+
return Promise.resolve(user_result);
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
};
|
|
1140
|
+
/**
|
|
1141
|
+
* Renderers are basically a tree of `string | Renderer`s, where each `Renderer` in the tree represents
|
|
1142
|
+
* work that may or may not have completed. A renderer can be {@link collect}ed to aggregate the
|
|
1143
|
+
* content from itself and all of its children, but this will throw if any of the children are
|
|
1144
|
+
* performing asynchronous work. To asynchronously collect a renderer, just `await` it.
|
|
1145
|
+
*
|
|
1146
|
+
* The `string` values within a renderer are always associated with the {@link type} of that renderer. To switch types,
|
|
1147
|
+
* call {@link child} with a different `type` argument.
|
|
1148
|
+
*/
|
|
1149
|
+
var Renderer = class Renderer {
|
|
1150
|
+
/**
|
|
1151
|
+
* The contents of the renderer.
|
|
1152
|
+
* @type {RendererItem[]}
|
|
1153
|
+
*/
|
|
1154
|
+
#out = [];
|
|
1155
|
+
/**
|
|
1156
|
+
* Any `onDestroy` callbacks registered during execution of this renderer.
|
|
1157
|
+
* @type {(() => void)[] | undefined}
|
|
1158
|
+
*/
|
|
1159
|
+
#on_destroy = void 0;
|
|
1160
|
+
/**
|
|
1161
|
+
* Whether this renderer is a component body.
|
|
1162
|
+
* @type {boolean}
|
|
1163
|
+
*/
|
|
1164
|
+
#is_component_body = false;
|
|
1165
|
+
/** @type {boolean} */
|
|
1166
|
+
#is_title = false;
|
|
1167
|
+
/**
|
|
1168
|
+
* If set, this renderer is an error boundary. When async collection
|
|
1169
|
+
* of the children fails, the failed snippet is rendered instead.
|
|
1170
|
+
* @type {{
|
|
1171
|
+
* failed: (renderer: Renderer, error: unknown, reset: () => void) => void;
|
|
1172
|
+
* transformError: (error: unknown) => unknown;
|
|
1173
|
+
* context: SSRContext | null;
|
|
1174
|
+
* } | null}
|
|
1175
|
+
*/
|
|
1176
|
+
#boundary = null;
|
|
1177
|
+
/**
|
|
1178
|
+
* The type of string content that this renderer is accumulating.
|
|
1179
|
+
* @type {RendererType}
|
|
1180
|
+
*/
|
|
1181
|
+
type;
|
|
1182
|
+
/** @type {Renderer | undefined} */
|
|
1183
|
+
#parent;
|
|
1184
|
+
/**
|
|
1185
|
+
* Asynchronous work associated with this renderer
|
|
1186
|
+
* @type {Promise<void> | undefined}
|
|
1187
|
+
*/
|
|
1188
|
+
promise = void 0;
|
|
1189
|
+
/**
|
|
1190
|
+
* State which is associated with the content tree as a whole.
|
|
1191
|
+
* It will be re-exposed, uncopied, on all children.
|
|
1192
|
+
* @type {SSRState}
|
|
1193
|
+
* @readonly
|
|
1194
|
+
*/
|
|
1195
|
+
global;
|
|
1196
|
+
/**
|
|
1197
|
+
* State that is local to the branch it is declared in.
|
|
1198
|
+
* It will be shallow-copied to all children.
|
|
1199
|
+
*
|
|
1200
|
+
* @type {{ select_value: any, multiple: boolean }}
|
|
1201
|
+
*/
|
|
1202
|
+
local;
|
|
1203
|
+
/**
|
|
1204
|
+
* @param {SSRState} global
|
|
1205
|
+
* @param {Renderer | undefined} [parent]
|
|
1206
|
+
*/
|
|
1207
|
+
constructor(global, parent) {
|
|
1208
|
+
this.#parent = parent;
|
|
1209
|
+
this.global = global;
|
|
1210
|
+
this.local = parent ? { ...parent.local } : {
|
|
1211
|
+
select_value: void 0,
|
|
1212
|
+
multiple: false
|
|
1213
|
+
};
|
|
1214
|
+
this.type = parent ? parent.type : "body";
|
|
1215
|
+
}
|
|
1216
|
+
/**
|
|
1217
|
+
* @param {(renderer: Renderer) => void} fn
|
|
1218
|
+
*/
|
|
1219
|
+
head(fn) {
|
|
1220
|
+
const head = new Renderer(this.global, this);
|
|
1221
|
+
head.type = "head";
|
|
1222
|
+
this.#out.push(head);
|
|
1223
|
+
head.child(fn);
|
|
1224
|
+
}
|
|
1225
|
+
/**
|
|
1226
|
+
* @param {Array<Promise<void>>} blockers
|
|
1227
|
+
* @param {(renderer: Renderer) => void} fn
|
|
1228
|
+
*/
|
|
1229
|
+
async_block(blockers, fn) {
|
|
1230
|
+
this.#out.push(BLOCK_OPEN);
|
|
1231
|
+
this.async(blockers, fn);
|
|
1232
|
+
this.#out.push(BLOCK_CLOSE);
|
|
1233
|
+
}
|
|
1234
|
+
/**
|
|
1235
|
+
* @param {Array<Promise<void>>} blockers
|
|
1236
|
+
* @param {(renderer: Renderer) => void} fn
|
|
1237
|
+
*/
|
|
1238
|
+
async(blockers, fn) {
|
|
1239
|
+
let callback = fn;
|
|
1240
|
+
if (blockers.length > 0) {
|
|
1241
|
+
const context = ssr_context;
|
|
1242
|
+
callback = (renderer) => {
|
|
1243
|
+
return Promise.all(blockers).then(() => {
|
|
1244
|
+
const previous_context = ssr_context;
|
|
1245
|
+
try {
|
|
1246
|
+
set_ssr_context(context);
|
|
1247
|
+
return fn(renderer);
|
|
1248
|
+
} finally {
|
|
1249
|
+
set_ssr_context(previous_context);
|
|
1250
|
+
}
|
|
1251
|
+
});
|
|
1252
|
+
};
|
|
1253
|
+
}
|
|
1254
|
+
this.child(callback);
|
|
1255
|
+
}
|
|
1256
|
+
/**
|
|
1257
|
+
* @param {Array<() => void>} thunks
|
|
1258
|
+
*/
|
|
1259
|
+
run(thunks) {
|
|
1260
|
+
const context = ssr_context;
|
|
1261
|
+
let promise = Promise.resolve(thunks[0]());
|
|
1262
|
+
const promises = [promise];
|
|
1263
|
+
if (context !== null && thunks.length > 1) context.i = true;
|
|
1264
|
+
for (const fn of thunks.slice(1)) {
|
|
1265
|
+
promise = promise.then(() => {
|
|
1266
|
+
const previous_context = ssr_context;
|
|
1267
|
+
set_ssr_context(context);
|
|
1268
|
+
try {
|
|
1269
|
+
return fn();
|
|
1270
|
+
} finally {
|
|
1271
|
+
set_ssr_context(previous_context);
|
|
1272
|
+
}
|
|
1273
|
+
});
|
|
1274
|
+
promises.push(promise);
|
|
1275
|
+
}
|
|
1276
|
+
promise.catch(noop);
|
|
1277
|
+
this.promise = this.global.track(promise);
|
|
1278
|
+
return promises;
|
|
1279
|
+
}
|
|
1280
|
+
/**
|
|
1281
|
+
* @param {(renderer: Renderer) => MaybePromise<void>} fn
|
|
1282
|
+
*/
|
|
1283
|
+
child_block(fn) {
|
|
1284
|
+
this.#out.push(BLOCK_OPEN);
|
|
1285
|
+
this.child(fn);
|
|
1286
|
+
this.#out.push(BLOCK_CLOSE);
|
|
1287
|
+
}
|
|
1288
|
+
/**
|
|
1289
|
+
* Create a child renderer. The child renderer inherits the state from the parent,
|
|
1290
|
+
* but has its own content.
|
|
1291
|
+
* @param {(renderer: Renderer) => MaybePromise<void>} fn
|
|
1292
|
+
*/
|
|
1293
|
+
child(fn) {
|
|
1294
|
+
const child = new Renderer(this.global, this);
|
|
1295
|
+
this.#out.push(child);
|
|
1296
|
+
const parent = ssr_context;
|
|
1297
|
+
set_ssr_context({
|
|
1298
|
+
...ssr_context,
|
|
1299
|
+
p: parent,
|
|
1300
|
+
c: null,
|
|
1301
|
+
r: child,
|
|
1302
|
+
i: ssr_context?.i ?? false
|
|
1303
|
+
});
|
|
1304
|
+
const result = fn(child);
|
|
1305
|
+
set_ssr_context(parent);
|
|
1306
|
+
if (result instanceof Promise) {
|
|
1307
|
+
result.catch(noop);
|
|
1308
|
+
result.finally(() => set_ssr_context(null)).catch(noop);
|
|
1309
|
+
if (child.global.mode === "sync") await_invalid();
|
|
1310
|
+
child.promise = child.global.track(result);
|
|
1311
|
+
}
|
|
1312
|
+
return child;
|
|
1313
|
+
}
|
|
1314
|
+
/**
|
|
1315
|
+
* Render children inside an error boundary. If the children throw and the API-level
|
|
1316
|
+
* `transformError` transform handles the error (doesn't re-throw), the `failed` snippet is
|
|
1317
|
+
* rendered instead. Otherwise the error propagates.
|
|
1318
|
+
*
|
|
1319
|
+
* @param {{ failed?: (renderer: Renderer, error: unknown, reset: () => void) => void }} props
|
|
1320
|
+
* @param {(renderer: Renderer) => MaybePromise<void>} children_fn
|
|
1321
|
+
*/
|
|
1322
|
+
boundary(props, children_fn) {
|
|
1323
|
+
const child = new Renderer(this.global, this);
|
|
1324
|
+
this.#out.push(child);
|
|
1325
|
+
const parent_context = ssr_context;
|
|
1326
|
+
if (props.failed) child.#boundary = {
|
|
1327
|
+
failed: props.failed,
|
|
1328
|
+
transformError: this.global.transformError,
|
|
1329
|
+
context: parent_context
|
|
1330
|
+
};
|
|
1331
|
+
set_ssr_context({
|
|
1332
|
+
...ssr_context,
|
|
1333
|
+
p: parent_context,
|
|
1334
|
+
c: null,
|
|
1335
|
+
r: child,
|
|
1336
|
+
i: ssr_context?.i ?? false
|
|
1337
|
+
});
|
|
1338
|
+
try {
|
|
1339
|
+
const result = children_fn(child);
|
|
1340
|
+
set_ssr_context(parent_context);
|
|
1341
|
+
if (result instanceof Promise) {
|
|
1342
|
+
if (child.global.mode === "sync") await_invalid();
|
|
1343
|
+
result.catch(noop);
|
|
1344
|
+
child.promise = child.global.track(result);
|
|
1345
|
+
}
|
|
1346
|
+
} catch (error) {
|
|
1347
|
+
set_ssr_context(parent_context);
|
|
1348
|
+
const failed_snippet = props.failed;
|
|
1349
|
+
if (!failed_snippet) throw error;
|
|
1350
|
+
const result = this.global.transformError(error);
|
|
1351
|
+
child.#out.length = 0;
|
|
1352
|
+
child.#boundary = null;
|
|
1353
|
+
if (result instanceof Promise) {
|
|
1354
|
+
if (this.global.mode === "sync") await_invalid();
|
|
1355
|
+
child.promise = child.global.track(
|
|
1356
|
+
/** @type {Promise<unknown>} */
|
|
1357
|
+
result.then((transformed) => {
|
|
1358
|
+
set_ssr_context(parent_context);
|
|
1359
|
+
child.#out.push(Renderer.#serialize_failed_boundary(transformed));
|
|
1360
|
+
failed_snippet(child, transformed, noop);
|
|
1361
|
+
child.#out.push(BLOCK_CLOSE);
|
|
1362
|
+
})
|
|
1363
|
+
);
|
|
1364
|
+
child.promise.catch(noop);
|
|
1365
|
+
} else {
|
|
1366
|
+
child.#out.push(Renderer.#serialize_failed_boundary(result));
|
|
1367
|
+
failed_snippet(child, result, noop);
|
|
1368
|
+
child.#out.push(BLOCK_CLOSE);
|
|
1369
|
+
}
|
|
1370
|
+
}
|
|
1371
|
+
}
|
|
1372
|
+
/**
|
|
1373
|
+
* Create a component renderer. The component renderer inherits the state from the parent,
|
|
1374
|
+
* but has its own content. It is treated as an ordering boundary for ondestroy callbacks.
|
|
1375
|
+
* @param {(renderer: Renderer) => MaybePromise<void>} fn
|
|
1376
|
+
* @param {Function} [component_fn]
|
|
1377
|
+
* @returns {void}
|
|
1378
|
+
*/
|
|
1379
|
+
component(fn, component_fn) {
|
|
1380
|
+
push(component_fn);
|
|
1381
|
+
this.child((renderer) => {
|
|
1382
|
+
renderer.#is_component_body = true;
|
|
1383
|
+
return fn(renderer);
|
|
1384
|
+
});
|
|
1385
|
+
pop();
|
|
1386
|
+
}
|
|
1387
|
+
/**
|
|
1388
|
+
* @param {Record<string, any>} attrs
|
|
1389
|
+
* @param {(renderer: Renderer) => void} fn
|
|
1390
|
+
* @param {string | undefined} [css_hash]
|
|
1391
|
+
* @param {Record<string, boolean> | undefined} [classes]
|
|
1392
|
+
* @param {Record<string, string> | undefined} [styles]
|
|
1393
|
+
* @param {number | undefined} [flags]
|
|
1394
|
+
* @param {boolean | undefined} [is_rich]
|
|
1395
|
+
* @returns {void}
|
|
1396
|
+
*/
|
|
1397
|
+
select(attrs, fn, css_hash, classes, styles, flags, is_rich) {
|
|
1398
|
+
const { value, defaultValue, ...select_attrs } = attrs;
|
|
1399
|
+
if (select_attrs.multiple === "") select_attrs.multiple = true;
|
|
1400
|
+
this.push(`<select${attributes(select_attrs, css_hash, classes, styles, flags)}>`);
|
|
1401
|
+
this.child((renderer) => {
|
|
1402
|
+
renderer.local.select_value = value === void 0 ? defaultValue : value;
|
|
1403
|
+
renderer.local.multiple = !!select_attrs.multiple;
|
|
1404
|
+
fn(renderer);
|
|
1405
|
+
});
|
|
1406
|
+
this.push(`${is_rich ? "<!>" : ""}</select>`);
|
|
1407
|
+
}
|
|
1408
|
+
/**
|
|
1409
|
+
* @param {Record<string, any>} attrs
|
|
1410
|
+
* @param {string | number | boolean | ((renderer: Renderer) => void)} body
|
|
1411
|
+
* @param {string | undefined} [css_hash]
|
|
1412
|
+
* @param {Record<string, boolean> | undefined} [classes]
|
|
1413
|
+
* @param {Record<string, string> | undefined} [styles]
|
|
1414
|
+
* @param {number | undefined} [flags]
|
|
1415
|
+
* @param {boolean | undefined} [is_rich]
|
|
1416
|
+
*/
|
|
1417
|
+
option(attrs, body, css_hash, classes, styles, flags, is_rich) {
|
|
1418
|
+
this.#out.push(`<option${attributes(attrs, css_hash, classes, styles, flags)}`);
|
|
1419
|
+
/**
|
|
1420
|
+
* @param {Renderer} renderer
|
|
1421
|
+
* @param {any} value
|
|
1422
|
+
* @param {{ head?: string, body: any }} content
|
|
1423
|
+
*/
|
|
1424
|
+
const close = (renderer, value, { head, body }) => {
|
|
1425
|
+
if (has_own_property.call(attrs, "value")) value = attrs.value;
|
|
1426
|
+
var select_value = this.local.select_value;
|
|
1427
|
+
if (this.local.multiple && is_array(select_value) ? select_value.includes(value) : value === select_value) renderer.#out.push(" selected=\"\"");
|
|
1428
|
+
renderer.#out.push(`>${body}${is_rich ? "<!>" : ""}</option>`);
|
|
1429
|
+
if (head) renderer.head((child) => child.push(head));
|
|
1430
|
+
};
|
|
1431
|
+
if (typeof body === "function") this.child((renderer) => {
|
|
1432
|
+
const r = new Renderer(this.global, this);
|
|
1433
|
+
body(r);
|
|
1434
|
+
if (this.global.mode === "async") return r.#collect_content_async().then((content) => {
|
|
1435
|
+
close(renderer, content.body.replaceAll("<!---->", ""), content);
|
|
1436
|
+
});
|
|
1437
|
+
else {
|
|
1438
|
+
const content = r.#collect_content();
|
|
1439
|
+
close(renderer, content.body.replaceAll("<!---->", ""), content);
|
|
1440
|
+
}
|
|
1441
|
+
});
|
|
1442
|
+
else close(this, body, { body: escape_html(body) });
|
|
1443
|
+
}
|
|
1444
|
+
/**
|
|
1445
|
+
* @param {(renderer: Renderer) => void} fn
|
|
1446
|
+
*/
|
|
1447
|
+
title(fn) {
|
|
1448
|
+
const title = new Renderer(this.global, this);
|
|
1449
|
+
title.type = "head";
|
|
1450
|
+
title.#is_title = true;
|
|
1451
|
+
this.#out.push(title);
|
|
1452
|
+
title.child(fn);
|
|
1453
|
+
}
|
|
1454
|
+
/**
|
|
1455
|
+
* @param {string | (() => Promise<string>)} content
|
|
1456
|
+
*/
|
|
1457
|
+
push(content) {
|
|
1458
|
+
if (typeof content === "function") this.child(async (renderer) => renderer.push(await content()));
|
|
1459
|
+
else this.#out.push(content);
|
|
1460
|
+
}
|
|
1461
|
+
/**
|
|
1462
|
+
* @param {() => void} fn
|
|
1463
|
+
*/
|
|
1464
|
+
on_destroy(fn) {
|
|
1465
|
+
(this.#on_destroy ??= []).push(fn);
|
|
1466
|
+
}
|
|
1467
|
+
/**
|
|
1468
|
+
* @deprecated this is needed for legacy component bindings
|
|
1469
|
+
*/
|
|
1470
|
+
copy() {
|
|
1471
|
+
const copy = new Renderer(this.global, this.#parent);
|
|
1472
|
+
copy.type = this.type;
|
|
1473
|
+
copy.#is_title = this.#is_title;
|
|
1474
|
+
copy.#out = this.#out.map((item) => item instanceof Renderer ? item.copy() : item);
|
|
1475
|
+
copy.promise = this.promise;
|
|
1476
|
+
return copy;
|
|
1477
|
+
}
|
|
1478
|
+
/**
|
|
1479
|
+
* @param {Renderer} other
|
|
1480
|
+
* @deprecated this is needed for legacy component bindings
|
|
1481
|
+
*/
|
|
1482
|
+
subsume(other) {
|
|
1483
|
+
if (this.global.mode !== other.global.mode) throw new Error("invariant: A renderer cannot switch modes. If you're seeing this, there's a compiler bug. File an issue!");
|
|
1484
|
+
this.local = other.local;
|
|
1485
|
+
this.#out = other.#out.map((item, i) => {
|
|
1486
|
+
const current = this.#out[i];
|
|
1487
|
+
if (current instanceof Renderer && item instanceof Renderer) {
|
|
1488
|
+
current.subsume(item);
|
|
1489
|
+
return current;
|
|
1490
|
+
}
|
|
1491
|
+
return item;
|
|
1492
|
+
});
|
|
1493
|
+
this.promise = other.promise;
|
|
1494
|
+
this.type = other.type;
|
|
1495
|
+
this.#is_title = other.#is_title;
|
|
1496
|
+
}
|
|
1497
|
+
get length() {
|
|
1498
|
+
return this.#out.length;
|
|
1499
|
+
}
|
|
1500
|
+
/**
|
|
1501
|
+
* Creates the hydration comment that marks the start of a failed boundary.
|
|
1502
|
+
* The error is JSON-serialized and embedded inside an HTML comment for the client
|
|
1503
|
+
* to parse during hydration. The JSON is escaped to prevent `-->` or `<!--` sequences
|
|
1504
|
+
* from breaking out of the comment (XSS). Uses unicode escapes which `JSON.parse()`
|
|
1505
|
+
* handles transparently.
|
|
1506
|
+
* @param {unknown} error
|
|
1507
|
+
* @returns {string}
|
|
1508
|
+
*/
|
|
1509
|
+
static #serialize_failed_boundary(error) {
|
|
1510
|
+
return `<!--[?${JSON.stringify(error).replace(/>/g, "\\u003e").replace(/</g, "\\u003c")}-->`;
|
|
1511
|
+
}
|
|
1512
|
+
/**
|
|
1513
|
+
* Only available on the server and when compiling with the `server` option.
|
|
1514
|
+
* Takes a component and returns an object with `body` and `head` properties on it, which you can use to populate the HTML when server-rendering your app.
|
|
1515
|
+
* @template {Record<string, any>} Props
|
|
1516
|
+
* @param {Component<Props>} component
|
|
1517
|
+
* @param {{ props?: Omit<Props, '$$slots' | '$$events'>; context?: Map<any, any>; idPrefix?: string; csp?: Csp }} [options]
|
|
1518
|
+
* @returns {RenderOutput}
|
|
1519
|
+
*/
|
|
1520
|
+
static render(component, options = {}) {
|
|
1521
|
+
return new RenderResult(() => Renderer.#render(component, options), () => init_render_context().then(() => with_render_context(() => Renderer.#render_async(component, options))));
|
|
1522
|
+
}
|
|
1523
|
+
/**
|
|
1524
|
+
* runs onDestroy callbacks deepest component first, each with its child renderers in document order
|
|
1525
|
+
* only call once the content has been collected
|
|
1526
|
+
* @param {boolean} suppress_errors so callback errors on a failed render do not mask the render error
|
|
1527
|
+
*/
|
|
1528
|
+
#run_on_destroy(suppress_errors) {
|
|
1529
|
+
let first_error;
|
|
1530
|
+
let has_error = false;
|
|
1531
|
+
/**
|
|
1532
|
+
* @param {Renderer} renderer
|
|
1533
|
+
* @param {Array<() => void>} callbacks callbacks of the enclosing component
|
|
1534
|
+
*/
|
|
1535
|
+
const visit = (renderer, callbacks) => {
|
|
1536
|
+
if (renderer.#is_component_body) callbacks = [];
|
|
1537
|
+
if (renderer.#on_destroy) push_array(callbacks, renderer.#on_destroy);
|
|
1538
|
+
for (const child of renderer.#out) if (child instanceof Renderer) visit(child, callbacks);
|
|
1539
|
+
if (!renderer.#is_component_body) return;
|
|
1540
|
+
for (const cleanup of callbacks) try {
|
|
1541
|
+
cleanup();
|
|
1542
|
+
} catch (error) {
|
|
1543
|
+
if (!suppress_errors && !has_error) {
|
|
1544
|
+
first_error = error;
|
|
1545
|
+
has_error = true;
|
|
1546
|
+
}
|
|
1547
|
+
}
|
|
1548
|
+
};
|
|
1549
|
+
visit(this, []);
|
|
1550
|
+
if (has_error) throw first_error;
|
|
1551
|
+
}
|
|
1552
|
+
/**
|
|
1553
|
+
* @param {'sync' | 'async'} mode
|
|
1554
|
+
* @param {{ idPrefix?: string; csp?: Csp; transformError?: (error: unknown) => unknown }} options
|
|
1555
|
+
* @returns {Renderer}
|
|
1556
|
+
*/
|
|
1557
|
+
static #create(mode, options) {
|
|
1558
|
+
if (options.idPrefix?.includes("--")) invalid_id_prefix();
|
|
1559
|
+
return new Renderer(new SSRState(mode, options.idPrefix ? options.idPrefix + "-" : "", options.csp, options.transformError));
|
|
1560
|
+
}
|
|
1561
|
+
/**
|
|
1562
|
+
* Render a component. Throws if any of the children are performing asynchronous work.
|
|
1563
|
+
*
|
|
1564
|
+
* @template {Record<string, any>} Props
|
|
1565
|
+
* @param {Component<Props>} component
|
|
1566
|
+
* @param {{ props?: Omit<Props, '$$slots' | '$$events'>; context?: Map<any, any>; idPrefix?: string }} options
|
|
1567
|
+
* @returns {AccumulatedContent}
|
|
1568
|
+
*/
|
|
1569
|
+
static #render(component, options) {
|
|
1570
|
+
var previous_context = ssr_context;
|
|
1571
|
+
const renderer = Renderer.#create("sync", options);
|
|
1572
|
+
/** @type {AccumulatedContent | undefined} */
|
|
1573
|
+
let result;
|
|
1574
|
+
let render_error;
|
|
1575
|
+
let failed = false;
|
|
1576
|
+
try {
|
|
1577
|
+
try {
|
|
1578
|
+
Renderer.#open_render(renderer, component, options);
|
|
1579
|
+
result = Renderer.#close_render(renderer.#collect_content(), renderer);
|
|
1580
|
+
} catch (error) {
|
|
1581
|
+
render_error = error;
|
|
1582
|
+
failed = true;
|
|
1583
|
+
}
|
|
1584
|
+
renderer.#run_on_destroy(failed);
|
|
1585
|
+
if (failed) throw render_error;
|
|
1586
|
+
return result;
|
|
1587
|
+
} finally {
|
|
1588
|
+
renderer.global.abort();
|
|
1589
|
+
set_ssr_context(previous_context);
|
|
1590
|
+
}
|
|
1591
|
+
}
|
|
1592
|
+
/**
|
|
1593
|
+
* Render a component.
|
|
1594
|
+
*
|
|
1595
|
+
* @template {Record<string, any>} Props
|
|
1596
|
+
* @param {Component<Props>} component
|
|
1597
|
+
* @param {{ props?: Omit<Props, '$$slots' | '$$events'>; context?: Map<any, any>; idPrefix?: string; csp?: Csp }} options
|
|
1598
|
+
* @returns {Promise<AccumulatedContent & { hashes: { script: Sha256Source[] } }>}
|
|
1599
|
+
*/
|
|
1600
|
+
static async #render_async(component, options) {
|
|
1601
|
+
const previous_context = ssr_context;
|
|
1602
|
+
const renderer = Renderer.#create("async", options);
|
|
1603
|
+
/** @type {(AccumulatedContent & { hashes: { script: Sha256Source[] } }) | undefined} */
|
|
1604
|
+
let result;
|
|
1605
|
+
let render_error;
|
|
1606
|
+
let failed = false;
|
|
1607
|
+
try {
|
|
1608
|
+
try {
|
|
1609
|
+
Renderer.#open_render(renderer, component, options);
|
|
1610
|
+
const content = await renderer.#collect_content_async();
|
|
1611
|
+
const hydratables = await renderer.#collect_hydratables();
|
|
1612
|
+
if (hydratables !== null) content.head = hydratables + content.head;
|
|
1613
|
+
result = Renderer.#close_render(content, renderer);
|
|
1614
|
+
} catch (error) {
|
|
1615
|
+
render_error = error;
|
|
1616
|
+
failed = true;
|
|
1617
|
+
renderer.global.abort();
|
|
1618
|
+
await renderer.global.settle();
|
|
1619
|
+
}
|
|
1620
|
+
renderer.#run_on_destroy(failed);
|
|
1621
|
+
if (failed) throw render_error;
|
|
1622
|
+
return result;
|
|
1623
|
+
} finally {
|
|
1624
|
+
set_ssr_context(previous_context);
|
|
1625
|
+
renderer.global.abort();
|
|
1626
|
+
}
|
|
1627
|
+
}
|
|
1628
|
+
/**
|
|
1629
|
+
* Collect all of the code from the `out` array and return it as a string, or a promise resolving to a string.
|
|
1630
|
+
* @param {AccumulatedContent} content
|
|
1631
|
+
* @returns {AccumulatedContent}
|
|
1632
|
+
*/
|
|
1633
|
+
#collect_content(content = {
|
|
1634
|
+
head: "",
|
|
1635
|
+
body: ""
|
|
1636
|
+
}) {
|
|
1637
|
+
for (const item of this.#out) if (typeof item === "string") content[this.type] += item;
|
|
1638
|
+
else if (item.#is_title) this.global.title = item.#collect_content().head;
|
|
1639
|
+
else item.#collect_content(content);
|
|
1640
|
+
return content;
|
|
1641
|
+
}
|
|
1642
|
+
/**
|
|
1643
|
+
* Collect all of the code from the `out` array and return it as a string.
|
|
1644
|
+
* @param {AccumulatedContent} content
|
|
1645
|
+
* @returns {Promise<AccumulatedContent>}
|
|
1646
|
+
*/
|
|
1647
|
+
async #collect_content_async(content = {
|
|
1648
|
+
head: "",
|
|
1649
|
+
body: ""
|
|
1650
|
+
}) {
|
|
1651
|
+
await this.promise;
|
|
1652
|
+
for (const item of this.#out) if (typeof item === "string") content[this.type] += item;
|
|
1653
|
+
else if (item.#is_title) this.global.title = (await item.#collect_content_async()).head;
|
|
1654
|
+
else if (item.#boundary) {
|
|
1655
|
+
/** @type {AccumulatedContent} */
|
|
1656
|
+
const boundary_content = {
|
|
1657
|
+
head: "",
|
|
1658
|
+
body: ""
|
|
1659
|
+
};
|
|
1660
|
+
const title = this.global.title;
|
|
1661
|
+
try {
|
|
1662
|
+
await item.#collect_content_async(boundary_content);
|
|
1663
|
+
content.head += boundary_content.head;
|
|
1664
|
+
content.body += boundary_content.body;
|
|
1665
|
+
} catch (error) {
|
|
1666
|
+
this.global.title = title;
|
|
1667
|
+
const { context, failed, transformError } = item.#boundary;
|
|
1668
|
+
set_ssr_context(context);
|
|
1669
|
+
let promise = transformError(error);
|
|
1670
|
+
set_ssr_context(null);
|
|
1671
|
+
let transformed = await promise;
|
|
1672
|
+
set_ssr_context(context);
|
|
1673
|
+
const failed_renderer = new Renderer(item.global, item);
|
|
1674
|
+
failed_renderer.type = item.type;
|
|
1675
|
+
failed_renderer.#out.push(Renderer.#serialize_failed_boundary(transformed));
|
|
1676
|
+
failed(failed_renderer, transformed, noop);
|
|
1677
|
+
failed_renderer.#out.push(BLOCK_CLOSE);
|
|
1678
|
+
await failed_renderer.#collect_content_async(content);
|
|
1679
|
+
}
|
|
1680
|
+
} else await item.#collect_content_async(content);
|
|
1681
|
+
return content;
|
|
1682
|
+
}
|
|
1683
|
+
async #collect_hydratables() {
|
|
1684
|
+
const ctx = get_render_context().hydratable;
|
|
1685
|
+
for (const [_, key] of ctx.unresolved_promises) unresolved_hydratable(key, ctx.lookup.get(key)?.stack ?? "<missing stack trace>");
|
|
1686
|
+
for (const comparison of ctx.comparisons) await comparison;
|
|
1687
|
+
return await this.#hydratable_block(ctx);
|
|
1688
|
+
}
|
|
1689
|
+
/**
|
|
1690
|
+
* @template {Record<string, any>} Props
|
|
1691
|
+
* @param {Renderer} renderer
|
|
1692
|
+
* @param {import('svelte').Component<Props>} component
|
|
1693
|
+
* @param {{ props?: Omit<Props, '$$slots' | '$$events'>; context?: Map<any, any>; idPrefix?: string; csp?: Csp; transformError?: (error: unknown) => unknown }} options
|
|
1694
|
+
* @returns {void}
|
|
1695
|
+
*/
|
|
1696
|
+
static #open_render(renderer, component, options) {
|
|
1697
|
+
var previous_context = ssr_context;
|
|
1698
|
+
try {
|
|
1699
|
+
set_ssr_context({
|
|
1700
|
+
p: null,
|
|
1701
|
+
c: options.context ?? null,
|
|
1702
|
+
r: renderer,
|
|
1703
|
+
i: false
|
|
1704
|
+
});
|
|
1705
|
+
renderer.push(BLOCK_OPEN);
|
|
1706
|
+
component(renderer, options.props ?? {});
|
|
1707
|
+
renderer.push(BLOCK_CLOSE);
|
|
1708
|
+
} finally {
|
|
1709
|
+
set_ssr_context(previous_context);
|
|
1710
|
+
}
|
|
1711
|
+
}
|
|
1712
|
+
/**
|
|
1713
|
+
* @param {AccumulatedContent} content
|
|
1714
|
+
* @param {Renderer} renderer
|
|
1715
|
+
* @returns {AccumulatedContent & { hashes: { script: Sha256Source[] } }}
|
|
1716
|
+
*/
|
|
1717
|
+
static #close_render(content, renderer) {
|
|
1718
|
+
let head = content.head + renderer.global.title;
|
|
1719
|
+
let body = content.body;
|
|
1720
|
+
for (const { hash, code } of renderer.global.css) head += `<style id="${hash}">${code}</style>`;
|
|
1721
|
+
return {
|
|
1722
|
+
head,
|
|
1723
|
+
body,
|
|
1724
|
+
hashes: { script: renderer.global.csp.script_hashes }
|
|
1725
|
+
};
|
|
1726
|
+
}
|
|
1727
|
+
/**
|
|
1728
|
+
* @param {HydratableContext} ctx
|
|
1729
|
+
*/
|
|
1730
|
+
async #hydratable_block(ctx) {
|
|
1731
|
+
if (ctx.lookup.size === 0) return null;
|
|
1732
|
+
let entries = [];
|
|
1733
|
+
let has_promises = false;
|
|
1734
|
+
for (const [k, v] of ctx.lookup) {
|
|
1735
|
+
if (v.promises) {
|
|
1736
|
+
has_promises = true;
|
|
1737
|
+
for (const p of v.promises) await p;
|
|
1738
|
+
}
|
|
1739
|
+
entries.push(`[${uneval(k)},${v.serialized}]`);
|
|
1740
|
+
}
|
|
1741
|
+
let prelude = `const h = (window.__svelte ??= {}).h ??= new Map();`;
|
|
1742
|
+
if (has_promises) prelude = `const r = (v) => Promise.resolve(v);
|
|
1743
|
+
${prelude}`;
|
|
1744
|
+
const body = `
|
|
1745
|
+
{
|
|
1746
|
+
${prelude}
|
|
1747
|
+
|
|
1748
|
+
for (const [k, v] of [
|
|
1749
|
+
${entries.join(",\n ")}
|
|
1750
|
+
]) {
|
|
1751
|
+
h.set(k, v);
|
|
1752
|
+
}
|
|
1753
|
+
}
|
|
1754
|
+
`;
|
|
1755
|
+
let csp_attr = "";
|
|
1756
|
+
if (this.global.csp.nonce) csp_attr = ` nonce="${this.global.csp.nonce}"`;
|
|
1757
|
+
else if (this.global.csp.hash) {
|
|
1758
|
+
const hash = await sha256(body);
|
|
1759
|
+
this.global.csp.script_hashes.push(`sha256-${hash}`);
|
|
1760
|
+
}
|
|
1761
|
+
return `\n\t\t<script${csp_attr}>${body}<\/script>`;
|
|
1762
|
+
}
|
|
1763
|
+
};
|
|
1764
|
+
var SSRState = class {
|
|
1765
|
+
/** @readonly @type {Csp & { script_hashes: Sha256Source[] }} */
|
|
1766
|
+
csp;
|
|
1767
|
+
/** @readonly @type {'sync' | 'async'} */
|
|
1768
|
+
mode;
|
|
1769
|
+
/** @readonly @type {() => string} */
|
|
1770
|
+
uid;
|
|
1771
|
+
/** @readonly @type {Set<{ hash: string; code: string }>} */
|
|
1772
|
+
css = /* @__PURE__ */ new Set();
|
|
1773
|
+
/** set while collecting so the last title in document order wins */
|
|
1774
|
+
title = "";
|
|
1775
|
+
/** @type {Set<Promise<unknown>>} */
|
|
1776
|
+
#pending = /* @__PURE__ */ new Set();
|
|
1777
|
+
/** @type {AbortController | null} */
|
|
1778
|
+
#controller = null;
|
|
1779
|
+
#aborted = false;
|
|
1780
|
+
/**
|
|
1781
|
+
* `transformError` passed to `render`. Called when an error boundary catches an error.
|
|
1782
|
+
* Throws by default if unset in `render`.
|
|
1783
|
+
* @type {(error: unknown) => unknown}
|
|
1784
|
+
*/
|
|
1785
|
+
transformError;
|
|
1786
|
+
/**
|
|
1787
|
+
* @param {'sync' | 'async'} mode
|
|
1788
|
+
* @param {string} id_prefix
|
|
1789
|
+
* @param {Csp} csp
|
|
1790
|
+
* @param {((error: unknown) => unknown) | undefined} [transformError]
|
|
1791
|
+
*/
|
|
1792
|
+
constructor(mode, id_prefix = "", csp = { hash: false }, transformError) {
|
|
1793
|
+
this.mode = mode;
|
|
1794
|
+
this.csp = {
|
|
1795
|
+
...csp,
|
|
1796
|
+
script_hashes: []
|
|
1797
|
+
};
|
|
1798
|
+
this.transformError = transformError ?? ((error) => {
|
|
1799
|
+
throw error;
|
|
1800
|
+
});
|
|
1801
|
+
let uid = 1;
|
|
1802
|
+
this.uid = () => `${id_prefix}s${uid++}`;
|
|
1803
|
+
}
|
|
1804
|
+
/**
|
|
1805
|
+
* @template T
|
|
1806
|
+
* @param {Promise<T>} promise
|
|
1807
|
+
* @returns {Promise<T>}
|
|
1808
|
+
*/
|
|
1809
|
+
track(promise) {
|
|
1810
|
+
this.#pending.add(promise);
|
|
1811
|
+
promise.then(() => this.#pending.delete(promise), () => this.#pending.delete(promise));
|
|
1812
|
+
return promise;
|
|
1813
|
+
}
|
|
1814
|
+
async settle() {
|
|
1815
|
+
while (this.#pending.size > 0) await Promise.allSettled([...this.#pending]);
|
|
1816
|
+
}
|
|
1817
|
+
abort() {
|
|
1818
|
+
if (this.#aborted) return;
|
|
1819
|
+
this.#aborted = true;
|
|
1820
|
+
this.#controller?.abort(STALE_REACTION);
|
|
1821
|
+
}
|
|
1822
|
+
get_abort_signal() {
|
|
1823
|
+
const controller = this.#controller ??= new AbortController();
|
|
1824
|
+
if (this.#aborted) controller.abort(STALE_REACTION);
|
|
1825
|
+
return controller.signal;
|
|
1826
|
+
}
|
|
1827
|
+
};
|
|
1828
|
+
// ../../node_modules/.pnpm/svelte@5.59.2_@typescript-eslint+types@8.74.0/node_modules/svelte/src/internal/server/index.js
|
|
1829
|
+
var INVALID_ATTR_NAME_CHAR_REGEX = /[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u;
|
|
1830
|
+
/**
|
|
1831
|
+
* Only available on the server and when compiling with the `server` option.
|
|
1832
|
+
* Takes a component and returns an object with `body` and `head` properties on it, which you can use to populate the HTML when server-rendering your app.
|
|
1833
|
+
* @template {Record<string, any>} Props
|
|
1834
|
+
* @param {Component<Props> | ComponentType<SvelteComponent<Props>>} component
|
|
1835
|
+
* @param {{ props?: Omit<Props, '$$slots' | '$$events'>; context?: Map<any, any>; idPrefix?: string; csp?: Csp; transformError?: (error: unknown) => unknown }} [options]
|
|
1836
|
+
* @returns {RenderOutput}
|
|
1837
|
+
*/
|
|
1838
|
+
function render(component, options = {}) {
|
|
1839
|
+
if (options.csp?.hash && options.csp.nonce) invalid_csp();
|
|
1840
|
+
return Renderer.render(component, options);
|
|
1841
|
+
}
|
|
1842
|
+
/**
|
|
1843
|
+
* @param {string} hash
|
|
1844
|
+
* @param {Renderer} renderer
|
|
1845
|
+
* @param {(renderer: Renderer) => Promise<void> | void} fn
|
|
1846
|
+
* @returns {void}
|
|
1847
|
+
*/
|
|
1848
|
+
function head(hash, renderer, fn) {
|
|
1849
|
+
renderer.head((renderer) => {
|
|
1850
|
+
renderer.push(`<!--${hash}-->`);
|
|
1851
|
+
renderer.child(fn);
|
|
1852
|
+
renderer.push(EMPTY_COMMENT);
|
|
1853
|
+
});
|
|
1854
|
+
}
|
|
1855
|
+
/**
|
|
1856
|
+
* @param {Record<string, unknown>} attrs
|
|
1857
|
+
* @param {string} [css_hash]
|
|
1858
|
+
* @param {Record<string, boolean>} [classes]
|
|
1859
|
+
* @param {Record<string, string>} [styles]
|
|
1860
|
+
* @param {number} [flags]
|
|
1861
|
+
* @returns {string}
|
|
1862
|
+
*/
|
|
1863
|
+
function attributes(attrs, css_hash, classes, styles, flags = 0) {
|
|
1864
|
+
if (styles) attrs.style = to_style(attrs.style, styles);
|
|
1865
|
+
if (attrs.class) attrs.class = clsx(attrs.class);
|
|
1866
|
+
if (css_hash || classes) attrs.class = to_class(attrs.class, css_hash, classes);
|
|
1867
|
+
let attr_str = "";
|
|
1868
|
+
let name;
|
|
1869
|
+
const is_html = (flags & 1) === 0;
|
|
1870
|
+
const lowercase = (flags & 2) === 0;
|
|
1871
|
+
const is_input = (flags & 4) !== 0;
|
|
1872
|
+
const names = Object.keys(attrs);
|
|
1873
|
+
outer: for (let i = 0; i < names.length; i++) {
|
|
1874
|
+
name = names[i];
|
|
1875
|
+
if (typeof attrs[name] === "function") continue;
|
|
1876
|
+
if (name[0] === "$" && name[1] === "$") continue;
|
|
1877
|
+
if (name === "" || INVALID_ATTR_NAME_CHAR_REGEX.test(name)) continue;
|
|
1878
|
+
var value = attrs[name];
|
|
1879
|
+
var lower = name.toLowerCase();
|
|
1880
|
+
if (lowercase) name = lower;
|
|
1881
|
+
if (lower.length > 2 && lower.startsWith("on")) continue;
|
|
1882
|
+
if (is_input) {
|
|
1883
|
+
if (name === "defaultvalue" || name === "defaultchecked") {
|
|
1884
|
+
name = name === "defaultvalue" ? "value" : "checked";
|
|
1885
|
+
if (name in attrs) continue;
|
|
1886
|
+
for (let j = 0; j < names.length; j++) if (names[j].toLowerCase() === name) continue outer;
|
|
1887
|
+
}
|
|
1888
|
+
}
|
|
1889
|
+
attr_str += attr(name, value, is_html && is_boolean_attribute(name));
|
|
1890
|
+
}
|
|
1891
|
+
return attr_str;
|
|
1892
|
+
}
|
|
1893
|
+
/**
|
|
1894
|
+
* @param {unknown} value
|
|
1895
|
+
* @returns {string}
|
|
1896
|
+
*/
|
|
1897
|
+
function stringify(value) {
|
|
1898
|
+
return typeof value === "string" ? value : value == null ? "" : value + "";
|
|
1899
|
+
}
|
|
1900
|
+
/**
|
|
1901
|
+
* @param {any} value
|
|
1902
|
+
* @param {string | undefined} [hash]
|
|
1903
|
+
* @param {Record<string, boolean>} [directives]
|
|
1904
|
+
*/
|
|
1905
|
+
function attr_class(value, hash, directives) {
|
|
1906
|
+
var result = to_class(value, hash, directives);
|
|
1907
|
+
return result ? ` class="${escape_html(result, true)}"` : "";
|
|
1908
|
+
}
|
|
1909
|
+
/**
|
|
1910
|
+
* @param {any} value
|
|
1911
|
+
* @param {Record<string,any>|[Record<string,any>,Record<string,any>]} [directives]
|
|
1912
|
+
*/
|
|
1913
|
+
function attr_style(value, directives) {
|
|
1914
|
+
var result = to_style(value, directives);
|
|
1915
|
+
return result ? ` style="${escape_html(result, true)}"` : "";
|
|
1916
|
+
}
|
|
1917
|
+
/** @param {any} array_like_or_iterator */
|
|
1918
|
+
function ensure_array_like(array_like_or_iterator) {
|
|
1919
|
+
if (array_like_or_iterator) return array_like_or_iterator.length !== void 0 ? array_like_or_iterator : Array.from(array_like_or_iterator);
|
|
1920
|
+
return [];
|
|
1921
|
+
}
|
|
1922
|
+
/**
|
|
1923
|
+
* @template V
|
|
1924
|
+
* @param {() => V} get_value
|
|
1925
|
+
*/
|
|
1926
|
+
function once(get_value) {
|
|
1927
|
+
let value = UNINITIALIZED;
|
|
1928
|
+
return () => {
|
|
1929
|
+
if (value === UNINITIALIZED) value = get_value();
|
|
1930
|
+
return value;
|
|
1931
|
+
};
|
|
1932
|
+
}
|
|
1933
|
+
/**
|
|
1934
|
+
* Create an unique ID
|
|
1935
|
+
* @param {Renderer} renderer
|
|
1936
|
+
* @returns {string}
|
|
1937
|
+
*/
|
|
1938
|
+
function props_id(renderer) {
|
|
1939
|
+
const uid = renderer.global.uid();
|
|
1940
|
+
renderer.push("<!--$" + uid + "-->");
|
|
1941
|
+
return uid;
|
|
1942
|
+
}
|
|
1943
|
+
/**
|
|
1944
|
+
* @template T
|
|
1945
|
+
* @param {()=>T} fn
|
|
1946
|
+
* @returns {(new_value?: T) => (T | void)}
|
|
1947
|
+
*/
|
|
1948
|
+
function derived(fn) {
|
|
1949
|
+
const get_value = ssr_context === null ? fn : once(fn);
|
|
1950
|
+
/** @type {T | undefined} */
|
|
1951
|
+
let updated_value;
|
|
1952
|
+
return function(new_value) {
|
|
1953
|
+
if (arguments.length === 0) return updated_value ?? get_value();
|
|
1954
|
+
updated_value = new_value;
|
|
1955
|
+
return updated_value;
|
|
1956
|
+
};
|
|
1957
|
+
}
|
|
1958
|
+
export { head as a, stringify as c, attr as d, clsx as f, escape_html as h, ensure_array_like as i, getContext as l, run as m, attr_style as n, props_id as o, noop as p, derived as r, render as s, attr_class as t, setContext as u };
|
|
1959
|
+
|
|
1960
|
+
//# sourceMappingURL=server2.js.map
|