mongoku 2.6.0 → 2.7.0-compat
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/Dockerfile +1 -0
- package/README.md +25 -0
- package/build/client/_app/immutable/assets/0.CdYhspVa.css +1 -0
- package/build/client/_app/immutable/assets/0.CdYhspVa.css.br +0 -0
- package/build/client/_app/immutable/assets/0.CdYhspVa.css.gz +0 -0
- package/build/client/_app/immutable/chunks/{DdLT9cdj.js → B59nRjE7.js} +1 -1
- package/build/client/_app/immutable/chunks/B59nRjE7.js.br +2 -0
- package/build/client/_app/immutable/chunks/B59nRjE7.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BBqIHhSl.js +1 -0
- package/build/client/_app/immutable/chunks/BBqIHhSl.js.br +0 -0
- package/build/client/_app/immutable/chunks/BBqIHhSl.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{BEi7QatZ.js → BIUJX0Ps.js} +6 -6
- package/build/client/_app/immutable/chunks/BIUJX0Ps.js.br +0 -0
- package/build/client/_app/immutable/chunks/BIUJX0Ps.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C6nv_pni.js +1 -0
- package/build/client/_app/immutable/chunks/C6nv_pni.js.br +0 -0
- package/build/client/_app/immutable/chunks/C6nv_pni.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{Bh2n5Bfy.js → CETiZ6GF.js} +1 -1
- package/build/client/_app/immutable/chunks/CETiZ6GF.js.br +0 -0
- package/build/client/_app/immutable/chunks/CETiZ6GF.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CX0xC2bt.js +1 -0
- package/build/client/_app/immutable/chunks/CX0xC2bt.js.br +0 -0
- package/build/client/_app/immutable/chunks/CX0xC2bt.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CeXlKXQN.js +1 -0
- package/build/client/_app/immutable/chunks/CeXlKXQN.js.br +0 -0
- package/build/client/_app/immutable/chunks/CeXlKXQN.js.gz +0 -0
- package/build/client/_app/immutable/chunks/ChTiw7nk.js +4 -0
- package/build/client/_app/immutable/chunks/ChTiw7nk.js.br +0 -0
- package/build/client/_app/immutable/chunks/ChTiw7nk.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Czyt1_Wc.js +1 -0
- package/build/client/_app/immutable/chunks/Czyt1_Wc.js.br +0 -0
- package/build/client/_app/immutable/chunks/Czyt1_Wc.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{B5NTIIm5.js → DJHYr09v.js} +1 -1
- package/build/client/_app/immutable/chunks/DJHYr09v.js.br +0 -0
- package/build/client/_app/immutable/chunks/DJHYr09v.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{C2amz0TU.js → DZxZehvI.js} +1 -1
- package/build/client/_app/immutable/chunks/DZxZehvI.js.br +0 -0
- package/build/client/_app/immutable/chunks/DZxZehvI.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DaNl6Y92.js +2 -0
- package/build/client/_app/immutable/chunks/DaNl6Y92.js.br +0 -0
- package/build/client/_app/immutable/chunks/DaNl6Y92.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Dbu5gl04.js +1 -0
- package/build/client/_app/immutable/chunks/Dbu5gl04.js.br +0 -0
- package/build/client/_app/immutable/chunks/Dbu5gl04.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DczwA5Ds.js +1 -0
- package/build/client/_app/immutable/chunks/DczwA5Ds.js.br +0 -0
- package/build/client/_app/immutable/chunks/DczwA5Ds.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DjlV9yev.js +1 -0
- package/build/client/_app/immutable/chunks/DjlV9yev.js.br +0 -0
- package/build/client/_app/immutable/chunks/DjlV9yev.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DkIdyQoH.js +1 -0
- package/build/client/_app/immutable/chunks/DkIdyQoH.js.br +0 -0
- package/build/client/_app/immutable/chunks/DkIdyQoH.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DskkUG-R.js +41 -0
- package/build/client/_app/immutable/chunks/DskkUG-R.js.br +0 -0
- package/build/client/_app/immutable/chunks/DskkUG-R.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DtqR9xj2.js +16 -0
- package/build/client/_app/immutable/chunks/DtqR9xj2.js.br +0 -0
- package/build/client/_app/immutable/chunks/DtqR9xj2.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{c-rWvg5T.js → Dv9wDVNU.js} +1 -1
- package/build/client/_app/immutable/chunks/Dv9wDVNU.js.br +0 -0
- package/build/client/_app/immutable/chunks/Dv9wDVNU.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{Bl8s7Z6r.js → DwvJoC1a.js} +1 -1
- package/build/client/_app/immutable/chunks/DwvJoC1a.js.br +0 -0
- package/build/client/_app/immutable/chunks/DwvJoC1a.js.gz +0 -0
- package/build/client/_app/immutable/chunks/ULh2o3ji.js +1 -0
- package/build/client/_app/immutable/chunks/ULh2o3ji.js.br +0 -0
- package/build/client/_app/immutable/chunks/ULh2o3ji.js.gz +0 -0
- package/build/client/_app/immutable/chunks/V1mdyEl2.js +1 -0
- package/build/client/_app/immutable/chunks/V1mdyEl2.js.br +0 -0
- package/build/client/_app/immutable/chunks/V1mdyEl2.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{DUw-I2kh.js → gjWX2x82.js} +1 -1
- package/build/client/_app/immutable/chunks/gjWX2x82.js.br +0 -0
- package/build/client/_app/immutable/chunks/gjWX2x82.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{CxcplU4Q.js → y5L2Na-S.js} +1 -1
- package/build/client/_app/immutable/chunks/y5L2Na-S.js.br +0 -0
- package/build/client/_app/immutable/chunks/y5L2Na-S.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.DSC3O-oq.js +2 -0
- package/build/client/_app/immutable/entry/app.DSC3O-oq.js.br +0 -0
- package/build/client/_app/immutable/entry/app.DSC3O-oq.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.DXWFdQeQ.js +1 -0
- package/build/client/_app/immutable/entry/start.DXWFdQeQ.js.br +0 -0
- package/build/client/_app/immutable/entry/start.DXWFdQeQ.js.gz +0 -0
- package/build/client/_app/immutable/nodes/0.CMAlzqMw.js +1 -0
- package/build/client/_app/immutable/nodes/0.CMAlzqMw.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.CMAlzqMw.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.B6Npt7WS.js +1 -0
- package/build/client/_app/immutable/nodes/1.B6Npt7WS.js.br +4 -0
- package/build/client/_app/immutable/nodes/1.B6Npt7WS.js.gz +0 -0
- package/build/client/_app/immutable/nodes/10.UKtNnnWx.js +2 -0
- package/build/client/_app/immutable/nodes/10.UKtNnnWx.js.br +0 -0
- package/build/client/_app/immutable/nodes/10.UKtNnnWx.js.gz +0 -0
- package/build/client/_app/immutable/nodes/11.DZQrIhD6.js +6 -0
- package/build/client/_app/immutable/nodes/11.DZQrIhD6.js.br +0 -0
- package/build/client/_app/immutable/nodes/11.DZQrIhD6.js.gz +0 -0
- package/build/client/_app/immutable/nodes/12.Bb2XzJJ4.js +1 -0
- package/build/client/_app/immutable/nodes/12.Bb2XzJJ4.js.br +0 -0
- package/build/client/_app/immutable/nodes/12.Bb2XzJJ4.js.gz +0 -0
- package/build/client/_app/immutable/nodes/13.B_EllgAJ.js +1 -0
- package/build/client/_app/immutable/nodes/13.B_EllgAJ.js.br +0 -0
- package/build/client/_app/immutable/nodes/13.B_EllgAJ.js.gz +0 -0
- package/build/client/_app/immutable/nodes/14.Ds1Cbw86.js +65 -0
- package/build/client/_app/immutable/nodes/14.Ds1Cbw86.js.br +0 -0
- package/build/client/_app/immutable/nodes/14.Ds1Cbw86.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{2.AM8fesja.js → 2.C6NzDBVE.js} +1 -1
- package/build/client/_app/immutable/nodes/2.C6NzDBVE.js.br +2 -0
- package/build/client/_app/immutable/nodes/2.C6NzDBVE.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{3.BShuoOz5.js → 3.CZJqJ4La.js} +1 -1
- package/build/client/_app/immutable/nodes/3.CZJqJ4La.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.CZJqJ4La.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{4.BD6QbApY.js → 4.CNe3XPNo.js} +1 -1
- package/build/client/_app/immutable/nodes/4.CNe3XPNo.js.br +0 -0
- package/build/client/_app/immutable/nodes/4.CNe3XPNo.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{5.JM_dwz0R.js → 5.BWhhv567.js} +1 -1
- package/build/client/_app/immutable/nodes/5.BWhhv567.js.br +0 -0
- package/build/client/_app/immutable/nodes/5.BWhhv567.js.gz +0 -0
- package/build/client/_app/immutable/nodes/7.DrDdJlUZ.js +1 -0
- package/build/client/_app/immutable/nodes/7.DrDdJlUZ.js.br +0 -0
- package/build/client/_app/immutable/nodes/7.DrDdJlUZ.js.gz +0 -0
- package/build/client/_app/immutable/nodes/8.DY5fyf2p.js +2 -0
- package/build/client/_app/immutable/nodes/8.DY5fyf2p.js.br +0 -0
- package/build/client/_app/immutable/nodes/8.DY5fyf2p.js.gz +0 -0
- package/build/client/_app/immutable/nodes/9.DSZg3ucy.js +1 -0
- package/build/client/_app/immutable/nodes/9.DSZg3ucy.js.br +0 -0
- package/build/client/_app/immutable/nodes/9.DSZg3ucy.js.gz +0 -0
- package/build/client/_app/version.json +1 -1
- package/build/client/_app/version.json.br +0 -0
- package/build/client/_app/version.json.gz +0 -0
- package/build/client/robots.txt.br +0 -0
- package/build/client/robots.txt.gz +0 -0
- package/build/handler.js +290 -228
- package/build/server/chunks/0-94hvO2vX.js +31 -0
- package/build/server/chunks/0-94hvO2vX.js.map +1 -0
- package/build/server/chunks/1-DU2n-wa5.js +9 -0
- package/build/server/chunks/1-DU2n-wa5.js.map +1 -0
- package/build/server/chunks/{9-DrDIAOIh.js → 10-CA3VfgE7.js} +7 -6
- package/build/server/chunks/10-CA3VfgE7.js.map +1 -0
- package/build/server/chunks/{10-WRjYTwFT.js → 11-xh-tBR25.js} +8 -7
- package/build/server/chunks/11-xh-tBR25.js.map +1 -0
- package/build/server/chunks/{11-Cq79IAWK.js → 12-CHoThn5d.js} +8 -7
- package/build/server/chunks/12-CHoThn5d.js.map +1 -0
- package/build/server/chunks/{12-DnRkeAVv.js → 13-s3o-iKja.js} +8 -7
- package/build/server/chunks/13-s3o-iKja.js.map +1 -0
- package/build/server/chunks/{13-DKqDuEdB.js → 14-Ch_I9f3x.js} +7 -6
- package/build/server/chunks/14-Ch_I9f3x.js.map +1 -0
- package/build/server/chunks/{2-DaZMexAs.js → 2-BNTmkYSf.js} +2 -2
- package/build/server/chunks/{2-DaZMexAs.js.map → 2-BNTmkYSf.js.map} +1 -1
- package/build/server/chunks/{3-Dr4vFhF1.js → 3-ClKd4dXQ.js} +2 -2
- package/build/server/chunks/{3-Dr4vFhF1.js.map → 3-ClKd4dXQ.js.map} +1 -1
- package/build/server/chunks/{4-K2WnEwm7.js → 4-BSPVNKkN.js} +2 -2
- package/build/server/chunks/{4-K2WnEwm7.js.map → 4-BSPVNKkN.js.map} +1 -1
- package/build/server/chunks/{5-Be-Du8oZ.js → 5-BzxZlQk0.js} +2 -2
- package/build/server/chunks/{5-Be-Du8oZ.js.map → 5-BzxZlQk0.js.map} +1 -1
- package/build/server/chunks/{6-DsYzHmsZ.js → 6-Bw8JUxiD.js} +3 -2
- package/build/server/chunks/6-Bw8JUxiD.js.map +1 -0
- package/build/server/chunks/7-B_ur3ckj.js +9 -0
- package/build/server/chunks/7-B_ur3ckj.js.map +1 -0
- package/build/server/chunks/{7-eAzN1saI.js → 8-BEcdRamT.js} +8 -7
- package/build/server/chunks/8-BEcdRamT.js.map +1 -0
- package/build/server/chunks/{8-Dtaxi2J_.js → 9-CeMYWy9o.js} +7 -6
- package/build/server/chunks/9-CeMYWy9o.js.map +1 -0
- package/build/server/chunks/JsonValue-CTg4aH_w.js +320 -0
- package/build/server/chunks/JsonValue-CTg4aH_w.js.map +1 -0
- package/build/server/chunks/{Modal-fWUUqg69.js → Modal-yO0qzufQ.js} +2 -3
- package/build/server/chunks/Modal-yO0qzufQ.js.map +1 -0
- package/build/server/chunks/{Panel-BXokpC3w.js → Panel-D9GzVDDt.js} +7 -12
- package/build/server/chunks/Panel-D9GzVDDt.js.map +1 -0
- package/build/server/chunks/{PrettyJson-CV4qF02W.js → PrettyJson-CzzntSVh.js} +15 -10
- package/build/server/chunks/PrettyJson-CzzntSVh.js.map +1 -0
- package/build/server/chunks/{Tooltip-1tZ4BUxU.js → Tooltip-D2BX7dwq.js} +2 -2
- package/build/server/chunks/Tooltip-D2BX7dwq.js.map +1 -0
- package/build/server/chunks/{TooltipTable-B2QGp4YW.js → TooltipTable-91W9LxGR.js} +3 -4
- package/build/server/chunks/TooltipTable-91W9LxGR.js.map +1 -0
- package/build/server/chunks/{_layout.svelte-DAGMbkJX.js → _layout.svelte-BFxKanne.js} +28 -24
- package/build/server/chunks/_layout.svelte-BFxKanne.js.map +1 -0
- package/build/server/chunks/{_page.svelte-DgQxD9T8.js → _page.svelte-CQzzieEo.js} +16 -18
- package/build/server/chunks/_page.svelte-CQzzieEo.js.map +1 -0
- package/build/server/chunks/_page.svelte-CSuE9bVi.js +14 -0
- package/build/server/chunks/_page.svelte-CSuE9bVi.js.map +1 -0
- package/build/server/chunks/{_page.svelte-DfZ2COw_.js → _page.svelte-CnboYQ1K.js} +11 -73
- package/build/server/chunks/_page.svelte-CnboYQ1K.js.map +1 -0
- package/build/server/chunks/{_page.svelte-ClakOyno.js → _page.svelte-D41VQj4U.js} +17 -19
- package/build/server/chunks/_page.svelte-D41VQj4U.js.map +1 -0
- package/build/server/chunks/{_page.svelte-CB9ZXhBt.js → _page.svelte-Dg71nX8A.js} +117 -97
- package/build/server/chunks/_page.svelte-Dg71nX8A.js.map +1 -0
- package/build/server/chunks/{_page.svelte-BUqI0nM9.js → _page.svelte-DxlZXLVf.js} +17 -19
- package/build/server/chunks/_page.svelte-DxlZXLVf.js.map +1 -0
- package/build/server/chunks/{_page.svelte-Ccc0KJ66.js → _page.svelte-SZxwc25D.js} +45 -39
- package/build/server/chunks/_page.svelte-SZxwc25D.js.map +1 -0
- package/build/server/chunks/{_page.svelte-wmgrrvR7.js → _page.svelte-THKAhY4k.js} +48 -51
- package/build/server/chunks/_page.svelte-THKAhY4k.js.map +1 -0
- package/build/server/chunks/_server.ts-B3lXxheE.js +15 -0
- package/build/server/chunks/_server.ts-B3lXxheE.js.map +1 -0
- package/build/server/chunks/_server.ts-Bs5HC7Wf.js +46 -0
- package/build/server/chunks/_server.ts-Bs5HC7Wf.js.map +1 -0
- package/build/server/chunks/_server.ts-DRL9sDg4.js +34 -0
- package/build/server/chunks/_server.ts-DRL9sDg4.js.map +1 -0
- package/build/server/chunks/_server.ts-DqL5edUL.js +24 -0
- package/build/server/chunks/_server.ts-DqL5edUL.js.map +1 -0
- package/build/server/chunks/client-C7bEwskR.js +7 -0
- package/build/server/chunks/{client-BCfAqu0g.js.map → client-C7bEwskR.js.map} +1 -1
- package/build/server/chunks/{client2-B-hc4vU8.js → client2-DcCKOWWC.js} +6 -6
- package/build/server/chunks/client2-DcCKOWWC.js.map +1 -0
- package/build/server/chunks/error.svelte-Bk-0XnBt.js +18 -0
- package/build/server/chunks/error.svelte-Bk-0XnBt.js.map +1 -0
- package/build/server/chunks/exports-B5ORJhfK.js +65 -0
- package/build/server/chunks/exports-B5ORJhfK.js.map +1 -0
- package/build/server/chunks/{filters-CbFjTNFI.js → filters-B3U8Nh9P.js} +16 -6
- package/build/server/chunks/filters-B3U8Nh9P.js.map +1 -0
- package/build/server/chunks/hooks.server-Cq7ufuFU.js +79 -0
- package/build/server/chunks/hooks.server-Cq7ufuFU.js.map +1 -0
- package/build/server/chunks/{index2-CJE0QJlP.js → index-CC9WtE-y.js} +3 -13
- package/build/server/chunks/index-CC9WtE-y.js.map +1 -0
- package/build/server/chunks/index-wpIsICWW.js.map +1 -1
- package/build/server/chunks/{index3-CQyDuV4f.js → index2-DMabdSHV.js} +3 -3
- package/build/server/chunks/index2-DMabdSHV.js.map +1 -0
- package/build/server/chunks/{logger-KF6KpVP6.js → logger-PfH_grbh.js} +4 -3
- package/build/server/chunks/logger-PfH_grbh.js.map +1 -0
- package/build/server/chunks/{mongo-CpQtfvt6.js → mongo-B92d7zNj.js} +25 -24
- package/build/server/chunks/mongo-B92d7zNj.js.map +1 -0
- package/build/server/chunks/oauth-BfIECOev.js +178 -0
- package/build/server/chunks/oauth-BfIECOev.js.map +1 -0
- package/build/server/chunks/remote-xxtqbu-D0yn6nhQ.js +22 -0
- package/build/server/chunks/remote-xxtqbu-D0yn6nhQ.js.map +1 -0
- package/build/server/chunks/{routing-BdGCua8Q.js → routing-CYknP78v.js} +23 -4
- package/build/server/chunks/routing-CYknP78v.js.map +1 -0
- package/build/server/chunks/{server2-CkPmd3Rb.js → server2-uigtM6st.js} +3 -3
- package/build/server/chunks/server2-uigtM6st.js.map +1 -0
- package/build/server/chunks/{servers.remote-OwAA4KJJ.js → servers.remote-BhpVo4Zs.js} +67 -42
- package/build/server/chunks/servers.remote-BhpVo4Zs.js.map +1 -0
- package/build/server/chunks/shared-BqTYMAzZ.js +1027 -0
- package/build/server/chunks/shared-BqTYMAzZ.js.map +1 -0
- package/build/server/chunks/shared-server-BmU87nph.js +11 -0
- package/build/server/chunks/shared-server-BmU87nph.js.map +1 -0
- package/build/server/chunks/{state.svelte-BfzDwKMC.js → state.svelte-Dzb7Lf2r.js} +2 -3
- package/build/server/chunks/state.svelte-Dzb7Lf2r.js.map +1 -0
- package/build/server/chunks/url-hmE1zcJ6.js +4721 -0
- package/build/server/chunks/url-hmE1zcJ6.js.map +1 -0
- package/build/server/chunks/{utils-kjxf7BZO.js → utils2-kjxf7BZO.js} +1 -1
- package/build/server/chunks/utils2-kjxf7BZO.js.map +1 -0
- package/build/server/index.js +381 -3466
- package/build/server/index.js.map +1 -1
- package/build/server/manifest.js +52 -23
- package/build/server/manifest.js.map +1 -1
- package/cli.ts +4 -0
- package/dist/cli.js +3 -0
- package/ecosystem.config.js +3 -0
- package/package.json +2 -2
- package/src/api/servers.remote.ts +20 -8
- package/src/app.d.ts +5 -0
- package/src/hooks.server.ts +38 -17
- package/src/lib/actions/jsonTextarea.ts +24 -8
- package/src/lib/actions/portal.ts +12 -5
- package/src/lib/components/ExplainPanel.svelte +42 -14
- package/src/lib/components/JsonValue.svelte +12 -4
- package/src/lib/components/PrettyJson.svelte +12 -4
- package/src/lib/components/ReplicaSetSelector.svelte +3 -1
- package/src/lib/components/SearchBox.svelte +12 -4
- package/src/lib/components/Tooltip.svelte +1 -1
- package/src/lib/server/HostsManager.ts +8 -17
- package/src/lib/server/logger.ts +4 -4
- package/src/lib/server/mongo.ts +17 -12
- package/src/lib/server/oauth.ts +276 -0
- package/src/lib/utils/filters.ts +15 -5
- package/src/lib/utils/formatSignificantDigits.ts +3 -1
- package/src/lib/utils/formatTimeAgo.ts +3 -1
- package/src/lib/utils/hostnames.ts +15 -5
- package/src/lib/utils/jsonParser.ts +21 -7
- package/src/lib/utils/longestCommonSuffix.ts +3 -1
- package/src/routes/+layout.server.ts +5 -1
- package/src/routes/+layout.svelte +16 -1
- package/src/routes/.well-known/cimd.json/+server.ts +34 -0
- package/src/routes/auth/callback/+server.ts +57 -0
- package/src/routes/auth/login/+server.ts +29 -0
- package/src/routes/auth/logout/+page.svelte +9 -0
- package/src/routes/auth/logout/+server.ts +9 -0
- package/src/routes/servers/+page.svelte +9 -4
- package/src/routes/servers/[server]/databases/+page.svelte +3 -1
- package/src/routes/servers/[server]/databases/[database]/collections/+page.svelte +3 -1
- package/src/routes/servers/[server]/databases/[database]/collections/[collection]/documents/+page.svelte +3 -1
- package/src/routes/servers/[server]/databases/[database]/collections/[collection]/documents/[document]/+page.svelte +9 -6
- package/src/routes/servers/[server]/databases/[database]/collections/[collection]/indexes/+page.svelte +18 -6
- package/src/routes/servers/[server]/databases/[database]/collections/[collection]/mappings/+page.svelte +3 -1
- package/build/client/_app/immutable/assets/0.Bg-3Xsxo.css +0 -1
- package/build/client/_app/immutable/assets/0.Bg-3Xsxo.css.br +0 -0
- package/build/client/_app/immutable/assets/0.Bg-3Xsxo.css.gz +0 -0
- package/build/client/_app/immutable/chunks/2G5jukcB.js +0 -1
- package/build/client/_app/immutable/chunks/2G5jukcB.js.br +0 -0
- package/build/client/_app/immutable/chunks/2G5jukcB.js.gz +0 -0
- package/build/client/_app/immutable/chunks/B5NTIIm5.js.br +0 -0
- package/build/client/_app/immutable/chunks/B5NTIIm5.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BEi7QatZ.js.br +0 -0
- package/build/client/_app/immutable/chunks/BEi7QatZ.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BOZBLPYr.js +0 -1
- package/build/client/_app/immutable/chunks/BOZBLPYr.js.br +0 -0
- package/build/client/_app/immutable/chunks/BOZBLPYr.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BUr91kOw.js +0 -1
- package/build/client/_app/immutable/chunks/BUr91kOw.js.br +0 -0
- package/build/client/_app/immutable/chunks/BUr91kOw.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BYPjaq07.js +0 -1
- package/build/client/_app/immutable/chunks/BYPjaq07.js.br +0 -0
- package/build/client/_app/immutable/chunks/BYPjaq07.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BZagxdqB.js +0 -16
- package/build/client/_app/immutable/chunks/BZagxdqB.js.br +0 -0
- package/build/client/_app/immutable/chunks/BZagxdqB.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Bh2n5Bfy.js.br +0 -0
- package/build/client/_app/immutable/chunks/Bh2n5Bfy.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Bl8s7Z6r.js.br +0 -1
- package/build/client/_app/immutable/chunks/Bl8s7Z6r.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BnpHJF5-.js +0 -2
- package/build/client/_app/immutable/chunks/BnpHJF5-.js.br +0 -0
- package/build/client/_app/immutable/chunks/BnpHJF5-.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C2amz0TU.js.br +0 -0
- package/build/client/_app/immutable/chunks/C2amz0TU.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C93uPVVn.js +0 -1
- package/build/client/_app/immutable/chunks/C93uPVVn.js.br +0 -0
- package/build/client/_app/immutable/chunks/C93uPVVn.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CXNtxrhs.js +0 -1
- package/build/client/_app/immutable/chunks/CXNtxrhs.js.br +0 -0
- package/build/client/_app/immutable/chunks/CXNtxrhs.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Cc583CkD.js +0 -1
- package/build/client/_app/immutable/chunks/Cc583CkD.js.br +0 -0
- package/build/client/_app/immutable/chunks/Cc583CkD.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CxcplU4Q.js.br +0 -0
- package/build/client/_app/immutable/chunks/CxcplU4Q.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DDy-Kuac.js +0 -1
- package/build/client/_app/immutable/chunks/DDy-Kuac.js.br +0 -0
- package/build/client/_app/immutable/chunks/DDy-Kuac.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DIDOrPa8.js +0 -41
- package/build/client/_app/immutable/chunks/DIDOrPa8.js.br +0 -0
- package/build/client/_app/immutable/chunks/DIDOrPa8.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DJ7MgPmk.js +0 -4
- package/build/client/_app/immutable/chunks/DJ7MgPmk.js.br +0 -0
- package/build/client/_app/immutable/chunks/DJ7MgPmk.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DUw-I2kh.js.br +0 -0
- package/build/client/_app/immutable/chunks/DUw-I2kh.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DdLT9cdj.js.br +0 -0
- package/build/client/_app/immutable/chunks/DdLT9cdj.js.gz +0 -0
- package/build/client/_app/immutable/chunks/c-rWvg5T.js.br +0 -0
- package/build/client/_app/immutable/chunks/c-rWvg5T.js.gz +0 -0
- package/build/client/_app/immutable/chunks/hbftB6pI.js +0 -1
- package/build/client/_app/immutable/chunks/hbftB6pI.js.br +0 -0
- package/build/client/_app/immutable/chunks/hbftB6pI.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.BvdA5xZX.js +0 -2
- package/build/client/_app/immutable/entry/app.BvdA5xZX.js.br +0 -0
- package/build/client/_app/immutable/entry/app.BvdA5xZX.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.B47HTlUj.js +0 -1
- package/build/client/_app/immutable/entry/start.B47HTlUj.js.br +0 -2
- package/build/client/_app/immutable/entry/start.B47HTlUj.js.gz +0 -0
- package/build/client/_app/immutable/nodes/0.C-Qb2qV-.js +0 -1
- package/build/client/_app/immutable/nodes/0.C-Qb2qV-.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.C-Qb2qV-.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.CbwunOOA.js +0 -1
- package/build/client/_app/immutable/nodes/1.CbwunOOA.js.br +0 -4
- package/build/client/_app/immutable/nodes/1.CbwunOOA.js.gz +0 -0
- package/build/client/_app/immutable/nodes/10.BONTXBU2.js +0 -6
- package/build/client/_app/immutable/nodes/10.BONTXBU2.js.br +0 -0
- package/build/client/_app/immutable/nodes/10.BONTXBU2.js.gz +0 -0
- package/build/client/_app/immutable/nodes/11.Bt-WKNEi.js +0 -1
- package/build/client/_app/immutable/nodes/11.Bt-WKNEi.js.br +0 -0
- package/build/client/_app/immutable/nodes/11.Bt-WKNEi.js.gz +0 -0
- package/build/client/_app/immutable/nodes/12.DtpUwyyZ.js +0 -1
- package/build/client/_app/immutable/nodes/12.DtpUwyyZ.js.br +0 -0
- package/build/client/_app/immutable/nodes/12.DtpUwyyZ.js.gz +0 -0
- package/build/client/_app/immutable/nodes/13.Ce307l0A.js +0 -65
- package/build/client/_app/immutable/nodes/13.Ce307l0A.js.br +0 -0
- package/build/client/_app/immutable/nodes/13.Ce307l0A.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.AM8fesja.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.AM8fesja.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.BShuoOz5.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.BShuoOz5.js.gz +0 -0
- package/build/client/_app/immutable/nodes/4.BD6QbApY.js.br +0 -0
- package/build/client/_app/immutable/nodes/4.BD6QbApY.js.gz +0 -0
- package/build/client/_app/immutable/nodes/5.JM_dwz0R.js.br +0 -0
- package/build/client/_app/immutable/nodes/5.JM_dwz0R.js.gz +0 -0
- package/build/client/_app/immutable/nodes/7.lTuFbCm_.js +0 -1
- package/build/client/_app/immutable/nodes/7.lTuFbCm_.js.br +0 -0
- package/build/client/_app/immutable/nodes/7.lTuFbCm_.js.gz +0 -0
- package/build/client/_app/immutable/nodes/8.DIWHKPrG.js +0 -1
- package/build/client/_app/immutable/nodes/8.DIWHKPrG.js.br +0 -0
- package/build/client/_app/immutable/nodes/8.DIWHKPrG.js.gz +0 -0
- package/build/client/_app/immutable/nodes/9.D6Tw6uKW.js +0 -2
- package/build/client/_app/immutable/nodes/9.D6Tw6uKW.js.br +0 -0
- package/build/client/_app/immutable/nodes/9.D6Tw6uKW.js.gz +0 -0
- package/build/server/chunks/0-BdG9Cl9W.js +0 -22
- package/build/server/chunks/0-BdG9Cl9W.js.map +0 -1
- package/build/server/chunks/1-BcZWKLgB.js +0 -9
- package/build/server/chunks/1-BcZWKLgB.js.map +0 -1
- package/build/server/chunks/10-WRjYTwFT.js.map +0 -1
- package/build/server/chunks/11-Cq79IAWK.js.map +0 -1
- package/build/server/chunks/12-DnRkeAVv.js.map +0 -1
- package/build/server/chunks/13-DKqDuEdB.js.map +0 -1
- package/build/server/chunks/6-DsYzHmsZ.js.map +0 -1
- package/build/server/chunks/7-eAzN1saI.js.map +0 -1
- package/build/server/chunks/8-Dtaxi2J_.js.map +0 -1
- package/build/server/chunks/9-DrDIAOIh.js.map +0 -1
- package/build/server/chunks/JsonValue-Dj3vYG5T.js +0 -366
- package/build/server/chunks/JsonValue-Dj3vYG5T.js.map +0 -1
- package/build/server/chunks/Modal-fWUUqg69.js.map +0 -1
- package/build/server/chunks/Panel-BXokpC3w.js.map +0 -1
- package/build/server/chunks/PrettyJson-CV4qF02W.js.map +0 -1
- package/build/server/chunks/Tooltip-1tZ4BUxU.js.map +0 -1
- package/build/server/chunks/TooltipTable-B2QGp4YW.js.map +0 -1
- package/build/server/chunks/_layout.svelte-DAGMbkJX.js.map +0 -1
- package/build/server/chunks/_page.svelte-BUqI0nM9.js.map +0 -1
- package/build/server/chunks/_page.svelte-CB9ZXhBt.js.map +0 -1
- package/build/server/chunks/_page.svelte-Ccc0KJ66.js.map +0 -1
- package/build/server/chunks/_page.svelte-ClakOyno.js.map +0 -1
- package/build/server/chunks/_page.svelte-DfZ2COw_.js.map +0 -1
- package/build/server/chunks/_page.svelte-DgQxD9T8.js.map +0 -1
- package/build/server/chunks/_page.svelte-wmgrrvR7.js.map +0 -1
- package/build/server/chunks/client-BCfAqu0g.js +0 -7
- package/build/server/chunks/client2-B-hc4vU8.js.map +0 -1
- package/build/server/chunks/context-8UI9xWgq.js +0 -92
- package/build/server/chunks/context-8UI9xWgq.js.map +0 -1
- package/build/server/chunks/error.svelte-hj6GNaOv.js +0 -19
- package/build/server/chunks/error.svelte-hj6GNaOv.js.map +0 -1
- package/build/server/chunks/event-DVH-6ISX.js +0 -64
- package/build/server/chunks/event-DVH-6ISX.js.map +0 -1
- package/build/server/chunks/exports-CtTNDGe5.js +0 -161
- package/build/server/chunks/exports-CtTNDGe5.js.map +0 -1
- package/build/server/chunks/filters-CbFjTNFI.js.map +0 -1
- package/build/server/chunks/hooks.server-DRPXFQlL.js +0 -53
- package/build/server/chunks/hooks.server-DRPXFQlL.js.map +0 -1
- package/build/server/chunks/index-DOCFW0vv.js +0 -1355
- package/build/server/chunks/index-DOCFW0vv.js.map +0 -1
- package/build/server/chunks/index2-CJE0QJlP.js.map +0 -1
- package/build/server/chunks/index3-CQyDuV4f.js.map +0 -1
- package/build/server/chunks/logger-KF6KpVP6.js.map +0 -1
- package/build/server/chunks/mongo-CpQtfvt6.js.map +0 -1
- package/build/server/chunks/remote-xxtqbu-CbTWQ3bq.js +0 -21
- package/build/server/chunks/remote-xxtqbu-CbTWQ3bq.js.map +0 -1
- package/build/server/chunks/routing-BdGCua8Q.js.map +0 -1
- package/build/server/chunks/server2-CkPmd3Rb.js.map +0 -1
- package/build/server/chunks/servers.remote-OwAA4KJJ.js.map +0 -1
- package/build/server/chunks/shared-w5gO1Cte.js +0 -446
- package/build/server/chunks/shared-w5gO1Cte.js.map +0 -1
- package/build/server/chunks/state.svelte-BfzDwKMC.js.map +0 -1
- package/build/server/chunks/utils-kjxf7BZO.js.map +0 -1
- package/build/server/chunks/utils2-DrnJY_bz.js +0 -91
- package/build/server/chunks/utils2-DrnJY_bz.js.map +0 -1
- /package/build/client/_app/immutable/assets/{10.Wc4MTSzM.css → 11.Wc4MTSzM.css} +0 -0
- /package/build/client/_app/immutable/assets/{10.Wc4MTSzM.css.br → 11.Wc4MTSzM.css.br} +0 -0
- /package/build/client/_app/immutable/assets/{10.Wc4MTSzM.css.gz → 11.Wc4MTSzM.css.gz} +0 -0
- /package/build/client/_app/immutable/assets/{11.CEtFGlZU.css → 12.CEtFGlZU.css} +0 -0
- /package/build/client/_app/immutable/assets/{11.CEtFGlZU.css.br → 12.CEtFGlZU.css.br} +0 -0
- /package/build/client/_app/immutable/assets/{11.CEtFGlZU.css.gz → 12.CEtFGlZU.css.gz} +0 -0
- /package/build/client/_app/immutable/assets/{12.I1sSDJ6i.css → 13.I1sSDJ6i.css} +0 -0
- /package/build/client/_app/immutable/assets/{12.I1sSDJ6i.css.br → 13.I1sSDJ6i.css.br} +0 -0
- /package/build/client/_app/immutable/assets/{12.I1sSDJ6i.css.gz → 13.I1sSDJ6i.css.gz} +0 -0
- /package/build/client/_app/immutable/assets/{7.CRKE8WvY.css → 8.CRKE8WvY.css} +0 -0
- /package/build/client/_app/immutable/assets/{7.CRKE8WvY.css.br → 8.CRKE8WvY.css.br} +0 -0
- /package/build/client/_app/immutable/assets/{7.CRKE8WvY.css.gz → 8.CRKE8WvY.css.gz} +0 -0
package/build/server/index.js
CHANGED
|
@@ -1,2990 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { y as root, z as decode_pathname, A as DEV, B as normalize_path, C as disable_search, w as with_request_store, E as uneval, F as resolve, G as make_trackable } from './chunks/url-hmE1zcJ6.js';
|
|
2
|
+
import { j as json, t as text, R as Redirect, S as SvelteKitError, H as HttpError, e as error, A as ActionFailure } from './chunks/index-wpIsICWW.js';
|
|
3
3
|
import { b as base, a as app_dir, c as assets, r as relative, o as override, d as reset } from './chunks/server-Crjo4w1q.js';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import { e as exec } from './chunks/routing-BdGCua8Q.js';
|
|
12
|
-
import './chunks/utils2-DrnJY_bz.js';
|
|
4
|
+
import { f as format_server_error, i as is_form_content_type, T as TRAILING_SLASH_PARAM, I as INVALIDATED_PARAM, h as has_prerendered_path, a as handle_fatal_error, M as MUTATIVE_METHODS, r as redirect_response, m as method_not_allowed, n as negotiate, g as get_global_name, c as create_remote_key, s as serialize_uses, b as clarify_devalue_error, d as handle_error_and_jsonify, E as ENDPOINT_METHODS, P as PAGE_METHODS, e as get_status, j as normalize_error, k as static_error_page, p as parse_remote_arg, l as stringify, o as deserialize_binary_form, q as get_node_type, t as stringify$1, u as escape_html, S as SVELTE_KIT_ASSETS } from './chunks/shared-BqTYMAzZ.js';
|
|
5
|
+
import { c as text_encoder, g as get_relative_path, a as base64_encode, t as text_decoder } from './chunks/utils2-kjxf7BZO.js';
|
|
6
|
+
import { w as writable, r as readable } from './chunks/index-CC9WtE-y.js';
|
|
7
|
+
import { s as set_private_env, a as set_public_env, b as public_env } from './chunks/shared-server-BmU87nph.js';
|
|
8
|
+
import { f as find_route } from './chunks/routing-CYknP78v.js';
|
|
9
|
+
import { v as validate_layout_server_exports, a as validate_layout_exports, b as validate_page_server_exports, c as validate_page_exports } from './chunks/exports-B5ORJhfK.js';
|
|
10
|
+
import './chunks/async-lVJA8xJZ.js';
|
|
13
11
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
* @
|
|
18
|
-
* @
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function set_nested_value(object, path_string, value) {
|
|
33
|
-
if (path_string.startsWith("n:")) {
|
|
34
|
-
path_string = path_string.slice(2);
|
|
35
|
-
value = value === "" ? void 0 : parseFloat(value);
|
|
36
|
-
} else if (path_string.startsWith("b:")) {
|
|
37
|
-
path_string = path_string.slice(2);
|
|
38
|
-
value = value === "on";
|
|
39
|
-
}
|
|
40
|
-
deep_set(object, split_path(path_string), value);
|
|
41
|
-
}
|
|
42
|
-
function convert_formdata(data) {
|
|
43
|
-
const result = {};
|
|
44
|
-
for (let key of data.keys()) {
|
|
45
|
-
const is_array = key.endsWith("[]");
|
|
46
|
-
let values = data.getAll(key);
|
|
47
|
-
if (is_array) key = key.slice(0, -2);
|
|
48
|
-
if (values.length > 1 && !is_array) {
|
|
49
|
-
throw new Error(`Form cannot contain duplicated keys — "${key}" has ${values.length} values`);
|
|
50
|
-
}
|
|
51
|
-
values = values.filter(
|
|
52
|
-
(entry) => typeof entry === "string" || entry.name !== "" || entry.size > 0
|
|
53
|
-
);
|
|
54
|
-
if (key.startsWith("n:")) {
|
|
55
|
-
key = key.slice(2);
|
|
56
|
-
values = values.map((v) => v === "" ? void 0 : parseFloat(
|
|
57
|
-
/** @type {string} */
|
|
58
|
-
v
|
|
59
|
-
));
|
|
60
|
-
} else if (key.startsWith("b:")) {
|
|
61
|
-
key = key.slice(2);
|
|
62
|
-
values = values.map((v) => v === "on");
|
|
63
|
-
}
|
|
64
|
-
set_nested_value(result, key, is_array ? values : values[0]);
|
|
65
|
-
}
|
|
66
|
-
return result;
|
|
67
|
-
}
|
|
68
|
-
const BINARY_FORM_CONTENT_TYPE = "application/x-sveltekit-formdata";
|
|
69
|
-
const BINARY_FORM_VERSION = 0;
|
|
70
|
-
const HEADER_BYTES = 1 + 4 + 2;
|
|
71
|
-
async function deserialize_binary_form(request) {
|
|
72
|
-
if (request.headers.get("content-type") !== BINARY_FORM_CONTENT_TYPE) {
|
|
73
|
-
const form_data = await request.formData();
|
|
74
|
-
return { data: convert_formdata(form_data), meta: {}, form_data };
|
|
75
|
-
}
|
|
76
|
-
if (!request.body) {
|
|
77
|
-
throw deserialize_error("no body");
|
|
78
|
-
}
|
|
79
|
-
const content_length = parseInt(request.headers.get("content-length") ?? "");
|
|
80
|
-
if (Number.isNaN(content_length)) {
|
|
81
|
-
throw deserialize_error("invalid Content-Length header");
|
|
82
|
-
}
|
|
83
|
-
const reader = request.body.getReader();
|
|
84
|
-
const chunks = [];
|
|
85
|
-
function get_chunk(index) {
|
|
86
|
-
if (index in chunks) return chunks[index];
|
|
87
|
-
let i = chunks.length;
|
|
88
|
-
while (i <= index) {
|
|
89
|
-
chunks[i] = reader.read().then((chunk) => chunk.value);
|
|
90
|
-
i++;
|
|
91
|
-
}
|
|
92
|
-
return chunks[index];
|
|
93
|
-
}
|
|
94
|
-
async function get_buffer(offset, length) {
|
|
95
|
-
let start_chunk;
|
|
96
|
-
let chunk_start = 0;
|
|
97
|
-
let chunk_index;
|
|
98
|
-
for (chunk_index = 0; ; chunk_index++) {
|
|
99
|
-
const chunk = await get_chunk(chunk_index);
|
|
100
|
-
if (!chunk) return null;
|
|
101
|
-
const chunk_end = chunk_start + chunk.byteLength;
|
|
102
|
-
if (offset >= chunk_start && offset < chunk_end) {
|
|
103
|
-
start_chunk = chunk;
|
|
104
|
-
break;
|
|
105
|
-
}
|
|
106
|
-
chunk_start = chunk_end;
|
|
107
|
-
}
|
|
108
|
-
if (offset + length <= chunk_start + start_chunk.byteLength) {
|
|
109
|
-
return start_chunk.subarray(offset - chunk_start, offset + length - chunk_start);
|
|
110
|
-
}
|
|
111
|
-
const chunks2 = [start_chunk.subarray(offset - chunk_start)];
|
|
112
|
-
let cursor = start_chunk.byteLength - offset + chunk_start;
|
|
113
|
-
while (cursor < length) {
|
|
114
|
-
chunk_index++;
|
|
115
|
-
let chunk = await get_chunk(chunk_index);
|
|
116
|
-
if (!chunk) return null;
|
|
117
|
-
if (chunk.byteLength > length - cursor) {
|
|
118
|
-
chunk = chunk.subarray(0, length - cursor);
|
|
119
|
-
}
|
|
120
|
-
chunks2.push(chunk);
|
|
121
|
-
cursor += chunk.byteLength;
|
|
122
|
-
}
|
|
123
|
-
const buffer = new Uint8Array(length);
|
|
124
|
-
cursor = 0;
|
|
125
|
-
for (const chunk of chunks2) {
|
|
126
|
-
buffer.set(chunk, cursor);
|
|
127
|
-
cursor += chunk.byteLength;
|
|
128
|
-
}
|
|
129
|
-
return buffer;
|
|
130
|
-
}
|
|
131
|
-
const header = await get_buffer(0, HEADER_BYTES);
|
|
132
|
-
if (!header) throw deserialize_error("too short");
|
|
133
|
-
if (header[0] !== BINARY_FORM_VERSION) {
|
|
134
|
-
throw deserialize_error(`got version ${header[0]}, expected version ${BINARY_FORM_VERSION}`);
|
|
135
|
-
}
|
|
136
|
-
const header_view = new DataView(header.buffer, header.byteOffset, header.byteLength);
|
|
137
|
-
const data_length = header_view.getUint32(1, true);
|
|
138
|
-
if (HEADER_BYTES + data_length > content_length) {
|
|
139
|
-
throw deserialize_error("data overflow");
|
|
140
|
-
}
|
|
141
|
-
const file_offsets_length = header_view.getUint16(5, true);
|
|
142
|
-
if (HEADER_BYTES + data_length + file_offsets_length > content_length) {
|
|
143
|
-
throw deserialize_error("file offset table overflow");
|
|
144
|
-
}
|
|
145
|
-
const data_buffer = await get_buffer(HEADER_BYTES, data_length);
|
|
146
|
-
if (!data_buffer) throw deserialize_error("data too short");
|
|
147
|
-
let file_offsets;
|
|
148
|
-
let files_start_offset;
|
|
149
|
-
if (file_offsets_length > 0) {
|
|
150
|
-
const file_offsets_buffer = await get_buffer(HEADER_BYTES + data_length, file_offsets_length);
|
|
151
|
-
if (!file_offsets_buffer) throw deserialize_error("file offset table too short");
|
|
152
|
-
file_offsets = /** @type {Array<number>} */
|
|
153
|
-
JSON.parse(text_decoder.decode(file_offsets_buffer));
|
|
154
|
-
files_start_offset = HEADER_BYTES + data_length + file_offsets_length;
|
|
155
|
-
}
|
|
156
|
-
const [data, meta] = parse(text_decoder.decode(data_buffer), {
|
|
157
|
-
File: ([name, type, size, last_modified, index]) => {
|
|
158
|
-
if (files_start_offset + file_offsets[index] + size > content_length) {
|
|
159
|
-
throw deserialize_error("file data overflow");
|
|
160
|
-
}
|
|
161
|
-
return new Proxy(
|
|
162
|
-
new LazyFile(
|
|
163
|
-
name,
|
|
164
|
-
type,
|
|
165
|
-
size,
|
|
166
|
-
last_modified,
|
|
167
|
-
get_chunk,
|
|
168
|
-
files_start_offset + file_offsets[index]
|
|
169
|
-
),
|
|
170
|
-
{
|
|
171
|
-
getPrototypeOf() {
|
|
172
|
-
return File.prototype;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
);
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
void (async () => {
|
|
179
|
-
let has_more = true;
|
|
180
|
-
while (has_more) {
|
|
181
|
-
const chunk = await get_chunk(chunks.length);
|
|
182
|
-
has_more = !!chunk;
|
|
183
|
-
}
|
|
184
|
-
})();
|
|
185
|
-
return { data, meta, form_data: null };
|
|
186
|
-
}
|
|
187
|
-
function deserialize_error(message) {
|
|
188
|
-
return new SvelteKitError(400, "Bad Request", `Could not deserialize binary form: ${message}`);
|
|
189
|
-
}
|
|
190
|
-
class LazyFile {
|
|
191
|
-
/** @type {(index: number) => Promise<Uint8Array<ArrayBuffer> | undefined>} */
|
|
192
|
-
#get_chunk;
|
|
193
|
-
/** @type {number} */
|
|
194
|
-
#offset;
|
|
195
|
-
/**
|
|
196
|
-
* @param {string} name
|
|
197
|
-
* @param {string} type
|
|
198
|
-
* @param {number} size
|
|
199
|
-
* @param {number} last_modified
|
|
200
|
-
* @param {(index: number) => Promise<Uint8Array<ArrayBuffer> | undefined>} get_chunk
|
|
201
|
-
* @param {number} offset
|
|
202
|
-
*/
|
|
203
|
-
constructor(name, type, size, last_modified, get_chunk, offset) {
|
|
204
|
-
this.name = name;
|
|
205
|
-
this.type = type;
|
|
206
|
-
this.size = size;
|
|
207
|
-
this.lastModified = last_modified;
|
|
208
|
-
this.webkitRelativePath = "";
|
|
209
|
-
this.#get_chunk = get_chunk;
|
|
210
|
-
this.#offset = offset;
|
|
211
|
-
this.arrayBuffer = this.arrayBuffer.bind(this);
|
|
212
|
-
this.bytes = this.bytes.bind(this);
|
|
213
|
-
this.slice = this.slice.bind(this);
|
|
214
|
-
this.stream = this.stream.bind(this);
|
|
215
|
-
this.text = this.text.bind(this);
|
|
216
|
-
}
|
|
217
|
-
/** @type {ArrayBuffer | undefined} */
|
|
218
|
-
#buffer;
|
|
219
|
-
async arrayBuffer() {
|
|
220
|
-
this.#buffer ??= await new Response(this.stream()).arrayBuffer();
|
|
221
|
-
return this.#buffer;
|
|
222
|
-
}
|
|
223
|
-
async bytes() {
|
|
224
|
-
return new Uint8Array(await this.arrayBuffer());
|
|
225
|
-
}
|
|
226
|
-
/**
|
|
227
|
-
* @param {number=} start
|
|
228
|
-
* @param {number=} end
|
|
229
|
-
* @param {string=} contentType
|
|
230
|
-
*/
|
|
231
|
-
slice(start = 0, end = this.size, contentType = this.type) {
|
|
232
|
-
if (start < 0) {
|
|
233
|
-
start = Math.max(this.size + start, 0);
|
|
234
|
-
} else {
|
|
235
|
-
start = Math.min(start, this.size);
|
|
236
|
-
}
|
|
237
|
-
if (end < 0) {
|
|
238
|
-
end = Math.max(this.size + end, 0);
|
|
239
|
-
} else {
|
|
240
|
-
end = Math.min(end, this.size);
|
|
241
|
-
}
|
|
242
|
-
const size = Math.max(end - start, 0);
|
|
243
|
-
const file = new LazyFile(
|
|
244
|
-
this.name,
|
|
245
|
-
contentType,
|
|
246
|
-
size,
|
|
247
|
-
this.lastModified,
|
|
248
|
-
this.#get_chunk,
|
|
249
|
-
this.#offset + start
|
|
250
|
-
);
|
|
251
|
-
return file;
|
|
252
|
-
}
|
|
253
|
-
stream() {
|
|
254
|
-
let cursor = 0;
|
|
255
|
-
let chunk_index = 0;
|
|
256
|
-
return new ReadableStream({
|
|
257
|
-
start: async (controller) => {
|
|
258
|
-
let chunk_start = 0;
|
|
259
|
-
let start_chunk = null;
|
|
260
|
-
for (chunk_index = 0; ; chunk_index++) {
|
|
261
|
-
const chunk = await this.#get_chunk(chunk_index);
|
|
262
|
-
if (!chunk) return null;
|
|
263
|
-
const chunk_end = chunk_start + chunk.byteLength;
|
|
264
|
-
if (this.#offset >= chunk_start && this.#offset < chunk_end) {
|
|
265
|
-
start_chunk = chunk;
|
|
266
|
-
break;
|
|
267
|
-
}
|
|
268
|
-
chunk_start = chunk_end;
|
|
269
|
-
}
|
|
270
|
-
if (this.#offset + this.size <= chunk_start + start_chunk.byteLength) {
|
|
271
|
-
controller.enqueue(
|
|
272
|
-
start_chunk.subarray(this.#offset - chunk_start, this.#offset + this.size - chunk_start)
|
|
273
|
-
);
|
|
274
|
-
controller.close();
|
|
275
|
-
} else {
|
|
276
|
-
controller.enqueue(start_chunk.subarray(this.#offset - chunk_start));
|
|
277
|
-
cursor = start_chunk.byteLength - this.#offset + chunk_start;
|
|
278
|
-
}
|
|
279
|
-
},
|
|
280
|
-
pull: async (controller) => {
|
|
281
|
-
chunk_index++;
|
|
282
|
-
let chunk = await this.#get_chunk(chunk_index);
|
|
283
|
-
if (!chunk) {
|
|
284
|
-
controller.error("incomplete file data");
|
|
285
|
-
controller.close();
|
|
286
|
-
return;
|
|
287
|
-
}
|
|
288
|
-
if (chunk.byteLength > this.size - cursor) {
|
|
289
|
-
chunk = chunk.subarray(0, this.size - cursor);
|
|
290
|
-
}
|
|
291
|
-
controller.enqueue(chunk);
|
|
292
|
-
cursor += chunk.byteLength;
|
|
293
|
-
if (cursor >= this.size) {
|
|
294
|
-
controller.close();
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
});
|
|
298
|
-
}
|
|
299
|
-
async text() {
|
|
300
|
-
return text_decoder.decode(await this.arrayBuffer());
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
const path_regex = /^[a-zA-Z_$]\w*(\.[a-zA-Z_$]\w*|\[\d+\])*$/;
|
|
304
|
-
function split_path(path) {
|
|
305
|
-
if (!path_regex.test(path)) {
|
|
306
|
-
throw new Error(`Invalid path ${path}`);
|
|
307
|
-
}
|
|
308
|
-
return path.split(/\.|\[|\]/).filter(Boolean);
|
|
309
|
-
}
|
|
310
|
-
function check_prototype_pollution(key) {
|
|
311
|
-
if (key === "__proto__" || key === "constructor" || key === "prototype") {
|
|
312
|
-
throw new Error(
|
|
313
|
-
`Invalid key "${key}"`
|
|
314
|
-
);
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
function deep_set(object, keys, value) {
|
|
318
|
-
let current = object;
|
|
319
|
-
for (let i = 0; i < keys.length - 1; i += 1) {
|
|
320
|
-
const key = keys[i];
|
|
321
|
-
check_prototype_pollution(key);
|
|
322
|
-
const is_array = /^\d+$/.test(keys[i + 1]);
|
|
323
|
-
const exists = Object.hasOwn(current, key);
|
|
324
|
-
const inner = current[key];
|
|
325
|
-
if (exists && is_array !== Array.isArray(inner)) {
|
|
326
|
-
throw new Error(`Invalid array key ${keys[i + 1]}`);
|
|
327
|
-
}
|
|
328
|
-
if (!exists) {
|
|
329
|
-
current[key] = is_array ? [] : {};
|
|
330
|
-
}
|
|
331
|
-
current = current[key];
|
|
332
|
-
}
|
|
333
|
-
const final_key = keys[keys.length - 1];
|
|
334
|
-
check_prototype_pollution(final_key);
|
|
335
|
-
current[final_key] = value;
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
let public_env = {};
|
|
339
|
-
function set_private_env(environment) {
|
|
340
|
-
}
|
|
341
|
-
function set_public_env(environment) {
|
|
342
|
-
public_env = environment;
|
|
343
|
-
}
|
|
344
|
-
function effect_update_depth_exceeded() {
|
|
345
|
-
{
|
|
346
|
-
throw new Error(`https://svelte.dev/e/effect_update_depth_exceeded`);
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
function hydration_failed() {
|
|
350
|
-
{
|
|
351
|
-
throw new Error(`https://svelte.dev/e/hydration_failed`);
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
function state_descriptors_fixed() {
|
|
355
|
-
{
|
|
356
|
-
throw new Error(`https://svelte.dev/e/state_descriptors_fixed`);
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
function state_prototype_fixed() {
|
|
360
|
-
{
|
|
361
|
-
throw new Error(`https://svelte.dev/e/state_prototype_fixed`);
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
function state_unsafe_mutation() {
|
|
365
|
-
{
|
|
366
|
-
throw new Error(`https://svelte.dev/e/state_unsafe_mutation`);
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
function svelte_boundary_reset_onerror() {
|
|
370
|
-
{
|
|
371
|
-
throw new Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`);
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
function hydration_mismatch(location) {
|
|
375
|
-
{
|
|
376
|
-
console.warn(`https://svelte.dev/e/hydration_mismatch`);
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
function svelte_boundary_reset_noop() {
|
|
380
|
-
{
|
|
381
|
-
console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`);
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
let hydrating = false;
|
|
385
|
-
function set_hydrating(value) {
|
|
386
|
-
hydrating = value;
|
|
387
|
-
}
|
|
388
|
-
let hydrate_node;
|
|
389
|
-
function set_hydrate_node(node) {
|
|
390
|
-
if (node === null) {
|
|
391
|
-
hydration_mismatch();
|
|
392
|
-
throw HYDRATION_ERROR;
|
|
393
|
-
}
|
|
394
|
-
return hydrate_node = node;
|
|
395
|
-
}
|
|
396
|
-
function hydrate_next() {
|
|
397
|
-
return set_hydrate_node(/* @__PURE__ */ get_next_sibling(hydrate_node));
|
|
398
|
-
}
|
|
399
|
-
function next(count = 1) {
|
|
400
|
-
if (hydrating) {
|
|
401
|
-
var i = count;
|
|
402
|
-
var node = hydrate_node;
|
|
403
|
-
while (i--) {
|
|
404
|
-
node = /** @type {TemplateNode} */
|
|
405
|
-
/* @__PURE__ */ get_next_sibling(node);
|
|
406
|
-
}
|
|
407
|
-
hydrate_node = node;
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
function skip_nodes(remove = true) {
|
|
411
|
-
var depth = 0;
|
|
412
|
-
var node = hydrate_node;
|
|
413
|
-
while (true) {
|
|
414
|
-
if (node.nodeType === COMMENT_NODE) {
|
|
415
|
-
var data = (
|
|
416
|
-
/** @type {Comment} */
|
|
417
|
-
node.data
|
|
418
|
-
);
|
|
419
|
-
if (data === HYDRATION_END) {
|
|
420
|
-
if (depth === 0) return node;
|
|
421
|
-
depth -= 1;
|
|
422
|
-
} else if (data === HYDRATION_START || data === HYDRATION_START_ELSE) {
|
|
423
|
-
depth += 1;
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
var next2 = (
|
|
427
|
-
/** @type {TemplateNode} */
|
|
428
|
-
/* @__PURE__ */ get_next_sibling(node)
|
|
429
|
-
);
|
|
430
|
-
if (remove) node.remove();
|
|
431
|
-
node = next2;
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
let component_context = null;
|
|
435
|
-
function set_component_context(context) {
|
|
436
|
-
component_context = context;
|
|
437
|
-
}
|
|
438
|
-
function push(props, runes = false, fn) {
|
|
439
|
-
component_context = {
|
|
440
|
-
p: component_context,
|
|
441
|
-
i: false,
|
|
442
|
-
c: null,
|
|
443
|
-
e: null,
|
|
444
|
-
s: props,
|
|
445
|
-
x: null,
|
|
446
|
-
l: null
|
|
447
|
-
};
|
|
448
|
-
}
|
|
449
|
-
function pop(component) {
|
|
450
|
-
var context = (
|
|
451
|
-
/** @type {ComponentContext} */
|
|
452
|
-
component_context
|
|
453
|
-
);
|
|
454
|
-
var effects = context.e;
|
|
455
|
-
if (effects !== null) {
|
|
456
|
-
context.e = null;
|
|
457
|
-
for (var fn of effects) {
|
|
458
|
-
create_user_effect(fn);
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
context.i = true;
|
|
462
|
-
component_context = context.p;
|
|
463
|
-
return (
|
|
464
|
-
/** @type {T} */
|
|
465
|
-
{}
|
|
466
|
-
);
|
|
467
|
-
}
|
|
468
|
-
function is_runes() {
|
|
469
|
-
return true;
|
|
470
|
-
}
|
|
471
|
-
let micro_tasks = [];
|
|
472
|
-
function run_micro_tasks() {
|
|
473
|
-
var tasks = micro_tasks;
|
|
474
|
-
micro_tasks = [];
|
|
475
|
-
run_all(tasks);
|
|
476
|
-
}
|
|
477
|
-
function queue_micro_task(fn) {
|
|
478
|
-
if (micro_tasks.length === 0 && !is_flushing_sync) {
|
|
479
|
-
var tasks = micro_tasks;
|
|
480
|
-
queueMicrotask(() => {
|
|
481
|
-
if (tasks === micro_tasks) run_micro_tasks();
|
|
482
|
-
});
|
|
483
|
-
}
|
|
484
|
-
micro_tasks.push(fn);
|
|
485
|
-
}
|
|
486
|
-
function flush_tasks() {
|
|
487
|
-
while (micro_tasks.length > 0) {
|
|
488
|
-
run_micro_tasks();
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
function handle_error(error) {
|
|
492
|
-
var effect = active_effect;
|
|
493
|
-
if (effect === null) {
|
|
494
|
-
active_reaction.f |= ERROR_VALUE;
|
|
495
|
-
return error;
|
|
496
|
-
}
|
|
497
|
-
if ((effect.f & EFFECT_RAN) === 0) {
|
|
498
|
-
if ((effect.f & BOUNDARY_EFFECT) === 0) {
|
|
499
|
-
throw error;
|
|
500
|
-
}
|
|
501
|
-
effect.b.error(error);
|
|
502
|
-
} else {
|
|
503
|
-
invoke_error_boundary(error, effect);
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
function invoke_error_boundary(error, effect) {
|
|
507
|
-
while (effect !== null) {
|
|
508
|
-
if ((effect.f & BOUNDARY_EFFECT) !== 0) {
|
|
509
|
-
try {
|
|
510
|
-
effect.b.error(error);
|
|
511
|
-
return;
|
|
512
|
-
} catch (e) {
|
|
513
|
-
error = e;
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
effect = effect.parent;
|
|
517
|
-
}
|
|
518
|
-
throw error;
|
|
519
|
-
}
|
|
520
|
-
const STATUS_MASK = -7169;
|
|
521
|
-
function set_signal_status(signal, status) {
|
|
522
|
-
signal.f = signal.f & STATUS_MASK | status;
|
|
523
|
-
}
|
|
524
|
-
function update_derived_status(derived) {
|
|
525
|
-
if ((derived.f & CONNECTED) !== 0 || derived.deps === null) {
|
|
526
|
-
set_signal_status(derived, CLEAN);
|
|
527
|
-
} else {
|
|
528
|
-
set_signal_status(derived, MAYBE_DIRTY);
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
function clear_marked(deps) {
|
|
532
|
-
if (deps === null) return;
|
|
533
|
-
for (const dep of deps) {
|
|
534
|
-
if ((dep.f & DERIVED) === 0 || (dep.f & WAS_MARKED) === 0) {
|
|
535
|
-
continue;
|
|
536
|
-
}
|
|
537
|
-
dep.f ^= WAS_MARKED;
|
|
538
|
-
clear_marked(
|
|
539
|
-
/** @type {Derived} */
|
|
540
|
-
dep.deps
|
|
541
|
-
);
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
function defer_effect(effect, dirty_effects, maybe_dirty_effects) {
|
|
545
|
-
if ((effect.f & DIRTY) !== 0) {
|
|
546
|
-
dirty_effects.add(effect);
|
|
547
|
-
} else if ((effect.f & MAYBE_DIRTY) !== 0) {
|
|
548
|
-
maybe_dirty_effects.add(effect);
|
|
549
|
-
}
|
|
550
|
-
clear_marked(effect.deps);
|
|
551
|
-
set_signal_status(effect, CLEAN);
|
|
552
|
-
}
|
|
553
|
-
const batches = /* @__PURE__ */ new Set();
|
|
554
|
-
let current_batch = null;
|
|
555
|
-
let batch_values = null;
|
|
556
|
-
let queued_root_effects = [];
|
|
557
|
-
let last_scheduled_effect = null;
|
|
558
|
-
let is_flushing = false;
|
|
559
|
-
let is_flushing_sync = false;
|
|
560
|
-
class Batch {
|
|
561
|
-
committed = false;
|
|
562
|
-
/**
|
|
563
|
-
* The current values of any sources that are updated in this batch
|
|
564
|
-
* They keys of this map are identical to `this.#previous`
|
|
565
|
-
* @type {Map<Source, any>}
|
|
566
|
-
*/
|
|
567
|
-
current = /* @__PURE__ */ new Map();
|
|
568
|
-
/**
|
|
569
|
-
* The values of any sources that are updated in this batch _before_ those updates took place.
|
|
570
|
-
* They keys of this map are identical to `this.#current`
|
|
571
|
-
* @type {Map<Source, any>}
|
|
572
|
-
*/
|
|
573
|
-
previous = /* @__PURE__ */ new Map();
|
|
574
|
-
/**
|
|
575
|
-
* When the batch is committed (and the DOM is updated), we need to remove old branches
|
|
576
|
-
* and append new ones by calling the functions added inside (if/each/key/etc) blocks
|
|
577
|
-
* @type {Set<() => void>}
|
|
578
|
-
*/
|
|
579
|
-
#commit_callbacks = /* @__PURE__ */ new Set();
|
|
580
|
-
/**
|
|
581
|
-
* If a fork is discarded, we need to destroy any effects that are no longer needed
|
|
582
|
-
* @type {Set<(batch: Batch) => void>}
|
|
583
|
-
*/
|
|
584
|
-
#discard_callbacks = /* @__PURE__ */ new Set();
|
|
585
|
-
/**
|
|
586
|
-
* The number of async effects that are currently in flight
|
|
587
|
-
*/
|
|
588
|
-
#pending = 0;
|
|
589
|
-
/**
|
|
590
|
-
* The number of async effects that are currently in flight, _not_ inside a pending boundary
|
|
591
|
-
*/
|
|
592
|
-
#blocking_pending = 0;
|
|
593
|
-
/**
|
|
594
|
-
* A deferred that resolves when the batch is committed, used with `settled()`
|
|
595
|
-
* TODO replace with Promise.withResolvers once supported widely enough
|
|
596
|
-
* @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
|
|
597
|
-
*/
|
|
598
|
-
#deferred = null;
|
|
599
|
-
/**
|
|
600
|
-
* Deferred effects (which run after async work has completed) that are DIRTY
|
|
601
|
-
* @type {Set<Effect>}
|
|
602
|
-
*/
|
|
603
|
-
#dirty_effects = /* @__PURE__ */ new Set();
|
|
604
|
-
/**
|
|
605
|
-
* Deferred effects that are MAYBE_DIRTY
|
|
606
|
-
* @type {Set<Effect>}
|
|
607
|
-
*/
|
|
608
|
-
#maybe_dirty_effects = /* @__PURE__ */ new Set();
|
|
609
|
-
/**
|
|
610
|
-
* A set of branches that still exist, but will be destroyed when this batch
|
|
611
|
-
* is committed — we skip over these during `process`
|
|
612
|
-
* @type {Set<Effect>}
|
|
613
|
-
*/
|
|
614
|
-
skipped_effects = /* @__PURE__ */ new Set();
|
|
615
|
-
is_fork = false;
|
|
616
|
-
is_deferred() {
|
|
617
|
-
return this.is_fork || this.#blocking_pending > 0;
|
|
618
|
-
}
|
|
619
|
-
/**
|
|
620
|
-
*
|
|
621
|
-
* @param {Effect[]} root_effects
|
|
622
|
-
*/
|
|
623
|
-
process(root_effects) {
|
|
624
|
-
queued_root_effects = [];
|
|
625
|
-
this.apply();
|
|
626
|
-
var effects = [];
|
|
627
|
-
var render_effects = [];
|
|
628
|
-
for (const root2 of root_effects) {
|
|
629
|
-
this.#traverse_effect_tree(root2, effects, render_effects);
|
|
630
|
-
}
|
|
631
|
-
if (!this.is_fork) {
|
|
632
|
-
this.#resolve();
|
|
633
|
-
}
|
|
634
|
-
if (this.is_deferred()) {
|
|
635
|
-
this.#defer_effects(render_effects);
|
|
636
|
-
this.#defer_effects(effects);
|
|
637
|
-
} else {
|
|
638
|
-
current_batch = null;
|
|
639
|
-
flush_queued_effects(render_effects);
|
|
640
|
-
flush_queued_effects(effects);
|
|
641
|
-
this.#deferred?.resolve();
|
|
642
|
-
}
|
|
643
|
-
batch_values = null;
|
|
644
|
-
}
|
|
645
|
-
/**
|
|
646
|
-
* Traverse the effect tree, executing effects or stashing
|
|
647
|
-
* them for later execution as appropriate
|
|
648
|
-
* @param {Effect} root
|
|
649
|
-
* @param {Effect[]} effects
|
|
650
|
-
* @param {Effect[]} render_effects
|
|
651
|
-
*/
|
|
652
|
-
#traverse_effect_tree(root2, effects, render_effects) {
|
|
653
|
-
root2.f ^= CLEAN;
|
|
654
|
-
var effect = root2.first;
|
|
655
|
-
var pending_boundary = null;
|
|
656
|
-
while (effect !== null) {
|
|
657
|
-
var flags2 = effect.f;
|
|
658
|
-
var is_branch = (flags2 & (BRANCH_EFFECT | ROOT_EFFECT)) !== 0;
|
|
659
|
-
var is_skippable_branch = is_branch && (flags2 & CLEAN) !== 0;
|
|
660
|
-
var skip = is_skippable_branch || (flags2 & INERT) !== 0 || this.skipped_effects.has(effect);
|
|
661
|
-
if (async_mode_flag && pending_boundary === null && (flags2 & BOUNDARY_EFFECT) !== 0 && effect.b?.is_pending) {
|
|
662
|
-
pending_boundary = effect;
|
|
663
|
-
}
|
|
664
|
-
if (!skip && effect.fn !== null) {
|
|
665
|
-
if (is_branch) {
|
|
666
|
-
effect.f ^= CLEAN;
|
|
667
|
-
} else if (pending_boundary !== null && (flags2 & (EFFECT | RENDER_EFFECT | MANAGED_EFFECT)) !== 0) {
|
|
668
|
-
pending_boundary.b.defer_effect(effect);
|
|
669
|
-
} else if ((flags2 & EFFECT) !== 0) {
|
|
670
|
-
effects.push(effect);
|
|
671
|
-
} else if (async_mode_flag && (flags2 & (RENDER_EFFECT | MANAGED_EFFECT)) !== 0) {
|
|
672
|
-
render_effects.push(effect);
|
|
673
|
-
} else if (is_dirty(effect)) {
|
|
674
|
-
if ((flags2 & BLOCK_EFFECT) !== 0) this.#dirty_effects.add(effect);
|
|
675
|
-
update_effect(effect);
|
|
676
|
-
}
|
|
677
|
-
var child = effect.first;
|
|
678
|
-
if (child !== null) {
|
|
679
|
-
effect = child;
|
|
680
|
-
continue;
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
|
-
var parent = effect.parent;
|
|
684
|
-
effect = effect.next;
|
|
685
|
-
while (effect === null && parent !== null) {
|
|
686
|
-
if (parent === pending_boundary) {
|
|
687
|
-
pending_boundary = null;
|
|
688
|
-
}
|
|
689
|
-
effect = parent.next;
|
|
690
|
-
parent = parent.parent;
|
|
691
|
-
}
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
|
-
/**
|
|
695
|
-
* @param {Effect[]} effects
|
|
696
|
-
*/
|
|
697
|
-
#defer_effects(effects) {
|
|
698
|
-
for (var i = 0; i < effects.length; i += 1) {
|
|
699
|
-
defer_effect(effects[i], this.#dirty_effects, this.#maybe_dirty_effects);
|
|
700
|
-
}
|
|
701
|
-
}
|
|
702
|
-
/**
|
|
703
|
-
* Associate a change to a given source with the current
|
|
704
|
-
* batch, noting its previous and current values
|
|
705
|
-
* @param {Source} source
|
|
706
|
-
* @param {any} value
|
|
707
|
-
*/
|
|
708
|
-
capture(source2, value) {
|
|
709
|
-
if (value !== UNINITIALIZED && !this.previous.has(source2)) {
|
|
710
|
-
this.previous.set(source2, value);
|
|
711
|
-
}
|
|
712
|
-
if ((source2.f & ERROR_VALUE) === 0) {
|
|
713
|
-
this.current.set(source2, source2.v);
|
|
714
|
-
batch_values?.set(source2, source2.v);
|
|
715
|
-
}
|
|
716
|
-
}
|
|
717
|
-
activate() {
|
|
718
|
-
current_batch = this;
|
|
719
|
-
this.apply();
|
|
720
|
-
}
|
|
721
|
-
deactivate() {
|
|
722
|
-
if (current_batch !== this) return;
|
|
723
|
-
current_batch = null;
|
|
724
|
-
batch_values = null;
|
|
725
|
-
}
|
|
726
|
-
flush() {
|
|
727
|
-
this.activate();
|
|
728
|
-
if (queued_root_effects.length > 0) {
|
|
729
|
-
flush_effects();
|
|
730
|
-
if (current_batch !== null && current_batch !== this) {
|
|
731
|
-
return;
|
|
732
|
-
}
|
|
733
|
-
} else if (this.#pending === 0) {
|
|
734
|
-
this.process([]);
|
|
735
|
-
}
|
|
736
|
-
this.deactivate();
|
|
737
|
-
}
|
|
738
|
-
discard() {
|
|
739
|
-
for (const fn of this.#discard_callbacks) fn(this);
|
|
740
|
-
this.#discard_callbacks.clear();
|
|
741
|
-
}
|
|
742
|
-
#resolve() {
|
|
743
|
-
if (this.#blocking_pending === 0) {
|
|
744
|
-
for (const fn of this.#commit_callbacks) fn();
|
|
745
|
-
this.#commit_callbacks.clear();
|
|
746
|
-
}
|
|
747
|
-
if (this.#pending === 0) {
|
|
748
|
-
this.#commit();
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
#commit() {
|
|
752
|
-
if (batches.size > 1) {
|
|
753
|
-
this.previous.clear();
|
|
754
|
-
var previous_batch_values = batch_values;
|
|
755
|
-
var is_earlier = true;
|
|
756
|
-
for (const batch of batches) {
|
|
757
|
-
if (batch === this) {
|
|
758
|
-
is_earlier = false;
|
|
759
|
-
continue;
|
|
760
|
-
}
|
|
761
|
-
const sources = [];
|
|
762
|
-
for (const [source2, value] of this.current) {
|
|
763
|
-
if (batch.current.has(source2)) {
|
|
764
|
-
if (is_earlier && value !== batch.current.get(source2)) {
|
|
765
|
-
batch.current.set(source2, value);
|
|
766
|
-
} else {
|
|
767
|
-
continue;
|
|
768
|
-
}
|
|
769
|
-
}
|
|
770
|
-
sources.push(source2);
|
|
771
|
-
}
|
|
772
|
-
if (sources.length === 0) {
|
|
773
|
-
continue;
|
|
774
|
-
}
|
|
775
|
-
const others = [...batch.current.keys()].filter((s) => !this.current.has(s));
|
|
776
|
-
if (others.length > 0) {
|
|
777
|
-
var prev_queued_root_effects = queued_root_effects;
|
|
778
|
-
queued_root_effects = [];
|
|
779
|
-
const marked = /* @__PURE__ */ new Set();
|
|
780
|
-
const checked = /* @__PURE__ */ new Map();
|
|
781
|
-
for (const source2 of sources) {
|
|
782
|
-
mark_effects(source2, others, marked, checked);
|
|
783
|
-
}
|
|
784
|
-
if (queued_root_effects.length > 0) {
|
|
785
|
-
current_batch = batch;
|
|
786
|
-
batch.apply();
|
|
787
|
-
for (const root2 of queued_root_effects) {
|
|
788
|
-
batch.#traverse_effect_tree(root2, [], []);
|
|
789
|
-
}
|
|
790
|
-
batch.deactivate();
|
|
791
|
-
}
|
|
792
|
-
queued_root_effects = prev_queued_root_effects;
|
|
793
|
-
}
|
|
794
|
-
}
|
|
795
|
-
current_batch = null;
|
|
796
|
-
batch_values = previous_batch_values;
|
|
797
|
-
}
|
|
798
|
-
this.committed = true;
|
|
799
|
-
batches.delete(this);
|
|
800
|
-
}
|
|
801
|
-
/**
|
|
802
|
-
*
|
|
803
|
-
* @param {boolean} blocking
|
|
804
|
-
*/
|
|
805
|
-
increment(blocking) {
|
|
806
|
-
this.#pending += 1;
|
|
807
|
-
if (blocking) this.#blocking_pending += 1;
|
|
808
|
-
}
|
|
809
|
-
/**
|
|
810
|
-
*
|
|
811
|
-
* @param {boolean} blocking
|
|
812
|
-
*/
|
|
813
|
-
decrement(blocking) {
|
|
814
|
-
this.#pending -= 1;
|
|
815
|
-
if (blocking) this.#blocking_pending -= 1;
|
|
816
|
-
this.revive();
|
|
817
|
-
}
|
|
818
|
-
revive() {
|
|
819
|
-
for (const e of this.#dirty_effects) {
|
|
820
|
-
this.#maybe_dirty_effects.delete(e);
|
|
821
|
-
set_signal_status(e, DIRTY);
|
|
822
|
-
schedule_effect(e);
|
|
823
|
-
}
|
|
824
|
-
for (const e of this.#maybe_dirty_effects) {
|
|
825
|
-
set_signal_status(e, MAYBE_DIRTY);
|
|
826
|
-
schedule_effect(e);
|
|
827
|
-
}
|
|
828
|
-
this.flush();
|
|
829
|
-
}
|
|
830
|
-
/** @param {() => void} fn */
|
|
831
|
-
oncommit(fn) {
|
|
832
|
-
this.#commit_callbacks.add(fn);
|
|
833
|
-
}
|
|
834
|
-
/** @param {(batch: Batch) => void} fn */
|
|
835
|
-
ondiscard(fn) {
|
|
836
|
-
this.#discard_callbacks.add(fn);
|
|
837
|
-
}
|
|
838
|
-
settled() {
|
|
839
|
-
return (this.#deferred ??= deferred()).promise;
|
|
840
|
-
}
|
|
841
|
-
static ensure() {
|
|
842
|
-
if (current_batch === null) {
|
|
843
|
-
const batch = current_batch = new Batch();
|
|
844
|
-
batches.add(current_batch);
|
|
845
|
-
if (!is_flushing_sync) {
|
|
846
|
-
Batch.enqueue(() => {
|
|
847
|
-
if (current_batch !== batch) {
|
|
848
|
-
return;
|
|
849
|
-
}
|
|
850
|
-
batch.flush();
|
|
851
|
-
});
|
|
852
|
-
}
|
|
853
|
-
}
|
|
854
|
-
return current_batch;
|
|
855
|
-
}
|
|
856
|
-
/** @param {() => void} task */
|
|
857
|
-
static enqueue(task) {
|
|
858
|
-
queue_micro_task(task);
|
|
859
|
-
}
|
|
860
|
-
apply() {
|
|
861
|
-
if (!async_mode_flag || !this.is_fork && batches.size === 1) return;
|
|
862
|
-
batch_values = new Map(this.current);
|
|
863
|
-
for (const batch of batches) {
|
|
864
|
-
if (batch === this) continue;
|
|
865
|
-
for (const [source2, previous] of batch.previous) {
|
|
866
|
-
if (!batch_values.has(source2)) {
|
|
867
|
-
batch_values.set(source2, previous);
|
|
868
|
-
}
|
|
869
|
-
}
|
|
870
|
-
}
|
|
871
|
-
}
|
|
872
|
-
}
|
|
873
|
-
function flushSync(fn) {
|
|
874
|
-
var was_flushing_sync = is_flushing_sync;
|
|
875
|
-
is_flushing_sync = true;
|
|
876
|
-
try {
|
|
877
|
-
var result;
|
|
878
|
-
if (fn) ;
|
|
879
|
-
while (true) {
|
|
880
|
-
flush_tasks();
|
|
881
|
-
if (queued_root_effects.length === 0) {
|
|
882
|
-
current_batch?.flush();
|
|
883
|
-
if (queued_root_effects.length === 0) {
|
|
884
|
-
last_scheduled_effect = null;
|
|
885
|
-
return (
|
|
886
|
-
/** @type {T} */
|
|
887
|
-
result
|
|
888
|
-
);
|
|
889
|
-
}
|
|
890
|
-
}
|
|
891
|
-
flush_effects();
|
|
892
|
-
}
|
|
893
|
-
} finally {
|
|
894
|
-
is_flushing_sync = was_flushing_sync;
|
|
895
|
-
}
|
|
896
|
-
}
|
|
897
|
-
function flush_effects() {
|
|
898
|
-
var was_updating_effect = is_updating_effect;
|
|
899
|
-
is_flushing = true;
|
|
900
|
-
try {
|
|
901
|
-
var flush_count = 0;
|
|
902
|
-
set_is_updating_effect(true);
|
|
903
|
-
while (queued_root_effects.length > 0) {
|
|
904
|
-
var batch = Batch.ensure();
|
|
905
|
-
if (flush_count++ > 1e3) {
|
|
906
|
-
var updates, entry;
|
|
907
|
-
if (DEV) ;
|
|
908
|
-
infinite_loop_guard();
|
|
909
|
-
}
|
|
910
|
-
batch.process(queued_root_effects);
|
|
911
|
-
old_values.clear();
|
|
912
|
-
if (DEV) ;
|
|
913
|
-
}
|
|
914
|
-
} finally {
|
|
915
|
-
is_flushing = false;
|
|
916
|
-
set_is_updating_effect(was_updating_effect);
|
|
917
|
-
last_scheduled_effect = null;
|
|
918
|
-
}
|
|
919
|
-
}
|
|
920
|
-
function infinite_loop_guard() {
|
|
921
|
-
try {
|
|
922
|
-
effect_update_depth_exceeded();
|
|
923
|
-
} catch (error) {
|
|
924
|
-
invoke_error_boundary(error, last_scheduled_effect);
|
|
925
|
-
}
|
|
926
|
-
}
|
|
927
|
-
let eager_block_effects = null;
|
|
928
|
-
function flush_queued_effects(effects) {
|
|
929
|
-
var length = effects.length;
|
|
930
|
-
if (length === 0) return;
|
|
931
|
-
var i = 0;
|
|
932
|
-
while (i < length) {
|
|
933
|
-
var effect = effects[i++];
|
|
934
|
-
if ((effect.f & (DESTROYED | INERT)) === 0 && is_dirty(effect)) {
|
|
935
|
-
eager_block_effects = /* @__PURE__ */ new Set();
|
|
936
|
-
update_effect(effect);
|
|
937
|
-
if (effect.deps === null && effect.first === null && effect.nodes === null) {
|
|
938
|
-
if (effect.teardown === null && effect.ac === null) {
|
|
939
|
-
unlink_effect(effect);
|
|
940
|
-
} else {
|
|
941
|
-
effect.fn = null;
|
|
942
|
-
}
|
|
943
|
-
}
|
|
944
|
-
if (eager_block_effects?.size > 0) {
|
|
945
|
-
old_values.clear();
|
|
946
|
-
for (const e of eager_block_effects) {
|
|
947
|
-
if ((e.f & (DESTROYED | INERT)) !== 0) continue;
|
|
948
|
-
const ordered_effects = [e];
|
|
949
|
-
let ancestor = e.parent;
|
|
950
|
-
while (ancestor !== null) {
|
|
951
|
-
if (eager_block_effects.has(ancestor)) {
|
|
952
|
-
eager_block_effects.delete(ancestor);
|
|
953
|
-
ordered_effects.push(ancestor);
|
|
954
|
-
}
|
|
955
|
-
ancestor = ancestor.parent;
|
|
956
|
-
}
|
|
957
|
-
for (let j = ordered_effects.length - 1; j >= 0; j--) {
|
|
958
|
-
const e2 = ordered_effects[j];
|
|
959
|
-
if ((e2.f & (DESTROYED | INERT)) !== 0) continue;
|
|
960
|
-
update_effect(e2);
|
|
961
|
-
}
|
|
962
|
-
}
|
|
963
|
-
eager_block_effects.clear();
|
|
964
|
-
}
|
|
965
|
-
}
|
|
966
|
-
}
|
|
967
|
-
eager_block_effects = null;
|
|
968
|
-
}
|
|
969
|
-
function mark_effects(value, sources, marked, checked) {
|
|
970
|
-
if (marked.has(value)) return;
|
|
971
|
-
marked.add(value);
|
|
972
|
-
if (value.reactions !== null) {
|
|
973
|
-
for (const reaction of value.reactions) {
|
|
974
|
-
const flags2 = reaction.f;
|
|
975
|
-
if ((flags2 & DERIVED) !== 0) {
|
|
976
|
-
mark_effects(
|
|
977
|
-
/** @type {Derived} */
|
|
978
|
-
reaction,
|
|
979
|
-
sources,
|
|
980
|
-
marked,
|
|
981
|
-
checked
|
|
982
|
-
);
|
|
983
|
-
} else if ((flags2 & (ASYNC | BLOCK_EFFECT)) !== 0 && (flags2 & DIRTY) === 0 && depends_on(reaction, sources, checked)) {
|
|
984
|
-
set_signal_status(reaction, DIRTY);
|
|
985
|
-
schedule_effect(
|
|
986
|
-
/** @type {Effect} */
|
|
987
|
-
reaction
|
|
988
|
-
);
|
|
989
|
-
}
|
|
990
|
-
}
|
|
991
|
-
}
|
|
992
|
-
}
|
|
993
|
-
function depends_on(reaction, sources, checked) {
|
|
994
|
-
const depends = checked.get(reaction);
|
|
995
|
-
if (depends !== void 0) return depends;
|
|
996
|
-
if (reaction.deps !== null) {
|
|
997
|
-
for (const dep of reaction.deps) {
|
|
998
|
-
if (sources.includes(dep)) {
|
|
999
|
-
return true;
|
|
1000
|
-
}
|
|
1001
|
-
if ((dep.f & DERIVED) !== 0 && depends_on(
|
|
1002
|
-
/** @type {Derived} */
|
|
1003
|
-
dep,
|
|
1004
|
-
sources,
|
|
1005
|
-
checked
|
|
1006
|
-
)) {
|
|
1007
|
-
checked.set(
|
|
1008
|
-
/** @type {Derived} */
|
|
1009
|
-
dep,
|
|
1010
|
-
true
|
|
1011
|
-
);
|
|
1012
|
-
return true;
|
|
1013
|
-
}
|
|
1014
|
-
}
|
|
1015
|
-
}
|
|
1016
|
-
checked.set(reaction, false);
|
|
1017
|
-
return false;
|
|
1018
|
-
}
|
|
1019
|
-
function schedule_effect(signal) {
|
|
1020
|
-
var effect = last_scheduled_effect = signal;
|
|
1021
|
-
while (effect.parent !== null) {
|
|
1022
|
-
effect = effect.parent;
|
|
1023
|
-
var flags2 = effect.f;
|
|
1024
|
-
if (is_flushing && effect === active_effect && (flags2 & BLOCK_EFFECT) !== 0 && (flags2 & HEAD_EFFECT) === 0) {
|
|
1025
|
-
return;
|
|
1026
|
-
}
|
|
1027
|
-
if ((flags2 & (ROOT_EFFECT | BRANCH_EFFECT)) !== 0) {
|
|
1028
|
-
if ((flags2 & CLEAN) === 0) return;
|
|
1029
|
-
effect.f ^= CLEAN;
|
|
1030
|
-
}
|
|
1031
|
-
}
|
|
1032
|
-
queued_root_effects.push(effect);
|
|
1033
|
-
}
|
|
1034
|
-
function createSubscriber(start) {
|
|
1035
|
-
let subscribers = 0;
|
|
1036
|
-
let version = source(0);
|
|
1037
|
-
let stop;
|
|
1038
|
-
return () => {
|
|
1039
|
-
if (effect_tracking()) {
|
|
1040
|
-
get(version);
|
|
1041
|
-
render_effect(() => {
|
|
1042
|
-
if (subscribers === 0) {
|
|
1043
|
-
stop = untrack(() => start(() => increment(version)));
|
|
1044
|
-
}
|
|
1045
|
-
subscribers += 1;
|
|
1046
|
-
return () => {
|
|
1047
|
-
queue_micro_task(() => {
|
|
1048
|
-
subscribers -= 1;
|
|
1049
|
-
if (subscribers === 0) {
|
|
1050
|
-
stop?.();
|
|
1051
|
-
stop = void 0;
|
|
1052
|
-
increment(version);
|
|
1053
|
-
}
|
|
1054
|
-
});
|
|
1055
|
-
};
|
|
1056
|
-
});
|
|
1057
|
-
}
|
|
1058
|
-
};
|
|
1059
|
-
}
|
|
1060
|
-
var flags = EFFECT_TRANSPARENT | EFFECT_PRESERVED | BOUNDARY_EFFECT;
|
|
1061
|
-
function boundary(node, props, children) {
|
|
1062
|
-
new Boundary(node, props, children);
|
|
1063
|
-
}
|
|
1064
|
-
class Boundary {
|
|
1065
|
-
/** @type {Boundary | null} */
|
|
1066
|
-
parent;
|
|
1067
|
-
is_pending = false;
|
|
1068
|
-
/** @type {TemplateNode} */
|
|
1069
|
-
#anchor;
|
|
1070
|
-
/** @type {TemplateNode | null} */
|
|
1071
|
-
#hydrate_open = hydrating ? hydrate_node : null;
|
|
1072
|
-
/** @type {BoundaryProps} */
|
|
1073
|
-
#props;
|
|
1074
|
-
/** @type {((anchor: Node) => void)} */
|
|
1075
|
-
#children;
|
|
1076
|
-
/** @type {Effect} */
|
|
1077
|
-
#effect;
|
|
1078
|
-
/** @type {Effect | null} */
|
|
1079
|
-
#main_effect = null;
|
|
1080
|
-
/** @type {Effect | null} */
|
|
1081
|
-
#pending_effect = null;
|
|
1082
|
-
/** @type {Effect | null} */
|
|
1083
|
-
#failed_effect = null;
|
|
1084
|
-
/** @type {DocumentFragment | null} */
|
|
1085
|
-
#offscreen_fragment = null;
|
|
1086
|
-
/** @type {TemplateNode | null} */
|
|
1087
|
-
#pending_anchor = null;
|
|
1088
|
-
#local_pending_count = 0;
|
|
1089
|
-
#pending_count = 0;
|
|
1090
|
-
#is_creating_fallback = false;
|
|
1091
|
-
/** @type {Set<Effect>} */
|
|
1092
|
-
#dirty_effects = /* @__PURE__ */ new Set();
|
|
1093
|
-
/** @type {Set<Effect>} */
|
|
1094
|
-
#maybe_dirty_effects = /* @__PURE__ */ new Set();
|
|
1095
|
-
/**
|
|
1096
|
-
* A source containing the number of pending async deriveds/expressions.
|
|
1097
|
-
* Only created if `$effect.pending()` is used inside the boundary,
|
|
1098
|
-
* otherwise updating the source results in needless `Batch.ensure()`
|
|
1099
|
-
* calls followed by no-op flushes
|
|
1100
|
-
* @type {Source<number> | null}
|
|
1101
|
-
*/
|
|
1102
|
-
#effect_pending = null;
|
|
1103
|
-
#effect_pending_subscriber = createSubscriber(() => {
|
|
1104
|
-
this.#effect_pending = source(this.#local_pending_count);
|
|
1105
|
-
return () => {
|
|
1106
|
-
this.#effect_pending = null;
|
|
1107
|
-
};
|
|
1108
|
-
});
|
|
1109
|
-
/**
|
|
1110
|
-
* @param {TemplateNode} node
|
|
1111
|
-
* @param {BoundaryProps} props
|
|
1112
|
-
* @param {((anchor: Node) => void)} children
|
|
1113
|
-
*/
|
|
1114
|
-
constructor(node, props, children) {
|
|
1115
|
-
this.#anchor = node;
|
|
1116
|
-
this.#props = props;
|
|
1117
|
-
this.#children = children;
|
|
1118
|
-
this.parent = /** @type {Effect} */
|
|
1119
|
-
active_effect.b;
|
|
1120
|
-
this.is_pending = !!this.#props.pending;
|
|
1121
|
-
this.#effect = block(() => {
|
|
1122
|
-
active_effect.b = this;
|
|
1123
|
-
if (hydrating) {
|
|
1124
|
-
const comment = this.#hydrate_open;
|
|
1125
|
-
hydrate_next();
|
|
1126
|
-
const server_rendered_pending = (
|
|
1127
|
-
/** @type {Comment} */
|
|
1128
|
-
comment.nodeType === COMMENT_NODE && /** @type {Comment} */
|
|
1129
|
-
comment.data === HYDRATION_START_ELSE
|
|
1130
|
-
);
|
|
1131
|
-
if (server_rendered_pending) {
|
|
1132
|
-
this.#hydrate_pending_content();
|
|
1133
|
-
} else {
|
|
1134
|
-
this.#hydrate_resolved_content();
|
|
1135
|
-
if (this.#pending_count === 0) {
|
|
1136
|
-
this.is_pending = false;
|
|
1137
|
-
}
|
|
1138
|
-
}
|
|
1139
|
-
} else {
|
|
1140
|
-
var anchor = this.#get_anchor();
|
|
1141
|
-
try {
|
|
1142
|
-
this.#main_effect = branch(() => children(anchor));
|
|
1143
|
-
} catch (error) {
|
|
1144
|
-
this.error(error);
|
|
1145
|
-
}
|
|
1146
|
-
if (this.#pending_count > 0) {
|
|
1147
|
-
this.#show_pending_snippet();
|
|
1148
|
-
} else {
|
|
1149
|
-
this.is_pending = false;
|
|
1150
|
-
}
|
|
1151
|
-
}
|
|
1152
|
-
return () => {
|
|
1153
|
-
this.#pending_anchor?.remove();
|
|
1154
|
-
};
|
|
1155
|
-
}, flags);
|
|
1156
|
-
if (hydrating) {
|
|
1157
|
-
this.#anchor = hydrate_node;
|
|
1158
|
-
}
|
|
1159
|
-
}
|
|
1160
|
-
#hydrate_resolved_content() {
|
|
1161
|
-
try {
|
|
1162
|
-
this.#main_effect = branch(() => this.#children(this.#anchor));
|
|
1163
|
-
} catch (error) {
|
|
1164
|
-
this.error(error);
|
|
1165
|
-
}
|
|
1166
|
-
}
|
|
1167
|
-
#hydrate_pending_content() {
|
|
1168
|
-
const pending = this.#props.pending;
|
|
1169
|
-
if (!pending) {
|
|
1170
|
-
return;
|
|
1171
|
-
}
|
|
1172
|
-
this.#pending_effect = branch(() => pending(this.#anchor));
|
|
1173
|
-
Batch.enqueue(() => {
|
|
1174
|
-
var anchor = this.#get_anchor();
|
|
1175
|
-
this.#main_effect = this.#run(() => {
|
|
1176
|
-
Batch.ensure();
|
|
1177
|
-
return branch(() => this.#children(anchor));
|
|
1178
|
-
});
|
|
1179
|
-
if (this.#pending_count > 0) {
|
|
1180
|
-
this.#show_pending_snippet();
|
|
1181
|
-
} else {
|
|
1182
|
-
pause_effect(
|
|
1183
|
-
/** @type {Effect} */
|
|
1184
|
-
this.#pending_effect,
|
|
1185
|
-
() => {
|
|
1186
|
-
this.#pending_effect = null;
|
|
1187
|
-
}
|
|
1188
|
-
);
|
|
1189
|
-
this.is_pending = false;
|
|
1190
|
-
}
|
|
1191
|
-
});
|
|
1192
|
-
}
|
|
1193
|
-
#get_anchor() {
|
|
1194
|
-
var anchor = this.#anchor;
|
|
1195
|
-
if (this.is_pending) {
|
|
1196
|
-
this.#pending_anchor = create_text();
|
|
1197
|
-
this.#anchor.before(this.#pending_anchor);
|
|
1198
|
-
anchor = this.#pending_anchor;
|
|
1199
|
-
}
|
|
1200
|
-
return anchor;
|
|
1201
|
-
}
|
|
1202
|
-
/**
|
|
1203
|
-
* Defer an effect inside a pending boundary until the boundary resolves
|
|
1204
|
-
* @param {Effect} effect
|
|
1205
|
-
*/
|
|
1206
|
-
defer_effect(effect) {
|
|
1207
|
-
defer_effect(effect, this.#dirty_effects, this.#maybe_dirty_effects);
|
|
1208
|
-
}
|
|
1209
|
-
/**
|
|
1210
|
-
* Returns `false` if the effect exists inside a boundary whose pending snippet is shown
|
|
1211
|
-
* @returns {boolean}
|
|
1212
|
-
*/
|
|
1213
|
-
is_rendered() {
|
|
1214
|
-
return !this.is_pending && (!this.parent || this.parent.is_rendered());
|
|
1215
|
-
}
|
|
1216
|
-
has_pending_snippet() {
|
|
1217
|
-
return !!this.#props.pending;
|
|
1218
|
-
}
|
|
1219
|
-
/**
|
|
1220
|
-
* @param {() => Effect | null} fn
|
|
1221
|
-
*/
|
|
1222
|
-
#run(fn) {
|
|
1223
|
-
var previous_effect = active_effect;
|
|
1224
|
-
var previous_reaction = active_reaction;
|
|
1225
|
-
var previous_ctx = component_context;
|
|
1226
|
-
set_active_effect(this.#effect);
|
|
1227
|
-
set_active_reaction(this.#effect);
|
|
1228
|
-
set_component_context(this.#effect.ctx);
|
|
1229
|
-
try {
|
|
1230
|
-
return fn();
|
|
1231
|
-
} catch (e) {
|
|
1232
|
-
handle_error(e);
|
|
1233
|
-
return null;
|
|
1234
|
-
} finally {
|
|
1235
|
-
set_active_effect(previous_effect);
|
|
1236
|
-
set_active_reaction(previous_reaction);
|
|
1237
|
-
set_component_context(previous_ctx);
|
|
1238
|
-
}
|
|
1239
|
-
}
|
|
1240
|
-
#show_pending_snippet() {
|
|
1241
|
-
const pending = (
|
|
1242
|
-
/** @type {(anchor: Node) => void} */
|
|
1243
|
-
this.#props.pending
|
|
1244
|
-
);
|
|
1245
|
-
if (this.#main_effect !== null) {
|
|
1246
|
-
this.#offscreen_fragment = document.createDocumentFragment();
|
|
1247
|
-
this.#offscreen_fragment.append(
|
|
1248
|
-
/** @type {TemplateNode} */
|
|
1249
|
-
this.#pending_anchor
|
|
1250
|
-
);
|
|
1251
|
-
move_effect(this.#main_effect, this.#offscreen_fragment);
|
|
1252
|
-
}
|
|
1253
|
-
if (this.#pending_effect === null) {
|
|
1254
|
-
this.#pending_effect = branch(() => pending(this.#anchor));
|
|
1255
|
-
}
|
|
1256
|
-
}
|
|
1257
|
-
/**
|
|
1258
|
-
* Updates the pending count associated with the currently visible pending snippet,
|
|
1259
|
-
* if any, such that we can replace the snippet with content once work is done
|
|
1260
|
-
* @param {1 | -1} d
|
|
1261
|
-
*/
|
|
1262
|
-
#update_pending_count(d) {
|
|
1263
|
-
if (!this.has_pending_snippet()) {
|
|
1264
|
-
if (this.parent) {
|
|
1265
|
-
this.parent.#update_pending_count(d);
|
|
1266
|
-
}
|
|
1267
|
-
return;
|
|
1268
|
-
}
|
|
1269
|
-
this.#pending_count += d;
|
|
1270
|
-
if (this.#pending_count === 0) {
|
|
1271
|
-
this.is_pending = false;
|
|
1272
|
-
for (const e of this.#dirty_effects) {
|
|
1273
|
-
set_signal_status(e, DIRTY);
|
|
1274
|
-
schedule_effect(e);
|
|
1275
|
-
}
|
|
1276
|
-
for (const e of this.#maybe_dirty_effects) {
|
|
1277
|
-
set_signal_status(e, MAYBE_DIRTY);
|
|
1278
|
-
schedule_effect(e);
|
|
1279
|
-
}
|
|
1280
|
-
this.#dirty_effects.clear();
|
|
1281
|
-
this.#maybe_dirty_effects.clear();
|
|
1282
|
-
if (this.#pending_effect) {
|
|
1283
|
-
pause_effect(this.#pending_effect, () => {
|
|
1284
|
-
this.#pending_effect = null;
|
|
1285
|
-
});
|
|
1286
|
-
}
|
|
1287
|
-
if (this.#offscreen_fragment) {
|
|
1288
|
-
this.#anchor.before(this.#offscreen_fragment);
|
|
1289
|
-
this.#offscreen_fragment = null;
|
|
1290
|
-
}
|
|
1291
|
-
}
|
|
1292
|
-
}
|
|
1293
|
-
/**
|
|
1294
|
-
* Update the source that powers `$effect.pending()` inside this boundary,
|
|
1295
|
-
* and controls when the current `pending` snippet (if any) is removed.
|
|
1296
|
-
* Do not call from inside the class
|
|
1297
|
-
* @param {1 | -1} d
|
|
1298
|
-
*/
|
|
1299
|
-
update_pending_count(d) {
|
|
1300
|
-
this.#update_pending_count(d);
|
|
1301
|
-
this.#local_pending_count += d;
|
|
1302
|
-
if (this.#effect_pending) {
|
|
1303
|
-
internal_set(this.#effect_pending, this.#local_pending_count);
|
|
1304
|
-
}
|
|
1305
|
-
}
|
|
1306
|
-
get_effect_pending() {
|
|
1307
|
-
this.#effect_pending_subscriber();
|
|
1308
|
-
return get(
|
|
1309
|
-
/** @type {Source<number>} */
|
|
1310
|
-
this.#effect_pending
|
|
1311
|
-
);
|
|
1312
|
-
}
|
|
1313
|
-
/** @param {unknown} error */
|
|
1314
|
-
error(error) {
|
|
1315
|
-
var onerror = this.#props.onerror;
|
|
1316
|
-
let failed = this.#props.failed;
|
|
1317
|
-
if (this.#is_creating_fallback || !onerror && !failed) {
|
|
1318
|
-
throw error;
|
|
1319
|
-
}
|
|
1320
|
-
if (this.#main_effect) {
|
|
1321
|
-
destroy_effect(this.#main_effect);
|
|
1322
|
-
this.#main_effect = null;
|
|
1323
|
-
}
|
|
1324
|
-
if (this.#pending_effect) {
|
|
1325
|
-
destroy_effect(this.#pending_effect);
|
|
1326
|
-
this.#pending_effect = null;
|
|
1327
|
-
}
|
|
1328
|
-
if (this.#failed_effect) {
|
|
1329
|
-
destroy_effect(this.#failed_effect);
|
|
1330
|
-
this.#failed_effect = null;
|
|
1331
|
-
}
|
|
1332
|
-
if (hydrating) {
|
|
1333
|
-
set_hydrate_node(
|
|
1334
|
-
/** @type {TemplateNode} */
|
|
1335
|
-
this.#hydrate_open
|
|
1336
|
-
);
|
|
1337
|
-
next();
|
|
1338
|
-
set_hydrate_node(skip_nodes());
|
|
1339
|
-
}
|
|
1340
|
-
var did_reset = false;
|
|
1341
|
-
var calling_on_error = false;
|
|
1342
|
-
const reset = () => {
|
|
1343
|
-
if (did_reset) {
|
|
1344
|
-
svelte_boundary_reset_noop();
|
|
1345
|
-
return;
|
|
1346
|
-
}
|
|
1347
|
-
did_reset = true;
|
|
1348
|
-
if (calling_on_error) {
|
|
1349
|
-
svelte_boundary_reset_onerror();
|
|
1350
|
-
}
|
|
1351
|
-
Batch.ensure();
|
|
1352
|
-
this.#local_pending_count = 0;
|
|
1353
|
-
if (this.#failed_effect !== null) {
|
|
1354
|
-
pause_effect(this.#failed_effect, () => {
|
|
1355
|
-
this.#failed_effect = null;
|
|
1356
|
-
});
|
|
1357
|
-
}
|
|
1358
|
-
this.is_pending = this.has_pending_snippet();
|
|
1359
|
-
this.#main_effect = this.#run(() => {
|
|
1360
|
-
this.#is_creating_fallback = false;
|
|
1361
|
-
return branch(() => this.#children(this.#anchor));
|
|
1362
|
-
});
|
|
1363
|
-
if (this.#pending_count > 0) {
|
|
1364
|
-
this.#show_pending_snippet();
|
|
1365
|
-
} else {
|
|
1366
|
-
this.is_pending = false;
|
|
1367
|
-
}
|
|
1368
|
-
};
|
|
1369
|
-
var previous_reaction = active_reaction;
|
|
1370
|
-
try {
|
|
1371
|
-
set_active_reaction(null);
|
|
1372
|
-
calling_on_error = true;
|
|
1373
|
-
onerror?.(error, reset);
|
|
1374
|
-
calling_on_error = false;
|
|
1375
|
-
} catch (error2) {
|
|
1376
|
-
invoke_error_boundary(error2, this.#effect && this.#effect.parent);
|
|
1377
|
-
} finally {
|
|
1378
|
-
set_active_reaction(previous_reaction);
|
|
1379
|
-
}
|
|
1380
|
-
if (failed) {
|
|
1381
|
-
queue_micro_task(() => {
|
|
1382
|
-
this.#failed_effect = this.#run(() => {
|
|
1383
|
-
Batch.ensure();
|
|
1384
|
-
this.#is_creating_fallback = true;
|
|
1385
|
-
try {
|
|
1386
|
-
return branch(() => {
|
|
1387
|
-
failed(
|
|
1388
|
-
this.#anchor,
|
|
1389
|
-
() => error,
|
|
1390
|
-
() => reset
|
|
1391
|
-
);
|
|
1392
|
-
});
|
|
1393
|
-
} catch (error2) {
|
|
1394
|
-
invoke_error_boundary(
|
|
1395
|
-
error2,
|
|
1396
|
-
/** @type {Effect} */
|
|
1397
|
-
this.#effect.parent
|
|
1398
|
-
);
|
|
1399
|
-
return null;
|
|
1400
|
-
} finally {
|
|
1401
|
-
this.#is_creating_fallback = false;
|
|
1402
|
-
}
|
|
1403
|
-
});
|
|
1404
|
-
});
|
|
1405
|
-
}
|
|
1406
|
-
}
|
|
1407
|
-
}
|
|
1408
|
-
function destroy_derived_effects(derived) {
|
|
1409
|
-
var effects = derived.effects;
|
|
1410
|
-
if (effects !== null) {
|
|
1411
|
-
derived.effects = null;
|
|
1412
|
-
for (var i = 0; i < effects.length; i += 1) {
|
|
1413
|
-
destroy_effect(
|
|
1414
|
-
/** @type {Effect} */
|
|
1415
|
-
effects[i]
|
|
1416
|
-
);
|
|
1417
|
-
}
|
|
1418
|
-
}
|
|
1419
|
-
}
|
|
1420
|
-
function get_derived_parent_effect(derived) {
|
|
1421
|
-
var parent = derived.parent;
|
|
1422
|
-
while (parent !== null) {
|
|
1423
|
-
if ((parent.f & DERIVED) === 0) {
|
|
1424
|
-
return (parent.f & DESTROYED) === 0 ? (
|
|
1425
|
-
/** @type {Effect} */
|
|
1426
|
-
parent
|
|
1427
|
-
) : null;
|
|
1428
|
-
}
|
|
1429
|
-
parent = parent.parent;
|
|
1430
|
-
}
|
|
1431
|
-
return null;
|
|
1432
|
-
}
|
|
1433
|
-
function execute_derived(derived) {
|
|
1434
|
-
var value;
|
|
1435
|
-
var prev_active_effect = active_effect;
|
|
1436
|
-
set_active_effect(get_derived_parent_effect(derived));
|
|
1437
|
-
{
|
|
1438
|
-
try {
|
|
1439
|
-
derived.f &= ~WAS_MARKED;
|
|
1440
|
-
destroy_derived_effects(derived);
|
|
1441
|
-
value = update_reaction(derived);
|
|
1442
|
-
} finally {
|
|
1443
|
-
set_active_effect(prev_active_effect);
|
|
1444
|
-
}
|
|
1445
|
-
}
|
|
1446
|
-
return value;
|
|
1447
|
-
}
|
|
1448
|
-
function update_derived(derived) {
|
|
1449
|
-
var value = execute_derived(derived);
|
|
1450
|
-
if (!derived.equals(value)) {
|
|
1451
|
-
derived.wv = increment_write_version();
|
|
1452
|
-
if (!current_batch?.is_fork || derived.deps === null) {
|
|
1453
|
-
derived.v = value;
|
|
1454
|
-
if (derived.deps === null) {
|
|
1455
|
-
set_signal_status(derived, CLEAN);
|
|
1456
|
-
return;
|
|
1457
|
-
}
|
|
1458
|
-
}
|
|
1459
|
-
}
|
|
1460
|
-
if (is_destroying_effect) {
|
|
1461
|
-
return;
|
|
1462
|
-
}
|
|
1463
|
-
if (batch_values !== null) {
|
|
1464
|
-
if (effect_tracking() || current_batch?.is_fork) {
|
|
1465
|
-
batch_values.set(derived, value);
|
|
1466
|
-
}
|
|
1467
|
-
} else {
|
|
1468
|
-
update_derived_status(derived);
|
|
1469
|
-
}
|
|
1470
|
-
}
|
|
1471
|
-
let eager_effects = /* @__PURE__ */ new Set();
|
|
1472
|
-
const old_values = /* @__PURE__ */ new Map();
|
|
1473
|
-
let eager_effects_deferred = false;
|
|
1474
|
-
function source(v, stack) {
|
|
1475
|
-
var signal = {
|
|
1476
|
-
f: 0,
|
|
1477
|
-
// TODO ideally we could skip this altogether, but it causes type errors
|
|
1478
|
-
v,
|
|
1479
|
-
reactions: null,
|
|
1480
|
-
equals,
|
|
1481
|
-
rv: 0,
|
|
1482
|
-
wv: 0
|
|
1483
|
-
};
|
|
1484
|
-
return signal;
|
|
1485
|
-
}
|
|
1486
|
-
// @__NO_SIDE_EFFECTS__
|
|
1487
|
-
function state(v, stack) {
|
|
1488
|
-
const s = source(v);
|
|
1489
|
-
push_reaction_value(s);
|
|
1490
|
-
return s;
|
|
1491
|
-
}
|
|
1492
|
-
// @__NO_SIDE_EFFECTS__
|
|
1493
|
-
function mutable_source(initial_value, immutable = false, trackable = true) {
|
|
1494
|
-
const s = source(initial_value);
|
|
1495
|
-
if (!immutable) {
|
|
1496
|
-
s.equals = safe_equals;
|
|
1497
|
-
}
|
|
1498
|
-
return s;
|
|
1499
|
-
}
|
|
1500
|
-
function set(source2, value, should_proxy = false) {
|
|
1501
|
-
if (active_reaction !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
|
|
1502
|
-
// to ensure we error if state is set inside an inspect effect
|
|
1503
|
-
(!untracking || (active_reaction.f & EAGER_EFFECT) !== 0) && is_runes() && (active_reaction.f & (DERIVED | BLOCK_EFFECT | ASYNC | EAGER_EFFECT)) !== 0 && !current_sources?.includes(source2)) {
|
|
1504
|
-
state_unsafe_mutation();
|
|
1505
|
-
}
|
|
1506
|
-
let new_value = should_proxy ? proxy(value) : value;
|
|
1507
|
-
return internal_set(source2, new_value);
|
|
1508
|
-
}
|
|
1509
|
-
function internal_set(source2, value) {
|
|
1510
|
-
if (!source2.equals(value)) {
|
|
1511
|
-
var old_value = source2.v;
|
|
1512
|
-
if (is_destroying_effect) {
|
|
1513
|
-
old_values.set(source2, value);
|
|
1514
|
-
} else {
|
|
1515
|
-
old_values.set(source2, old_value);
|
|
1516
|
-
}
|
|
1517
|
-
source2.v = value;
|
|
1518
|
-
var batch = Batch.ensure();
|
|
1519
|
-
batch.capture(source2, old_value);
|
|
1520
|
-
if ((source2.f & DERIVED) !== 0) {
|
|
1521
|
-
const derived = (
|
|
1522
|
-
/** @type {Derived} */
|
|
1523
|
-
source2
|
|
1524
|
-
);
|
|
1525
|
-
if ((source2.f & DIRTY) !== 0) {
|
|
1526
|
-
execute_derived(derived);
|
|
1527
|
-
}
|
|
1528
|
-
update_derived_status(derived);
|
|
1529
|
-
}
|
|
1530
|
-
source2.wv = increment_write_version();
|
|
1531
|
-
mark_reactions(source2, DIRTY);
|
|
1532
|
-
if (active_effect !== null && (active_effect.f & CLEAN) !== 0 && (active_effect.f & (BRANCH_EFFECT | ROOT_EFFECT)) === 0) {
|
|
1533
|
-
if (untracked_writes === null) {
|
|
1534
|
-
set_untracked_writes([source2]);
|
|
1535
|
-
} else {
|
|
1536
|
-
untracked_writes.push(source2);
|
|
1537
|
-
}
|
|
1538
|
-
}
|
|
1539
|
-
if (!batch.is_fork && eager_effects.size > 0 && !eager_effects_deferred) {
|
|
1540
|
-
flush_eager_effects();
|
|
1541
|
-
}
|
|
1542
|
-
}
|
|
1543
|
-
return value;
|
|
1544
|
-
}
|
|
1545
|
-
function flush_eager_effects() {
|
|
1546
|
-
eager_effects_deferred = false;
|
|
1547
|
-
var prev_is_updating_effect = is_updating_effect;
|
|
1548
|
-
set_is_updating_effect(true);
|
|
1549
|
-
const inspects = Array.from(eager_effects);
|
|
1550
|
-
try {
|
|
1551
|
-
for (const effect of inspects) {
|
|
1552
|
-
if ((effect.f & CLEAN) !== 0) {
|
|
1553
|
-
set_signal_status(effect, MAYBE_DIRTY);
|
|
1554
|
-
}
|
|
1555
|
-
if (is_dirty(effect)) {
|
|
1556
|
-
update_effect(effect);
|
|
1557
|
-
}
|
|
1558
|
-
}
|
|
1559
|
-
} finally {
|
|
1560
|
-
set_is_updating_effect(prev_is_updating_effect);
|
|
1561
|
-
}
|
|
1562
|
-
eager_effects.clear();
|
|
1563
|
-
}
|
|
1564
|
-
function increment(source2) {
|
|
1565
|
-
set(source2, source2.v + 1);
|
|
1566
|
-
}
|
|
1567
|
-
function mark_reactions(signal, status) {
|
|
1568
|
-
var reactions = signal.reactions;
|
|
1569
|
-
if (reactions === null) return;
|
|
1570
|
-
var length = reactions.length;
|
|
1571
|
-
for (var i = 0; i < length; i++) {
|
|
1572
|
-
var reaction = reactions[i];
|
|
1573
|
-
var flags2 = reaction.f;
|
|
1574
|
-
var not_dirty = (flags2 & DIRTY) === 0;
|
|
1575
|
-
if (not_dirty) {
|
|
1576
|
-
set_signal_status(reaction, status);
|
|
1577
|
-
}
|
|
1578
|
-
if ((flags2 & DERIVED) !== 0) {
|
|
1579
|
-
var derived = (
|
|
1580
|
-
/** @type {Derived} */
|
|
1581
|
-
reaction
|
|
1582
|
-
);
|
|
1583
|
-
batch_values?.delete(derived);
|
|
1584
|
-
if ((flags2 & WAS_MARKED) === 0) {
|
|
1585
|
-
if (flags2 & CONNECTED) {
|
|
1586
|
-
reaction.f |= WAS_MARKED;
|
|
1587
|
-
}
|
|
1588
|
-
mark_reactions(derived, MAYBE_DIRTY);
|
|
1589
|
-
}
|
|
1590
|
-
} else if (not_dirty) {
|
|
1591
|
-
if ((flags2 & BLOCK_EFFECT) !== 0 && eager_block_effects !== null) {
|
|
1592
|
-
eager_block_effects.add(
|
|
1593
|
-
/** @type {Effect} */
|
|
1594
|
-
reaction
|
|
1595
|
-
);
|
|
1596
|
-
}
|
|
1597
|
-
schedule_effect(
|
|
1598
|
-
/** @type {Effect} */
|
|
1599
|
-
reaction
|
|
1600
|
-
);
|
|
1601
|
-
}
|
|
1602
|
-
}
|
|
1603
|
-
}
|
|
1604
|
-
function proxy(value) {
|
|
1605
|
-
if (typeof value !== "object" || value === null || STATE_SYMBOL in value) {
|
|
1606
|
-
return value;
|
|
1607
|
-
}
|
|
1608
|
-
const prototype = get_prototype_of(value);
|
|
1609
|
-
if (prototype !== object_prototype && prototype !== array_prototype) {
|
|
1610
|
-
return value;
|
|
1611
|
-
}
|
|
1612
|
-
var sources = /* @__PURE__ */ new Map();
|
|
1613
|
-
var is_proxied_array = is_array(value);
|
|
1614
|
-
var version = /* @__PURE__ */ state(0);
|
|
1615
|
-
var parent_version = update_version;
|
|
1616
|
-
var with_parent = (fn) => {
|
|
1617
|
-
if (update_version === parent_version) {
|
|
1618
|
-
return fn();
|
|
1619
|
-
}
|
|
1620
|
-
var reaction = active_reaction;
|
|
1621
|
-
var version2 = update_version;
|
|
1622
|
-
set_active_reaction(null);
|
|
1623
|
-
set_update_version(parent_version);
|
|
1624
|
-
var result = fn();
|
|
1625
|
-
set_active_reaction(reaction);
|
|
1626
|
-
set_update_version(version2);
|
|
1627
|
-
return result;
|
|
1628
|
-
};
|
|
1629
|
-
if (is_proxied_array) {
|
|
1630
|
-
sources.set("length", /* @__PURE__ */ state(
|
|
1631
|
-
/** @type {any[]} */
|
|
1632
|
-
value.length
|
|
1633
|
-
));
|
|
1634
|
-
}
|
|
1635
|
-
return new Proxy(
|
|
1636
|
-
/** @type {any} */
|
|
1637
|
-
value,
|
|
1638
|
-
{
|
|
1639
|
-
defineProperty(_, prop, descriptor) {
|
|
1640
|
-
if (!("value" in descriptor) || descriptor.configurable === false || descriptor.enumerable === false || descriptor.writable === false) {
|
|
1641
|
-
state_descriptors_fixed();
|
|
1642
|
-
}
|
|
1643
|
-
var s = sources.get(prop);
|
|
1644
|
-
if (s === void 0) {
|
|
1645
|
-
s = with_parent(() => {
|
|
1646
|
-
var s2 = /* @__PURE__ */ state(descriptor.value);
|
|
1647
|
-
sources.set(prop, s2);
|
|
1648
|
-
return s2;
|
|
1649
|
-
});
|
|
1650
|
-
} else {
|
|
1651
|
-
set(s, descriptor.value, true);
|
|
1652
|
-
}
|
|
1653
|
-
return true;
|
|
1654
|
-
},
|
|
1655
|
-
deleteProperty(target, prop) {
|
|
1656
|
-
var s = sources.get(prop);
|
|
1657
|
-
if (s === void 0) {
|
|
1658
|
-
if (prop in target) {
|
|
1659
|
-
const s2 = with_parent(() => /* @__PURE__ */ state(UNINITIALIZED));
|
|
1660
|
-
sources.set(prop, s2);
|
|
1661
|
-
increment(version);
|
|
1662
|
-
}
|
|
1663
|
-
} else {
|
|
1664
|
-
set(s, UNINITIALIZED);
|
|
1665
|
-
increment(version);
|
|
1666
|
-
}
|
|
1667
|
-
return true;
|
|
1668
|
-
},
|
|
1669
|
-
get(target, prop, receiver) {
|
|
1670
|
-
if (prop === STATE_SYMBOL) {
|
|
1671
|
-
return value;
|
|
1672
|
-
}
|
|
1673
|
-
var s = sources.get(prop);
|
|
1674
|
-
var exists = prop in target;
|
|
1675
|
-
if (s === void 0 && (!exists || get_descriptor(target, prop)?.writable)) {
|
|
1676
|
-
s = with_parent(() => {
|
|
1677
|
-
var p = proxy(exists ? target[prop] : UNINITIALIZED);
|
|
1678
|
-
var s2 = /* @__PURE__ */ state(p);
|
|
1679
|
-
return s2;
|
|
1680
|
-
});
|
|
1681
|
-
sources.set(prop, s);
|
|
1682
|
-
}
|
|
1683
|
-
if (s !== void 0) {
|
|
1684
|
-
var v = get(s);
|
|
1685
|
-
return v === UNINITIALIZED ? void 0 : v;
|
|
1686
|
-
}
|
|
1687
|
-
return Reflect.get(target, prop, receiver);
|
|
1688
|
-
},
|
|
1689
|
-
getOwnPropertyDescriptor(target, prop) {
|
|
1690
|
-
var descriptor = Reflect.getOwnPropertyDescriptor(target, prop);
|
|
1691
|
-
if (descriptor && "value" in descriptor) {
|
|
1692
|
-
var s = sources.get(prop);
|
|
1693
|
-
if (s) descriptor.value = get(s);
|
|
1694
|
-
} else if (descriptor === void 0) {
|
|
1695
|
-
var source2 = sources.get(prop);
|
|
1696
|
-
var value2 = source2?.v;
|
|
1697
|
-
if (source2 !== void 0 && value2 !== UNINITIALIZED) {
|
|
1698
|
-
return {
|
|
1699
|
-
enumerable: true,
|
|
1700
|
-
configurable: true,
|
|
1701
|
-
value: value2,
|
|
1702
|
-
writable: true
|
|
1703
|
-
};
|
|
1704
|
-
}
|
|
1705
|
-
}
|
|
1706
|
-
return descriptor;
|
|
1707
|
-
},
|
|
1708
|
-
has(target, prop) {
|
|
1709
|
-
if (prop === STATE_SYMBOL) {
|
|
1710
|
-
return true;
|
|
1711
|
-
}
|
|
1712
|
-
var s = sources.get(prop);
|
|
1713
|
-
var has = s !== void 0 && s.v !== UNINITIALIZED || Reflect.has(target, prop);
|
|
1714
|
-
if (s !== void 0 || active_effect !== null && (!has || get_descriptor(target, prop)?.writable)) {
|
|
1715
|
-
if (s === void 0) {
|
|
1716
|
-
s = with_parent(() => {
|
|
1717
|
-
var p = has ? proxy(target[prop]) : UNINITIALIZED;
|
|
1718
|
-
var s2 = /* @__PURE__ */ state(p);
|
|
1719
|
-
return s2;
|
|
1720
|
-
});
|
|
1721
|
-
sources.set(prop, s);
|
|
1722
|
-
}
|
|
1723
|
-
var value2 = get(s);
|
|
1724
|
-
if (value2 === UNINITIALIZED) {
|
|
1725
|
-
return false;
|
|
1726
|
-
}
|
|
1727
|
-
}
|
|
1728
|
-
return has;
|
|
1729
|
-
},
|
|
1730
|
-
set(target, prop, value2, receiver) {
|
|
1731
|
-
var s = sources.get(prop);
|
|
1732
|
-
var has = prop in target;
|
|
1733
|
-
if (is_proxied_array && prop === "length") {
|
|
1734
|
-
for (var i = value2; i < /** @type {Source<number>} */
|
|
1735
|
-
s.v; i += 1) {
|
|
1736
|
-
var other_s = sources.get(i + "");
|
|
1737
|
-
if (other_s !== void 0) {
|
|
1738
|
-
set(other_s, UNINITIALIZED);
|
|
1739
|
-
} else if (i in target) {
|
|
1740
|
-
other_s = with_parent(() => /* @__PURE__ */ state(UNINITIALIZED));
|
|
1741
|
-
sources.set(i + "", other_s);
|
|
1742
|
-
}
|
|
1743
|
-
}
|
|
1744
|
-
}
|
|
1745
|
-
if (s === void 0) {
|
|
1746
|
-
if (!has || get_descriptor(target, prop)?.writable) {
|
|
1747
|
-
s = with_parent(() => /* @__PURE__ */ state(void 0));
|
|
1748
|
-
set(s, proxy(value2));
|
|
1749
|
-
sources.set(prop, s);
|
|
1750
|
-
}
|
|
1751
|
-
} else {
|
|
1752
|
-
has = s.v !== UNINITIALIZED;
|
|
1753
|
-
var p = with_parent(() => proxy(value2));
|
|
1754
|
-
set(s, p);
|
|
1755
|
-
}
|
|
1756
|
-
var descriptor = Reflect.getOwnPropertyDescriptor(target, prop);
|
|
1757
|
-
if (descriptor?.set) {
|
|
1758
|
-
descriptor.set.call(receiver, value2);
|
|
1759
|
-
}
|
|
1760
|
-
if (!has) {
|
|
1761
|
-
if (is_proxied_array && typeof prop === "string") {
|
|
1762
|
-
var ls = (
|
|
1763
|
-
/** @type {Source<number>} */
|
|
1764
|
-
sources.get("length")
|
|
1765
|
-
);
|
|
1766
|
-
var n = Number(prop);
|
|
1767
|
-
if (Number.isInteger(n) && n >= ls.v) {
|
|
1768
|
-
set(ls, n + 1);
|
|
1769
|
-
}
|
|
1770
|
-
}
|
|
1771
|
-
increment(version);
|
|
1772
|
-
}
|
|
1773
|
-
return true;
|
|
1774
|
-
},
|
|
1775
|
-
ownKeys(target) {
|
|
1776
|
-
get(version);
|
|
1777
|
-
var own_keys = Reflect.ownKeys(target).filter((key2) => {
|
|
1778
|
-
var source3 = sources.get(key2);
|
|
1779
|
-
return source3 === void 0 || source3.v !== UNINITIALIZED;
|
|
1780
|
-
});
|
|
1781
|
-
for (var [key, source2] of sources) {
|
|
1782
|
-
if (source2.v !== UNINITIALIZED && !(key in target)) {
|
|
1783
|
-
own_keys.push(key);
|
|
1784
|
-
}
|
|
1785
|
-
}
|
|
1786
|
-
return own_keys;
|
|
1787
|
-
},
|
|
1788
|
-
setPrototypeOf() {
|
|
1789
|
-
state_prototype_fixed();
|
|
1790
|
-
}
|
|
1791
|
-
}
|
|
1792
|
-
);
|
|
1793
|
-
}
|
|
1794
|
-
var $window;
|
|
1795
|
-
var first_child_getter;
|
|
1796
|
-
var next_sibling_getter;
|
|
1797
|
-
function init_operations() {
|
|
1798
|
-
if ($window !== void 0) {
|
|
1799
|
-
return;
|
|
1800
|
-
}
|
|
1801
|
-
$window = window;
|
|
1802
|
-
var element_prototype = Element.prototype;
|
|
1803
|
-
var node_prototype = Node.prototype;
|
|
1804
|
-
var text_prototype = Text.prototype;
|
|
1805
|
-
first_child_getter = get_descriptor(node_prototype, "firstChild").get;
|
|
1806
|
-
next_sibling_getter = get_descriptor(node_prototype, "nextSibling").get;
|
|
1807
|
-
if (is_extensible(element_prototype)) {
|
|
1808
|
-
element_prototype.__click = void 0;
|
|
1809
|
-
element_prototype.__className = void 0;
|
|
1810
|
-
element_prototype.__attributes = null;
|
|
1811
|
-
element_prototype.__style = void 0;
|
|
1812
|
-
element_prototype.__e = void 0;
|
|
1813
|
-
}
|
|
1814
|
-
if (is_extensible(text_prototype)) {
|
|
1815
|
-
text_prototype.__t = void 0;
|
|
1816
|
-
}
|
|
1817
|
-
}
|
|
1818
|
-
function create_text(value = "") {
|
|
1819
|
-
return document.createTextNode(value);
|
|
1820
|
-
}
|
|
1821
|
-
// @__NO_SIDE_EFFECTS__
|
|
1822
|
-
function get_first_child(node) {
|
|
1823
|
-
return (
|
|
1824
|
-
/** @type {TemplateNode | null} */
|
|
1825
|
-
first_child_getter.call(node)
|
|
1826
|
-
);
|
|
1827
|
-
}
|
|
1828
|
-
// @__NO_SIDE_EFFECTS__
|
|
1829
|
-
function get_next_sibling(node) {
|
|
1830
|
-
return (
|
|
1831
|
-
/** @type {TemplateNode | null} */
|
|
1832
|
-
next_sibling_getter.call(node)
|
|
1833
|
-
);
|
|
1834
|
-
}
|
|
1835
|
-
function clear_text_content(node) {
|
|
1836
|
-
node.textContent = "";
|
|
1837
|
-
}
|
|
1838
|
-
function without_reactive_context(fn) {
|
|
1839
|
-
var previous_reaction = active_reaction;
|
|
1840
|
-
var previous_effect = active_effect;
|
|
1841
|
-
set_active_reaction(null);
|
|
1842
|
-
set_active_effect(null);
|
|
1843
|
-
try {
|
|
1844
|
-
return fn();
|
|
1845
|
-
} finally {
|
|
1846
|
-
set_active_reaction(previous_reaction);
|
|
1847
|
-
set_active_effect(previous_effect);
|
|
1848
|
-
}
|
|
1849
|
-
}
|
|
1850
|
-
function push_effect(effect, parent_effect) {
|
|
1851
|
-
var parent_last = parent_effect.last;
|
|
1852
|
-
if (parent_last === null) {
|
|
1853
|
-
parent_effect.last = parent_effect.first = effect;
|
|
1854
|
-
} else {
|
|
1855
|
-
parent_last.next = effect;
|
|
1856
|
-
effect.prev = parent_last;
|
|
1857
|
-
parent_effect.last = effect;
|
|
1858
|
-
}
|
|
1859
|
-
}
|
|
1860
|
-
function create_effect(type, fn, sync) {
|
|
1861
|
-
var parent = active_effect;
|
|
1862
|
-
if (parent !== null && (parent.f & INERT) !== 0) {
|
|
1863
|
-
type |= INERT;
|
|
1864
|
-
}
|
|
1865
|
-
var effect = {
|
|
1866
|
-
ctx: component_context,
|
|
1867
|
-
deps: null,
|
|
1868
|
-
nodes: null,
|
|
1869
|
-
f: type | DIRTY | CONNECTED,
|
|
1870
|
-
first: null,
|
|
1871
|
-
fn,
|
|
1872
|
-
last: null,
|
|
1873
|
-
next: null,
|
|
1874
|
-
parent,
|
|
1875
|
-
b: parent && parent.b,
|
|
1876
|
-
prev: null,
|
|
1877
|
-
teardown: null,
|
|
1878
|
-
wv: 0,
|
|
1879
|
-
ac: null
|
|
1880
|
-
};
|
|
1881
|
-
if (sync) {
|
|
1882
|
-
try {
|
|
1883
|
-
update_effect(effect);
|
|
1884
|
-
effect.f |= EFFECT_RAN;
|
|
1885
|
-
} catch (e2) {
|
|
1886
|
-
destroy_effect(effect);
|
|
1887
|
-
throw e2;
|
|
1888
|
-
}
|
|
1889
|
-
} else if (fn !== null) {
|
|
1890
|
-
schedule_effect(effect);
|
|
1891
|
-
}
|
|
1892
|
-
var e = effect;
|
|
1893
|
-
if (sync && e.deps === null && e.teardown === null && e.nodes === null && e.first === e.last && // either `null`, or a singular child
|
|
1894
|
-
(e.f & EFFECT_PRESERVED) === 0) {
|
|
1895
|
-
e = e.first;
|
|
1896
|
-
if ((type & BLOCK_EFFECT) !== 0 && (type & EFFECT_TRANSPARENT) !== 0 && e !== null) {
|
|
1897
|
-
e.f |= EFFECT_TRANSPARENT;
|
|
1898
|
-
}
|
|
1899
|
-
}
|
|
1900
|
-
if (e !== null) {
|
|
1901
|
-
e.parent = parent;
|
|
1902
|
-
if (parent !== null) {
|
|
1903
|
-
push_effect(e, parent);
|
|
1904
|
-
}
|
|
1905
|
-
if (active_reaction !== null && (active_reaction.f & DERIVED) !== 0 && (type & ROOT_EFFECT) === 0) {
|
|
1906
|
-
var derived = (
|
|
1907
|
-
/** @type {Derived} */
|
|
1908
|
-
active_reaction
|
|
1909
|
-
);
|
|
1910
|
-
(derived.effects ??= []).push(e);
|
|
1911
|
-
}
|
|
1912
|
-
}
|
|
1913
|
-
return effect;
|
|
1914
|
-
}
|
|
1915
|
-
function effect_tracking() {
|
|
1916
|
-
return active_reaction !== null && !untracking;
|
|
1917
|
-
}
|
|
1918
|
-
function create_user_effect(fn) {
|
|
1919
|
-
return create_effect(EFFECT | USER_EFFECT, fn, false);
|
|
1920
|
-
}
|
|
1921
|
-
function component_root(fn) {
|
|
1922
|
-
Batch.ensure();
|
|
1923
|
-
const effect = create_effect(ROOT_EFFECT | EFFECT_PRESERVED, fn, true);
|
|
1924
|
-
return (options2 = {}) => {
|
|
1925
|
-
return new Promise((fulfil) => {
|
|
1926
|
-
if (options2.outro) {
|
|
1927
|
-
pause_effect(effect, () => {
|
|
1928
|
-
destroy_effect(effect);
|
|
1929
|
-
fulfil(void 0);
|
|
1930
|
-
});
|
|
1931
|
-
} else {
|
|
1932
|
-
destroy_effect(effect);
|
|
1933
|
-
fulfil(void 0);
|
|
1934
|
-
}
|
|
1935
|
-
});
|
|
1936
|
-
};
|
|
1937
|
-
}
|
|
1938
|
-
function render_effect(fn, flags2 = 0) {
|
|
1939
|
-
return create_effect(RENDER_EFFECT | flags2, fn, true);
|
|
1940
|
-
}
|
|
1941
|
-
function block(fn, flags2 = 0) {
|
|
1942
|
-
var effect = create_effect(BLOCK_EFFECT | flags2, fn, true);
|
|
1943
|
-
return effect;
|
|
1944
|
-
}
|
|
1945
|
-
function branch(fn) {
|
|
1946
|
-
return create_effect(BRANCH_EFFECT | EFFECT_PRESERVED, fn, true);
|
|
1947
|
-
}
|
|
1948
|
-
function execute_effect_teardown(effect) {
|
|
1949
|
-
var teardown = effect.teardown;
|
|
1950
|
-
if (teardown !== null) {
|
|
1951
|
-
const previously_destroying_effect = is_destroying_effect;
|
|
1952
|
-
const previous_reaction = active_reaction;
|
|
1953
|
-
set_is_destroying_effect(true);
|
|
1954
|
-
set_active_reaction(null);
|
|
1955
|
-
try {
|
|
1956
|
-
teardown.call(null);
|
|
1957
|
-
} finally {
|
|
1958
|
-
set_is_destroying_effect(previously_destroying_effect);
|
|
1959
|
-
set_active_reaction(previous_reaction);
|
|
1960
|
-
}
|
|
1961
|
-
}
|
|
1962
|
-
}
|
|
1963
|
-
function destroy_effect_children(signal, remove_dom = false) {
|
|
1964
|
-
var effect = signal.first;
|
|
1965
|
-
signal.first = signal.last = null;
|
|
1966
|
-
while (effect !== null) {
|
|
1967
|
-
const controller = effect.ac;
|
|
1968
|
-
if (controller !== null) {
|
|
1969
|
-
without_reactive_context(() => {
|
|
1970
|
-
controller.abort(STALE_REACTION);
|
|
1971
|
-
});
|
|
1972
|
-
}
|
|
1973
|
-
var next2 = effect.next;
|
|
1974
|
-
if ((effect.f & ROOT_EFFECT) !== 0) {
|
|
1975
|
-
effect.parent = null;
|
|
1976
|
-
} else {
|
|
1977
|
-
destroy_effect(effect, remove_dom);
|
|
1978
|
-
}
|
|
1979
|
-
effect = next2;
|
|
1980
|
-
}
|
|
1981
|
-
}
|
|
1982
|
-
function destroy_block_effect_children(signal) {
|
|
1983
|
-
var effect = signal.first;
|
|
1984
|
-
while (effect !== null) {
|
|
1985
|
-
var next2 = effect.next;
|
|
1986
|
-
if ((effect.f & BRANCH_EFFECT) === 0) {
|
|
1987
|
-
destroy_effect(effect);
|
|
1988
|
-
}
|
|
1989
|
-
effect = next2;
|
|
1990
|
-
}
|
|
1991
|
-
}
|
|
1992
|
-
function destroy_effect(effect, remove_dom = true) {
|
|
1993
|
-
var removed = false;
|
|
1994
|
-
if ((remove_dom || (effect.f & HEAD_EFFECT) !== 0) && effect.nodes !== null && effect.nodes.end !== null) {
|
|
1995
|
-
remove_effect_dom(
|
|
1996
|
-
effect.nodes.start,
|
|
1997
|
-
/** @type {TemplateNode} */
|
|
1998
|
-
effect.nodes.end
|
|
1999
|
-
);
|
|
2000
|
-
removed = true;
|
|
2001
|
-
}
|
|
2002
|
-
destroy_effect_children(effect, remove_dom && !removed);
|
|
2003
|
-
remove_reactions(effect, 0);
|
|
2004
|
-
set_signal_status(effect, DESTROYED);
|
|
2005
|
-
var transitions = effect.nodes && effect.nodes.t;
|
|
2006
|
-
if (transitions !== null) {
|
|
2007
|
-
for (const transition of transitions) {
|
|
2008
|
-
transition.stop();
|
|
2009
|
-
}
|
|
2010
|
-
}
|
|
2011
|
-
execute_effect_teardown(effect);
|
|
2012
|
-
var parent = effect.parent;
|
|
2013
|
-
if (parent !== null && parent.first !== null) {
|
|
2014
|
-
unlink_effect(effect);
|
|
2015
|
-
}
|
|
2016
|
-
effect.next = effect.prev = effect.teardown = effect.ctx = effect.deps = effect.fn = effect.nodes = effect.ac = null;
|
|
2017
|
-
}
|
|
2018
|
-
function remove_effect_dom(node, end) {
|
|
2019
|
-
while (node !== null) {
|
|
2020
|
-
var next2 = node === end ? null : /* @__PURE__ */ get_next_sibling(node);
|
|
2021
|
-
node.remove();
|
|
2022
|
-
node = next2;
|
|
2023
|
-
}
|
|
2024
|
-
}
|
|
2025
|
-
function unlink_effect(effect) {
|
|
2026
|
-
var parent = effect.parent;
|
|
2027
|
-
var prev = effect.prev;
|
|
2028
|
-
var next2 = effect.next;
|
|
2029
|
-
if (prev !== null) prev.next = next2;
|
|
2030
|
-
if (next2 !== null) next2.prev = prev;
|
|
2031
|
-
if (parent !== null) {
|
|
2032
|
-
if (parent.first === effect) parent.first = next2;
|
|
2033
|
-
if (parent.last === effect) parent.last = prev;
|
|
2034
|
-
}
|
|
2035
|
-
}
|
|
2036
|
-
function pause_effect(effect, callback, destroy = true) {
|
|
2037
|
-
var transitions = [];
|
|
2038
|
-
pause_children(effect, transitions, true);
|
|
2039
|
-
var fn = () => {
|
|
2040
|
-
if (destroy) destroy_effect(effect);
|
|
2041
|
-
if (callback) callback();
|
|
2042
|
-
};
|
|
2043
|
-
var remaining = transitions.length;
|
|
2044
|
-
if (remaining > 0) {
|
|
2045
|
-
var check = () => --remaining || fn();
|
|
2046
|
-
for (var transition of transitions) {
|
|
2047
|
-
transition.out(check);
|
|
2048
|
-
}
|
|
2049
|
-
} else {
|
|
2050
|
-
fn();
|
|
2051
|
-
}
|
|
2052
|
-
}
|
|
2053
|
-
function pause_children(effect, transitions, local) {
|
|
2054
|
-
if ((effect.f & INERT) !== 0) return;
|
|
2055
|
-
effect.f ^= INERT;
|
|
2056
|
-
var t = effect.nodes && effect.nodes.t;
|
|
2057
|
-
if (t !== null) {
|
|
2058
|
-
for (const transition of t) {
|
|
2059
|
-
if (transition.is_global || local) {
|
|
2060
|
-
transitions.push(transition);
|
|
2061
|
-
}
|
|
2062
|
-
}
|
|
2063
|
-
}
|
|
2064
|
-
var child = effect.first;
|
|
2065
|
-
while (child !== null) {
|
|
2066
|
-
var sibling = child.next;
|
|
2067
|
-
var transparent = (child.f & EFFECT_TRANSPARENT) !== 0 || // If this is a branch effect without a block effect parent,
|
|
2068
|
-
// it means the parent block effect was pruned. In that case,
|
|
2069
|
-
// transparency information was transferred to the branch effect.
|
|
2070
|
-
(child.f & BRANCH_EFFECT) !== 0 && (effect.f & BLOCK_EFFECT) !== 0;
|
|
2071
|
-
pause_children(child, transitions, transparent ? local : false);
|
|
2072
|
-
child = sibling;
|
|
2073
|
-
}
|
|
2074
|
-
}
|
|
2075
|
-
function move_effect(effect, fragment) {
|
|
2076
|
-
if (!effect.nodes) return;
|
|
2077
|
-
var node = effect.nodes.start;
|
|
2078
|
-
var end = effect.nodes.end;
|
|
2079
|
-
while (node !== null) {
|
|
2080
|
-
var next2 = node === end ? null : /* @__PURE__ */ get_next_sibling(node);
|
|
2081
|
-
fragment.append(node);
|
|
2082
|
-
node = next2;
|
|
2083
|
-
}
|
|
2084
|
-
}
|
|
2085
|
-
let is_updating_effect = false;
|
|
2086
|
-
function set_is_updating_effect(value) {
|
|
2087
|
-
is_updating_effect = value;
|
|
2088
|
-
}
|
|
2089
|
-
let is_destroying_effect = false;
|
|
2090
|
-
function set_is_destroying_effect(value) {
|
|
2091
|
-
is_destroying_effect = value;
|
|
2092
|
-
}
|
|
2093
|
-
let active_reaction = null;
|
|
2094
|
-
let untracking = false;
|
|
2095
|
-
function set_active_reaction(reaction) {
|
|
2096
|
-
active_reaction = reaction;
|
|
2097
|
-
}
|
|
2098
|
-
let active_effect = null;
|
|
2099
|
-
function set_active_effect(effect) {
|
|
2100
|
-
active_effect = effect;
|
|
2101
|
-
}
|
|
2102
|
-
let current_sources = null;
|
|
2103
|
-
function push_reaction_value(value) {
|
|
2104
|
-
if (active_reaction !== null && (!async_mode_flag || (active_reaction.f & DERIVED) !== 0)) {
|
|
2105
|
-
if (current_sources === null) {
|
|
2106
|
-
current_sources = [value];
|
|
2107
|
-
} else {
|
|
2108
|
-
current_sources.push(value);
|
|
2109
|
-
}
|
|
2110
|
-
}
|
|
2111
|
-
}
|
|
2112
|
-
let new_deps = null;
|
|
2113
|
-
let skipped_deps = 0;
|
|
2114
|
-
let untracked_writes = null;
|
|
2115
|
-
function set_untracked_writes(value) {
|
|
2116
|
-
untracked_writes = value;
|
|
2117
|
-
}
|
|
2118
|
-
let write_version = 1;
|
|
2119
|
-
let read_version = 0;
|
|
2120
|
-
let update_version = read_version;
|
|
2121
|
-
function set_update_version(value) {
|
|
2122
|
-
update_version = value;
|
|
2123
|
-
}
|
|
2124
|
-
function increment_write_version() {
|
|
2125
|
-
return ++write_version;
|
|
2126
|
-
}
|
|
2127
|
-
function is_dirty(reaction) {
|
|
2128
|
-
var flags2 = reaction.f;
|
|
2129
|
-
if ((flags2 & DIRTY) !== 0) {
|
|
2130
|
-
return true;
|
|
2131
|
-
}
|
|
2132
|
-
if (flags2 & DERIVED) {
|
|
2133
|
-
reaction.f &= ~WAS_MARKED;
|
|
2134
|
-
}
|
|
2135
|
-
if ((flags2 & MAYBE_DIRTY) !== 0) {
|
|
2136
|
-
var dependencies = (
|
|
2137
|
-
/** @type {Value[]} */
|
|
2138
|
-
reaction.deps
|
|
2139
|
-
);
|
|
2140
|
-
var length = dependencies.length;
|
|
2141
|
-
for (var i = 0; i < length; i++) {
|
|
2142
|
-
var dependency = dependencies[i];
|
|
2143
|
-
if (is_dirty(
|
|
2144
|
-
/** @type {Derived} */
|
|
2145
|
-
dependency
|
|
2146
|
-
)) {
|
|
2147
|
-
update_derived(
|
|
2148
|
-
/** @type {Derived} */
|
|
2149
|
-
dependency
|
|
2150
|
-
);
|
|
2151
|
-
}
|
|
2152
|
-
if (dependency.wv > reaction.wv) {
|
|
2153
|
-
return true;
|
|
2154
|
-
}
|
|
2155
|
-
}
|
|
2156
|
-
if ((flags2 & CONNECTED) !== 0 && // During time traveling we don't want to reset the status so that
|
|
2157
|
-
// traversal of the graph in the other batches still happens
|
|
2158
|
-
batch_values === null) {
|
|
2159
|
-
set_signal_status(reaction, CLEAN);
|
|
2160
|
-
}
|
|
2161
|
-
}
|
|
2162
|
-
return false;
|
|
2163
|
-
}
|
|
2164
|
-
function schedule_possible_effect_self_invalidation(signal, effect, root2 = true) {
|
|
2165
|
-
var reactions = signal.reactions;
|
|
2166
|
-
if (reactions === null) return;
|
|
2167
|
-
if (!async_mode_flag && current_sources?.includes(signal)) {
|
|
2168
|
-
return;
|
|
2169
|
-
}
|
|
2170
|
-
for (var i = 0; i < reactions.length; i++) {
|
|
2171
|
-
var reaction = reactions[i];
|
|
2172
|
-
if ((reaction.f & DERIVED) !== 0) {
|
|
2173
|
-
schedule_possible_effect_self_invalidation(
|
|
2174
|
-
/** @type {Derived} */
|
|
2175
|
-
reaction,
|
|
2176
|
-
effect,
|
|
2177
|
-
false
|
|
2178
|
-
);
|
|
2179
|
-
} else if (effect === reaction) {
|
|
2180
|
-
if (root2) {
|
|
2181
|
-
set_signal_status(reaction, DIRTY);
|
|
2182
|
-
} else if ((reaction.f & CLEAN) !== 0) {
|
|
2183
|
-
set_signal_status(reaction, MAYBE_DIRTY);
|
|
2184
|
-
}
|
|
2185
|
-
schedule_effect(
|
|
2186
|
-
/** @type {Effect} */
|
|
2187
|
-
reaction
|
|
2188
|
-
);
|
|
2189
|
-
}
|
|
2190
|
-
}
|
|
2191
|
-
}
|
|
2192
|
-
function update_reaction(reaction) {
|
|
2193
|
-
var previous_deps = new_deps;
|
|
2194
|
-
var previous_skipped_deps = skipped_deps;
|
|
2195
|
-
var previous_untracked_writes = untracked_writes;
|
|
2196
|
-
var previous_reaction = active_reaction;
|
|
2197
|
-
var previous_sources = current_sources;
|
|
2198
|
-
var previous_component_context = component_context;
|
|
2199
|
-
var previous_untracking = untracking;
|
|
2200
|
-
var previous_update_version = update_version;
|
|
2201
|
-
var flags2 = reaction.f;
|
|
2202
|
-
new_deps = /** @type {null | Value[]} */
|
|
2203
|
-
null;
|
|
2204
|
-
skipped_deps = 0;
|
|
2205
|
-
untracked_writes = null;
|
|
2206
|
-
active_reaction = (flags2 & (BRANCH_EFFECT | ROOT_EFFECT)) === 0 ? reaction : null;
|
|
2207
|
-
current_sources = null;
|
|
2208
|
-
set_component_context(reaction.ctx);
|
|
2209
|
-
untracking = false;
|
|
2210
|
-
update_version = ++read_version;
|
|
2211
|
-
if (reaction.ac !== null) {
|
|
2212
|
-
without_reactive_context(() => {
|
|
2213
|
-
reaction.ac.abort(STALE_REACTION);
|
|
2214
|
-
});
|
|
2215
|
-
reaction.ac = null;
|
|
2216
|
-
}
|
|
2217
|
-
try {
|
|
2218
|
-
reaction.f |= REACTION_IS_UPDATING;
|
|
2219
|
-
var fn = (
|
|
2220
|
-
/** @type {Function} */
|
|
2221
|
-
reaction.fn
|
|
2222
|
-
);
|
|
2223
|
-
var result = fn();
|
|
2224
|
-
var deps = reaction.deps;
|
|
2225
|
-
if (new_deps !== null) {
|
|
2226
|
-
var i;
|
|
2227
|
-
remove_reactions(reaction, skipped_deps);
|
|
2228
|
-
if (deps !== null && skipped_deps > 0) {
|
|
2229
|
-
deps.length = skipped_deps + new_deps.length;
|
|
2230
|
-
for (i = 0; i < new_deps.length; i++) {
|
|
2231
|
-
deps[skipped_deps + i] = new_deps[i];
|
|
2232
|
-
}
|
|
2233
|
-
} else {
|
|
2234
|
-
reaction.deps = deps = new_deps;
|
|
2235
|
-
}
|
|
2236
|
-
if (effect_tracking() && (reaction.f & CONNECTED) !== 0) {
|
|
2237
|
-
for (i = skipped_deps; i < deps.length; i++) {
|
|
2238
|
-
(deps[i].reactions ??= []).push(reaction);
|
|
2239
|
-
}
|
|
2240
|
-
}
|
|
2241
|
-
} else if (deps !== null && skipped_deps < deps.length) {
|
|
2242
|
-
remove_reactions(reaction, skipped_deps);
|
|
2243
|
-
deps.length = skipped_deps;
|
|
2244
|
-
}
|
|
2245
|
-
if (is_runes() && untracked_writes !== null && !untracking && deps !== null && (reaction.f & (DERIVED | MAYBE_DIRTY | DIRTY)) === 0) {
|
|
2246
|
-
for (i = 0; i < /** @type {Source[]} */
|
|
2247
|
-
untracked_writes.length; i++) {
|
|
2248
|
-
schedule_possible_effect_self_invalidation(
|
|
2249
|
-
untracked_writes[i],
|
|
2250
|
-
/** @type {Effect} */
|
|
2251
|
-
reaction
|
|
2252
|
-
);
|
|
2253
|
-
}
|
|
2254
|
-
}
|
|
2255
|
-
if (previous_reaction !== null && previous_reaction !== reaction) {
|
|
2256
|
-
read_version++;
|
|
2257
|
-
if (untracked_writes !== null) {
|
|
2258
|
-
if (previous_untracked_writes === null) {
|
|
2259
|
-
previous_untracked_writes = untracked_writes;
|
|
2260
|
-
} else {
|
|
2261
|
-
previous_untracked_writes.push(.../** @type {Source[]} */
|
|
2262
|
-
untracked_writes);
|
|
2263
|
-
}
|
|
2264
|
-
}
|
|
2265
|
-
}
|
|
2266
|
-
if ((reaction.f & ERROR_VALUE) !== 0) {
|
|
2267
|
-
reaction.f ^= ERROR_VALUE;
|
|
2268
|
-
}
|
|
2269
|
-
return result;
|
|
2270
|
-
} catch (error) {
|
|
2271
|
-
return handle_error(error);
|
|
2272
|
-
} finally {
|
|
2273
|
-
reaction.f ^= REACTION_IS_UPDATING;
|
|
2274
|
-
new_deps = previous_deps;
|
|
2275
|
-
skipped_deps = previous_skipped_deps;
|
|
2276
|
-
untracked_writes = previous_untracked_writes;
|
|
2277
|
-
active_reaction = previous_reaction;
|
|
2278
|
-
current_sources = previous_sources;
|
|
2279
|
-
set_component_context(previous_component_context);
|
|
2280
|
-
untracking = previous_untracking;
|
|
2281
|
-
update_version = previous_update_version;
|
|
2282
|
-
}
|
|
2283
|
-
}
|
|
2284
|
-
function remove_reaction(signal, dependency) {
|
|
2285
|
-
let reactions = dependency.reactions;
|
|
2286
|
-
if (reactions !== null) {
|
|
2287
|
-
var index = index_of.call(reactions, signal);
|
|
2288
|
-
if (index !== -1) {
|
|
2289
|
-
var new_length = reactions.length - 1;
|
|
2290
|
-
if (new_length === 0) {
|
|
2291
|
-
reactions = dependency.reactions = null;
|
|
2292
|
-
} else {
|
|
2293
|
-
reactions[index] = reactions[new_length];
|
|
2294
|
-
reactions.pop();
|
|
2295
|
-
}
|
|
2296
|
-
}
|
|
2297
|
-
}
|
|
2298
|
-
if (reactions === null && (dependency.f & DERIVED) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
|
|
2299
|
-
// to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
|
|
2300
|
-
// allows us to skip the expensive work of disconnecting and immediately reconnecting it
|
|
2301
|
-
(new_deps === null || !new_deps.includes(dependency))) {
|
|
2302
|
-
var derived = (
|
|
2303
|
-
/** @type {Derived} */
|
|
2304
|
-
dependency
|
|
2305
|
-
);
|
|
2306
|
-
if ((derived.f & CONNECTED) !== 0) {
|
|
2307
|
-
derived.f ^= CONNECTED;
|
|
2308
|
-
derived.f &= ~WAS_MARKED;
|
|
2309
|
-
}
|
|
2310
|
-
update_derived_status(derived);
|
|
2311
|
-
destroy_derived_effects(derived);
|
|
2312
|
-
remove_reactions(derived, 0);
|
|
2313
|
-
}
|
|
2314
|
-
}
|
|
2315
|
-
function remove_reactions(signal, start_index) {
|
|
2316
|
-
var dependencies = signal.deps;
|
|
2317
|
-
if (dependencies === null) return;
|
|
2318
|
-
for (var i = start_index; i < dependencies.length; i++) {
|
|
2319
|
-
remove_reaction(signal, dependencies[i]);
|
|
2320
|
-
}
|
|
2321
|
-
}
|
|
2322
|
-
function update_effect(effect) {
|
|
2323
|
-
var flags2 = effect.f;
|
|
2324
|
-
if ((flags2 & DESTROYED) !== 0) {
|
|
2325
|
-
return;
|
|
2326
|
-
}
|
|
2327
|
-
set_signal_status(effect, CLEAN);
|
|
2328
|
-
var previous_effect = active_effect;
|
|
2329
|
-
var was_updating_effect = is_updating_effect;
|
|
2330
|
-
active_effect = effect;
|
|
2331
|
-
is_updating_effect = true;
|
|
2332
|
-
try {
|
|
2333
|
-
if ((flags2 & (BLOCK_EFFECT | MANAGED_EFFECT)) !== 0) {
|
|
2334
|
-
destroy_block_effect_children(effect);
|
|
2335
|
-
} else {
|
|
2336
|
-
destroy_effect_children(effect);
|
|
2337
|
-
}
|
|
2338
|
-
execute_effect_teardown(effect);
|
|
2339
|
-
var teardown = update_reaction(effect);
|
|
2340
|
-
effect.teardown = typeof teardown === "function" ? teardown : null;
|
|
2341
|
-
effect.wv = write_version;
|
|
2342
|
-
var dep;
|
|
2343
|
-
if (DEV && tracing_mode_flag && (effect.f & DIRTY) !== 0 && effect.deps !== null) ;
|
|
2344
|
-
} finally {
|
|
2345
|
-
is_updating_effect = was_updating_effect;
|
|
2346
|
-
active_effect = previous_effect;
|
|
2347
|
-
}
|
|
2348
|
-
}
|
|
2349
|
-
function get(signal) {
|
|
2350
|
-
var flags2 = signal.f;
|
|
2351
|
-
var is_derived = (flags2 & DERIVED) !== 0;
|
|
2352
|
-
if (active_reaction !== null && !untracking) {
|
|
2353
|
-
var destroyed = active_effect !== null && (active_effect.f & DESTROYED) !== 0;
|
|
2354
|
-
if (!destroyed && !current_sources?.includes(signal)) {
|
|
2355
|
-
var deps = active_reaction.deps;
|
|
2356
|
-
if ((active_reaction.f & REACTION_IS_UPDATING) !== 0) {
|
|
2357
|
-
if (signal.rv < read_version) {
|
|
2358
|
-
signal.rv = read_version;
|
|
2359
|
-
if (new_deps === null && deps !== null && deps[skipped_deps] === signal) {
|
|
2360
|
-
skipped_deps++;
|
|
2361
|
-
} else if (new_deps === null) {
|
|
2362
|
-
new_deps = [signal];
|
|
2363
|
-
} else if (!new_deps.includes(signal)) {
|
|
2364
|
-
new_deps.push(signal);
|
|
2365
|
-
}
|
|
2366
|
-
}
|
|
2367
|
-
} else {
|
|
2368
|
-
(active_reaction.deps ??= []).push(signal);
|
|
2369
|
-
var reactions = signal.reactions;
|
|
2370
|
-
if (reactions === null) {
|
|
2371
|
-
signal.reactions = [active_reaction];
|
|
2372
|
-
} else if (!reactions.includes(active_reaction)) {
|
|
2373
|
-
reactions.push(active_reaction);
|
|
2374
|
-
}
|
|
2375
|
-
}
|
|
2376
|
-
}
|
|
2377
|
-
}
|
|
2378
|
-
if (is_destroying_effect && old_values.has(signal)) {
|
|
2379
|
-
return old_values.get(signal);
|
|
2380
|
-
}
|
|
2381
|
-
if (is_derived) {
|
|
2382
|
-
var derived = (
|
|
2383
|
-
/** @type {Derived} */
|
|
2384
|
-
signal
|
|
2385
|
-
);
|
|
2386
|
-
if (is_destroying_effect) {
|
|
2387
|
-
var value = derived.v;
|
|
2388
|
-
if ((derived.f & CLEAN) === 0 && derived.reactions !== null || depends_on_old_values(derived)) {
|
|
2389
|
-
value = execute_derived(derived);
|
|
2390
|
-
}
|
|
2391
|
-
old_values.set(derived, value);
|
|
2392
|
-
return value;
|
|
2393
|
-
}
|
|
2394
|
-
var should_connect = (derived.f & CONNECTED) === 0 && !untracking && active_reaction !== null && (is_updating_effect || (active_reaction.f & CONNECTED) !== 0);
|
|
2395
|
-
var is_new = derived.deps === null;
|
|
2396
|
-
if (is_dirty(derived)) {
|
|
2397
|
-
if (should_connect) {
|
|
2398
|
-
derived.f |= CONNECTED;
|
|
2399
|
-
}
|
|
2400
|
-
update_derived(derived);
|
|
2401
|
-
}
|
|
2402
|
-
if (should_connect && !is_new) {
|
|
2403
|
-
reconnect(derived);
|
|
2404
|
-
}
|
|
2405
|
-
}
|
|
2406
|
-
if (batch_values?.has(signal)) {
|
|
2407
|
-
return batch_values.get(signal);
|
|
2408
|
-
}
|
|
2409
|
-
if ((signal.f & ERROR_VALUE) !== 0) {
|
|
2410
|
-
throw signal.v;
|
|
2411
|
-
}
|
|
2412
|
-
return signal.v;
|
|
2413
|
-
}
|
|
2414
|
-
function reconnect(derived) {
|
|
2415
|
-
if (derived.deps === null) return;
|
|
2416
|
-
derived.f |= CONNECTED;
|
|
2417
|
-
for (const dep of derived.deps) {
|
|
2418
|
-
(dep.reactions ??= []).push(derived);
|
|
2419
|
-
if ((dep.f & DERIVED) !== 0 && (dep.f & CONNECTED) === 0) {
|
|
2420
|
-
reconnect(
|
|
2421
|
-
/** @type {Derived} */
|
|
2422
|
-
dep
|
|
2423
|
-
);
|
|
2424
|
-
}
|
|
2425
|
-
}
|
|
2426
|
-
}
|
|
2427
|
-
function depends_on_old_values(derived) {
|
|
2428
|
-
if (derived.v === UNINITIALIZED) return true;
|
|
2429
|
-
if (derived.deps === null) return false;
|
|
2430
|
-
for (const dep of derived.deps) {
|
|
2431
|
-
if (old_values.has(dep)) {
|
|
2432
|
-
return true;
|
|
2433
|
-
}
|
|
2434
|
-
if ((dep.f & DERIVED) !== 0 && depends_on_old_values(
|
|
2435
|
-
/** @type {Derived} */
|
|
2436
|
-
dep
|
|
2437
|
-
)) {
|
|
2438
|
-
return true;
|
|
2439
|
-
}
|
|
2440
|
-
}
|
|
2441
|
-
return false;
|
|
2442
|
-
}
|
|
2443
|
-
function untrack(fn) {
|
|
2444
|
-
var previous_untracking = untracking;
|
|
2445
|
-
try {
|
|
2446
|
-
untracking = true;
|
|
2447
|
-
return fn();
|
|
2448
|
-
} finally {
|
|
2449
|
-
untracking = previous_untracking;
|
|
2450
|
-
}
|
|
2451
|
-
}
|
|
2452
|
-
const all_registered_events = /* @__PURE__ */ new Set();
|
|
2453
|
-
const root_event_handles = /* @__PURE__ */ new Set();
|
|
2454
|
-
let last_propagated_event = null;
|
|
2455
|
-
function handle_event_propagation(event) {
|
|
2456
|
-
var handler_element = this;
|
|
2457
|
-
var owner_document = (
|
|
2458
|
-
/** @type {Node} */
|
|
2459
|
-
handler_element.ownerDocument
|
|
2460
|
-
);
|
|
2461
|
-
var event_name = event.type;
|
|
2462
|
-
var path = event.composedPath?.() || [];
|
|
2463
|
-
var current_target = (
|
|
2464
|
-
/** @type {null | Element} */
|
|
2465
|
-
path[0] || event.target
|
|
2466
|
-
);
|
|
2467
|
-
last_propagated_event = event;
|
|
2468
|
-
var path_idx = 0;
|
|
2469
|
-
var handled_at = last_propagated_event === event && event.__root;
|
|
2470
|
-
if (handled_at) {
|
|
2471
|
-
var at_idx = path.indexOf(handled_at);
|
|
2472
|
-
if (at_idx !== -1 && (handler_element === document || handler_element === /** @type {any} */
|
|
2473
|
-
window)) {
|
|
2474
|
-
event.__root = handler_element;
|
|
2475
|
-
return;
|
|
2476
|
-
}
|
|
2477
|
-
var handler_idx = path.indexOf(handler_element);
|
|
2478
|
-
if (handler_idx === -1) {
|
|
2479
|
-
return;
|
|
2480
|
-
}
|
|
2481
|
-
if (at_idx <= handler_idx) {
|
|
2482
|
-
path_idx = at_idx;
|
|
2483
|
-
}
|
|
2484
|
-
}
|
|
2485
|
-
current_target = /** @type {Element} */
|
|
2486
|
-
path[path_idx] || event.target;
|
|
2487
|
-
if (current_target === handler_element) return;
|
|
2488
|
-
define_property(event, "currentTarget", {
|
|
2489
|
-
configurable: true,
|
|
2490
|
-
get() {
|
|
2491
|
-
return current_target || owner_document;
|
|
2492
|
-
}
|
|
2493
|
-
});
|
|
2494
|
-
var previous_reaction = active_reaction;
|
|
2495
|
-
var previous_effect = active_effect;
|
|
2496
|
-
set_active_reaction(null);
|
|
2497
|
-
set_active_effect(null);
|
|
2498
|
-
try {
|
|
2499
|
-
var throw_error;
|
|
2500
|
-
var other_errors = [];
|
|
2501
|
-
while (current_target !== null) {
|
|
2502
|
-
var parent_element = current_target.assignedSlot || current_target.parentNode || /** @type {any} */
|
|
2503
|
-
current_target.host || null;
|
|
2504
|
-
try {
|
|
2505
|
-
var delegated = current_target["__" + event_name];
|
|
2506
|
-
if (delegated != null && (!/** @type {any} */
|
|
2507
|
-
current_target.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
|
|
2508
|
-
// -> the target could not have been disabled because it emits the event in the first place
|
|
2509
|
-
event.target === current_target)) {
|
|
2510
|
-
delegated.call(current_target, event);
|
|
2511
|
-
}
|
|
2512
|
-
} catch (error) {
|
|
2513
|
-
if (throw_error) {
|
|
2514
|
-
other_errors.push(error);
|
|
2515
|
-
} else {
|
|
2516
|
-
throw_error = error;
|
|
2517
|
-
}
|
|
2518
|
-
}
|
|
2519
|
-
if (event.cancelBubble || parent_element === handler_element || parent_element === null) {
|
|
2520
|
-
break;
|
|
2521
|
-
}
|
|
2522
|
-
current_target = parent_element;
|
|
2523
|
-
}
|
|
2524
|
-
if (throw_error) {
|
|
2525
|
-
for (let error of other_errors) {
|
|
2526
|
-
queueMicrotask(() => {
|
|
2527
|
-
throw error;
|
|
2528
|
-
});
|
|
2529
|
-
}
|
|
2530
|
-
throw throw_error;
|
|
2531
|
-
}
|
|
2532
|
-
} finally {
|
|
2533
|
-
event.__root = handler_element;
|
|
2534
|
-
delete event.currentTarget;
|
|
2535
|
-
set_active_reaction(previous_reaction);
|
|
2536
|
-
set_active_effect(previous_effect);
|
|
2537
|
-
}
|
|
2538
|
-
}
|
|
2539
|
-
function assign_nodes(start, end) {
|
|
2540
|
-
var effect = (
|
|
2541
|
-
/** @type {Effect} */
|
|
2542
|
-
active_effect
|
|
2543
|
-
);
|
|
2544
|
-
if (effect.nodes === null) {
|
|
2545
|
-
effect.nodes = { start, end, a: null, t: null };
|
|
2546
|
-
}
|
|
2547
|
-
}
|
|
2548
|
-
function mount(component, options2) {
|
|
2549
|
-
return _mount(component, options2);
|
|
2550
|
-
}
|
|
2551
|
-
function hydrate(component, options2) {
|
|
2552
|
-
init_operations();
|
|
2553
|
-
options2.intro = options2.intro ?? false;
|
|
2554
|
-
const target = options2.target;
|
|
2555
|
-
const was_hydrating = hydrating;
|
|
2556
|
-
const previous_hydrate_node = hydrate_node;
|
|
2557
|
-
try {
|
|
2558
|
-
var anchor = /* @__PURE__ */ get_first_child(target);
|
|
2559
|
-
while (anchor && (anchor.nodeType !== COMMENT_NODE || /** @type {Comment} */
|
|
2560
|
-
anchor.data !== HYDRATION_START)) {
|
|
2561
|
-
anchor = /* @__PURE__ */ get_next_sibling(anchor);
|
|
2562
|
-
}
|
|
2563
|
-
if (!anchor) {
|
|
2564
|
-
throw HYDRATION_ERROR;
|
|
2565
|
-
}
|
|
2566
|
-
set_hydrating(true);
|
|
2567
|
-
set_hydrate_node(
|
|
2568
|
-
/** @type {Comment} */
|
|
2569
|
-
anchor
|
|
2570
|
-
);
|
|
2571
|
-
const instance = _mount(component, { ...options2, anchor });
|
|
2572
|
-
set_hydrating(false);
|
|
2573
|
-
return (
|
|
2574
|
-
/** @type {Exports} */
|
|
2575
|
-
instance
|
|
2576
|
-
);
|
|
2577
|
-
} catch (error) {
|
|
2578
|
-
if (error instanceof Error && error.message.split("\n").some((line) => line.startsWith("https://svelte.dev/e/"))) {
|
|
2579
|
-
throw error;
|
|
2580
|
-
}
|
|
2581
|
-
if (error !== HYDRATION_ERROR) {
|
|
2582
|
-
console.warn("Failed to hydrate: ", error);
|
|
2583
|
-
}
|
|
2584
|
-
if (options2.recover === false) {
|
|
2585
|
-
hydration_failed();
|
|
2586
|
-
}
|
|
2587
|
-
init_operations();
|
|
2588
|
-
clear_text_content(target);
|
|
2589
|
-
set_hydrating(false);
|
|
2590
|
-
return mount(component, options2);
|
|
2591
|
-
} finally {
|
|
2592
|
-
set_hydrating(was_hydrating);
|
|
2593
|
-
set_hydrate_node(previous_hydrate_node);
|
|
2594
|
-
}
|
|
2595
|
-
}
|
|
2596
|
-
const document_listeners = /* @__PURE__ */ new Map();
|
|
2597
|
-
function _mount(Component, { target, anchor, props = {}, events, context, intro = true }) {
|
|
2598
|
-
init_operations();
|
|
2599
|
-
var registered_events = /* @__PURE__ */ new Set();
|
|
2600
|
-
var event_handle = (events2) => {
|
|
2601
|
-
for (var i = 0; i < events2.length; i++) {
|
|
2602
|
-
var event_name = events2[i];
|
|
2603
|
-
if (registered_events.has(event_name)) continue;
|
|
2604
|
-
registered_events.add(event_name);
|
|
2605
|
-
var passive = is_passive_event(event_name);
|
|
2606
|
-
target.addEventListener(event_name, handle_event_propagation, { passive });
|
|
2607
|
-
var n = document_listeners.get(event_name);
|
|
2608
|
-
if (n === void 0) {
|
|
2609
|
-
document.addEventListener(event_name, handle_event_propagation, { passive });
|
|
2610
|
-
document_listeners.set(event_name, 1);
|
|
2611
|
-
} else {
|
|
2612
|
-
document_listeners.set(event_name, n + 1);
|
|
2613
|
-
}
|
|
2614
|
-
}
|
|
2615
|
-
};
|
|
2616
|
-
event_handle(array_from(all_registered_events));
|
|
2617
|
-
root_event_handles.add(event_handle);
|
|
2618
|
-
var component = void 0;
|
|
2619
|
-
var unmount2 = component_root(() => {
|
|
2620
|
-
var anchor_node = anchor ?? target.appendChild(create_text());
|
|
2621
|
-
boundary(
|
|
2622
|
-
/** @type {TemplateNode} */
|
|
2623
|
-
anchor_node,
|
|
2624
|
-
{
|
|
2625
|
-
pending: () => {
|
|
2626
|
-
}
|
|
2627
|
-
},
|
|
2628
|
-
(anchor_node2) => {
|
|
2629
|
-
if (context) {
|
|
2630
|
-
push({});
|
|
2631
|
-
var ctx = (
|
|
2632
|
-
/** @type {ComponentContext} */
|
|
2633
|
-
component_context
|
|
2634
|
-
);
|
|
2635
|
-
ctx.c = context;
|
|
2636
|
-
}
|
|
2637
|
-
if (events) {
|
|
2638
|
-
props.$$events = events;
|
|
2639
|
-
}
|
|
2640
|
-
if (hydrating) {
|
|
2641
|
-
assign_nodes(
|
|
2642
|
-
/** @type {TemplateNode} */
|
|
2643
|
-
anchor_node2,
|
|
2644
|
-
null
|
|
2645
|
-
);
|
|
2646
|
-
}
|
|
2647
|
-
component = Component(anchor_node2, props) || {};
|
|
2648
|
-
if (hydrating) {
|
|
2649
|
-
active_effect.nodes.end = hydrate_node;
|
|
2650
|
-
if (hydrate_node === null || hydrate_node.nodeType !== COMMENT_NODE || /** @type {Comment} */
|
|
2651
|
-
hydrate_node.data !== HYDRATION_END) {
|
|
2652
|
-
hydration_mismatch();
|
|
2653
|
-
throw HYDRATION_ERROR;
|
|
2654
|
-
}
|
|
2655
|
-
}
|
|
2656
|
-
if (context) {
|
|
2657
|
-
pop();
|
|
2658
|
-
}
|
|
2659
|
-
}
|
|
2660
|
-
);
|
|
2661
|
-
return () => {
|
|
2662
|
-
for (var event_name of registered_events) {
|
|
2663
|
-
target.removeEventListener(event_name, handle_event_propagation);
|
|
2664
|
-
var n = (
|
|
2665
|
-
/** @type {number} */
|
|
2666
|
-
document_listeners.get(event_name)
|
|
2667
|
-
);
|
|
2668
|
-
if (--n === 0) {
|
|
2669
|
-
document.removeEventListener(event_name, handle_event_propagation);
|
|
2670
|
-
document_listeners.delete(event_name);
|
|
2671
|
-
} else {
|
|
2672
|
-
document_listeners.set(event_name, n);
|
|
2673
|
-
}
|
|
2674
|
-
}
|
|
2675
|
-
root_event_handles.delete(event_handle);
|
|
2676
|
-
if (anchor_node !== anchor) {
|
|
2677
|
-
anchor_node.parentNode?.removeChild(anchor_node);
|
|
2678
|
-
}
|
|
2679
|
-
};
|
|
2680
|
-
});
|
|
2681
|
-
mounted_components.set(component, unmount2);
|
|
2682
|
-
return component;
|
|
2683
|
-
}
|
|
2684
|
-
let mounted_components = /* @__PURE__ */ new WeakMap();
|
|
2685
|
-
function unmount(component, options2) {
|
|
2686
|
-
const fn = mounted_components.get(component);
|
|
2687
|
-
if (fn) {
|
|
2688
|
-
mounted_components.delete(component);
|
|
2689
|
-
return fn(options2);
|
|
2690
|
-
}
|
|
2691
|
-
return Promise.resolve();
|
|
2692
|
-
}
|
|
2693
|
-
function asClassComponent$1(component) {
|
|
2694
|
-
return class extends Svelte4Component {
|
|
2695
|
-
/** @param {any} options */
|
|
2696
|
-
constructor(options2) {
|
|
2697
|
-
super({
|
|
2698
|
-
component,
|
|
2699
|
-
...options2
|
|
2700
|
-
});
|
|
2701
|
-
}
|
|
2702
|
-
};
|
|
2703
|
-
}
|
|
2704
|
-
class Svelte4Component {
|
|
2705
|
-
/** @type {any} */
|
|
2706
|
-
#events;
|
|
2707
|
-
/** @type {Record<string, any>} */
|
|
2708
|
-
#instance;
|
|
2709
|
-
/**
|
|
2710
|
-
* @param {ComponentConstructorOptions & {
|
|
2711
|
-
* component: any;
|
|
2712
|
-
* }} options
|
|
2713
|
-
*/
|
|
2714
|
-
constructor(options2) {
|
|
2715
|
-
var sources = /* @__PURE__ */ new Map();
|
|
2716
|
-
var add_source = (key, value) => {
|
|
2717
|
-
var s = /* @__PURE__ */ mutable_source(value, false, false);
|
|
2718
|
-
sources.set(key, s);
|
|
2719
|
-
return s;
|
|
2720
|
-
};
|
|
2721
|
-
const props = new Proxy(
|
|
2722
|
-
{ ...options2.props || {}, $$events: {} },
|
|
2723
|
-
{
|
|
2724
|
-
get(target, prop) {
|
|
2725
|
-
return get(sources.get(prop) ?? add_source(prop, Reflect.get(target, prop)));
|
|
2726
|
-
},
|
|
2727
|
-
has(target, prop) {
|
|
2728
|
-
if (prop === LEGACY_PROPS) return true;
|
|
2729
|
-
get(sources.get(prop) ?? add_source(prop, Reflect.get(target, prop)));
|
|
2730
|
-
return Reflect.has(target, prop);
|
|
2731
|
-
},
|
|
2732
|
-
set(target, prop, value) {
|
|
2733
|
-
set(sources.get(prop) ?? add_source(prop, value), value);
|
|
2734
|
-
return Reflect.set(target, prop, value);
|
|
2735
|
-
}
|
|
2736
|
-
}
|
|
2737
|
-
);
|
|
2738
|
-
this.#instance = (options2.hydrate ? hydrate : mount)(options2.component, {
|
|
2739
|
-
target: options2.target,
|
|
2740
|
-
anchor: options2.anchor,
|
|
2741
|
-
props,
|
|
2742
|
-
context: options2.context,
|
|
2743
|
-
intro: options2.intro ?? false,
|
|
2744
|
-
recover: options2.recover
|
|
2745
|
-
});
|
|
2746
|
-
if (!async_mode_flag && (!options2?.props?.$$host || options2.sync === false)) {
|
|
2747
|
-
flushSync();
|
|
2748
|
-
}
|
|
2749
|
-
this.#events = props.$$events;
|
|
2750
|
-
for (const key of Object.keys(this.#instance)) {
|
|
2751
|
-
if (key === "$set" || key === "$destroy" || key === "$on") continue;
|
|
2752
|
-
define_property(this, key, {
|
|
2753
|
-
get() {
|
|
2754
|
-
return this.#instance[key];
|
|
2755
|
-
},
|
|
2756
|
-
/** @param {any} value */
|
|
2757
|
-
set(value) {
|
|
2758
|
-
this.#instance[key] = value;
|
|
2759
|
-
},
|
|
2760
|
-
enumerable: true
|
|
2761
|
-
});
|
|
2762
|
-
}
|
|
2763
|
-
this.#instance.$set = /** @param {Record<string, any>} next */
|
|
2764
|
-
(next2) => {
|
|
2765
|
-
Object.assign(props, next2);
|
|
2766
|
-
};
|
|
2767
|
-
this.#instance.$destroy = () => {
|
|
2768
|
-
unmount(this.#instance);
|
|
2769
|
-
};
|
|
2770
|
-
}
|
|
2771
|
-
/** @param {Record<string, any>} props */
|
|
2772
|
-
$set(props) {
|
|
2773
|
-
this.#instance.$set(props);
|
|
2774
|
-
}
|
|
2775
|
-
/**
|
|
2776
|
-
* @param {string} event
|
|
2777
|
-
* @param {(...args: any[]) => any} callback
|
|
2778
|
-
* @returns {any}
|
|
2779
|
-
*/
|
|
2780
|
-
$on(event, callback) {
|
|
2781
|
-
this.#events[event] = this.#events[event] || [];
|
|
2782
|
-
const cb = (...args) => callback.call(this, ...args);
|
|
2783
|
-
this.#events[event].push(cb);
|
|
2784
|
-
return () => {
|
|
2785
|
-
this.#events[event] = this.#events[event].filter(
|
|
2786
|
-
/** @param {any} fn */
|
|
2787
|
-
(fn) => fn !== cb
|
|
2788
|
-
);
|
|
2789
|
-
};
|
|
2790
|
-
}
|
|
2791
|
-
$destroy() {
|
|
2792
|
-
this.#instance.$destroy();
|
|
2793
|
-
}
|
|
12
|
+
/**
|
|
13
|
+
* @template {{ tracing: { enabled: boolean, root: import('@opentelemetry/api').Span, current: import('@opentelemetry/api').Span } }} T
|
|
14
|
+
* @param {T} event_like
|
|
15
|
+
* @param {import('@opentelemetry/api').Span} current
|
|
16
|
+
* @returns {T}
|
|
17
|
+
*/
|
|
18
|
+
function merge_tracing(event_like, current) {
|
|
19
|
+
return {
|
|
20
|
+
...event_like,
|
|
21
|
+
tracing: {
|
|
22
|
+
...event_like.tracing,
|
|
23
|
+
current
|
|
24
|
+
}
|
|
25
|
+
};
|
|
2794
26
|
}
|
|
27
|
+
|
|
2795
28
|
let read_implementation = null;
|
|
2796
29
|
function set_read_implementation(fn) {
|
|
2797
30
|
read_implementation = fn;
|
|
2798
31
|
}
|
|
2799
|
-
function asClassComponent(component) {
|
|
2800
|
-
const component_constructor = asClassComponent$1(component);
|
|
2801
|
-
const _render = (props, { context, csp } = {}) => {
|
|
2802
|
-
const result = render(component, { props, context, csp });
|
|
2803
|
-
const munged = Object.defineProperties(
|
|
2804
|
-
/** @type {LegacyRenderResult & PromiseLike<LegacyRenderResult>} */
|
|
2805
|
-
{},
|
|
2806
|
-
{
|
|
2807
|
-
css: {
|
|
2808
|
-
value: { code: "", map: null }
|
|
2809
|
-
},
|
|
2810
|
-
head: {
|
|
2811
|
-
get: () => result.head
|
|
2812
|
-
},
|
|
2813
|
-
html: {
|
|
2814
|
-
get: () => result.body
|
|
2815
|
-
},
|
|
2816
|
-
then: {
|
|
2817
|
-
/**
|
|
2818
|
-
* this is not type-safe, but honestly it's the best I can do right now, and it's a straightforward function.
|
|
2819
|
-
*
|
|
2820
|
-
* @template TResult1
|
|
2821
|
-
* @template [TResult2=never]
|
|
2822
|
-
* @param { (value: LegacyRenderResult) => TResult1 } onfulfilled
|
|
2823
|
-
* @param { (reason: unknown) => TResult2 } onrejected
|
|
2824
|
-
*/
|
|
2825
|
-
value: (onfulfilled, onrejected) => {
|
|
2826
|
-
if (!async_mode_flag) {
|
|
2827
|
-
const user_result = onfulfilled({
|
|
2828
|
-
css: munged.css,
|
|
2829
|
-
head: munged.head,
|
|
2830
|
-
html: munged.html
|
|
2831
|
-
});
|
|
2832
|
-
return Promise.resolve(user_result);
|
|
2833
|
-
}
|
|
2834
|
-
return result.then((result2) => {
|
|
2835
|
-
return onfulfilled({
|
|
2836
|
-
css: munged.css,
|
|
2837
|
-
head: result2.head,
|
|
2838
|
-
html: result2.body,
|
|
2839
|
-
hashes: result2.hashes
|
|
2840
|
-
});
|
|
2841
|
-
}, onrejected);
|
|
2842
|
-
}
|
|
2843
|
-
}
|
|
2844
|
-
}
|
|
2845
|
-
);
|
|
2846
|
-
return munged;
|
|
2847
|
-
};
|
|
2848
|
-
component_constructor.render = _render;
|
|
2849
|
-
return component_constructor;
|
|
2850
|
-
}
|
|
2851
|
-
function Root($$renderer, $$props) {
|
|
2852
|
-
$$renderer.component(($$renderer2) => {
|
|
2853
|
-
let {
|
|
2854
|
-
stores,
|
|
2855
|
-
page,
|
|
2856
|
-
constructors,
|
|
2857
|
-
components = [],
|
|
2858
|
-
form,
|
|
2859
|
-
data_0 = null,
|
|
2860
|
-
data_1 = null,
|
|
2861
|
-
data_2 = null,
|
|
2862
|
-
data_3 = null,
|
|
2863
|
-
data_4 = null,
|
|
2864
|
-
data_5 = null
|
|
2865
|
-
} = $$props;
|
|
2866
|
-
{
|
|
2867
|
-
setContext("__svelte__", stores);
|
|
2868
|
-
}
|
|
2869
|
-
{
|
|
2870
|
-
stores.page.set(page);
|
|
2871
|
-
}
|
|
2872
|
-
const Pyramid_5 = constructors[5];
|
|
2873
|
-
if (constructors[1]) {
|
|
2874
|
-
$$renderer2.push("<!--[-->");
|
|
2875
|
-
const Pyramid_0 = constructors[0];
|
|
2876
|
-
$$renderer2.push(`<!---->`);
|
|
2877
|
-
Pyramid_0($$renderer2, {
|
|
2878
|
-
data: data_0,
|
|
2879
|
-
form,
|
|
2880
|
-
params: page.params,
|
|
2881
|
-
children: ($$renderer3) => {
|
|
2882
|
-
if (constructors[2]) {
|
|
2883
|
-
$$renderer3.push("<!--[-->");
|
|
2884
|
-
const Pyramid_1 = constructors[1];
|
|
2885
|
-
$$renderer3.push(`<!---->`);
|
|
2886
|
-
Pyramid_1($$renderer3, {
|
|
2887
|
-
data: data_1,
|
|
2888
|
-
form,
|
|
2889
|
-
params: page.params,
|
|
2890
|
-
children: ($$renderer4) => {
|
|
2891
|
-
if (constructors[3]) {
|
|
2892
|
-
$$renderer4.push("<!--[-->");
|
|
2893
|
-
const Pyramid_2 = constructors[2];
|
|
2894
|
-
$$renderer4.push(`<!---->`);
|
|
2895
|
-
Pyramid_2($$renderer4, {
|
|
2896
|
-
data: data_2,
|
|
2897
|
-
form,
|
|
2898
|
-
params: page.params,
|
|
2899
|
-
children: ($$renderer5) => {
|
|
2900
|
-
if (constructors[4]) {
|
|
2901
|
-
$$renderer5.push("<!--[-->");
|
|
2902
|
-
const Pyramid_3 = constructors[3];
|
|
2903
|
-
$$renderer5.push(`<!---->`);
|
|
2904
|
-
Pyramid_3($$renderer5, {
|
|
2905
|
-
data: data_3,
|
|
2906
|
-
form,
|
|
2907
|
-
params: page.params,
|
|
2908
|
-
children: ($$renderer6) => {
|
|
2909
|
-
if (constructors[5]) {
|
|
2910
|
-
$$renderer6.push("<!--[-->");
|
|
2911
|
-
const Pyramid_4 = constructors[4];
|
|
2912
|
-
$$renderer6.push(`<!---->`);
|
|
2913
|
-
Pyramid_4($$renderer6, {
|
|
2914
|
-
data: data_4,
|
|
2915
|
-
form,
|
|
2916
|
-
params: page.params,
|
|
2917
|
-
children: ($$renderer7) => {
|
|
2918
|
-
$$renderer7.push(`<!---->`);
|
|
2919
|
-
Pyramid_5($$renderer7, { data: data_5, form, params: page.params });
|
|
2920
|
-
$$renderer7.push(`<!---->`);
|
|
2921
|
-
},
|
|
2922
|
-
$$slots: { default: true }
|
|
2923
|
-
});
|
|
2924
|
-
$$renderer6.push(`<!---->`);
|
|
2925
|
-
} else {
|
|
2926
|
-
$$renderer6.push("<!--[!-->");
|
|
2927
|
-
const Pyramid_4 = constructors[4];
|
|
2928
|
-
$$renderer6.push(`<!---->`);
|
|
2929
|
-
Pyramid_4($$renderer6, { data: data_4, form, params: page.params });
|
|
2930
|
-
$$renderer6.push(`<!---->`);
|
|
2931
|
-
}
|
|
2932
|
-
$$renderer6.push(`<!--]-->`);
|
|
2933
|
-
},
|
|
2934
|
-
$$slots: { default: true }
|
|
2935
|
-
});
|
|
2936
|
-
$$renderer5.push(`<!---->`);
|
|
2937
|
-
} else {
|
|
2938
|
-
$$renderer5.push("<!--[!-->");
|
|
2939
|
-
const Pyramid_3 = constructors[3];
|
|
2940
|
-
$$renderer5.push(`<!---->`);
|
|
2941
|
-
Pyramid_3($$renderer5, { data: data_3, form, params: page.params });
|
|
2942
|
-
$$renderer5.push(`<!---->`);
|
|
2943
|
-
}
|
|
2944
|
-
$$renderer5.push(`<!--]-->`);
|
|
2945
|
-
},
|
|
2946
|
-
$$slots: { default: true }
|
|
2947
|
-
});
|
|
2948
|
-
$$renderer4.push(`<!---->`);
|
|
2949
|
-
} else {
|
|
2950
|
-
$$renderer4.push("<!--[!-->");
|
|
2951
|
-
const Pyramid_2 = constructors[2];
|
|
2952
|
-
$$renderer4.push(`<!---->`);
|
|
2953
|
-
Pyramid_2($$renderer4, { data: data_2, form, params: page.params });
|
|
2954
|
-
$$renderer4.push(`<!---->`);
|
|
2955
|
-
}
|
|
2956
|
-
$$renderer4.push(`<!--]-->`);
|
|
2957
|
-
},
|
|
2958
|
-
$$slots: { default: true }
|
|
2959
|
-
});
|
|
2960
|
-
$$renderer3.push(`<!---->`);
|
|
2961
|
-
} else {
|
|
2962
|
-
$$renderer3.push("<!--[!-->");
|
|
2963
|
-
const Pyramid_1 = constructors[1];
|
|
2964
|
-
$$renderer3.push(`<!---->`);
|
|
2965
|
-
Pyramid_1($$renderer3, { data: data_1, form, params: page.params });
|
|
2966
|
-
$$renderer3.push(`<!---->`);
|
|
2967
|
-
}
|
|
2968
|
-
$$renderer3.push(`<!--]-->`);
|
|
2969
|
-
},
|
|
2970
|
-
$$slots: { default: true }
|
|
2971
|
-
});
|
|
2972
|
-
$$renderer2.push(`<!---->`);
|
|
2973
|
-
} else {
|
|
2974
|
-
$$renderer2.push("<!--[!-->");
|
|
2975
|
-
const Pyramid_0 = constructors[0];
|
|
2976
|
-
$$renderer2.push(`<!---->`);
|
|
2977
|
-
Pyramid_0($$renderer2, { data: data_0, form, params: page.params });
|
|
2978
|
-
$$renderer2.push(`<!---->`);
|
|
2979
|
-
}
|
|
2980
|
-
$$renderer2.push(`<!--]--> `);
|
|
2981
|
-
{
|
|
2982
|
-
$$renderer2.push("<!--[!-->");
|
|
2983
|
-
}
|
|
2984
|
-
$$renderer2.push(`<!--]-->`);
|
|
2985
|
-
});
|
|
2986
|
-
}
|
|
2987
|
-
const root = asClassComponent(Root);
|
|
2988
32
|
const options = {
|
|
2989
33
|
app_template_contains_nonce: false,
|
|
2990
34
|
async: true,
|
|
@@ -3074,7 +118,7 @@ const options = {
|
|
|
3074
118
|
<div class="error">
|
|
3075
119
|
<span class="status">` + status + '</span>\n <div class="message">\n <h1>' + message + "</h1>\n </div>\n </div>\n </body>\n</html>\n"
|
|
3076
120
|
},
|
|
3077
|
-
version_hash: "
|
|
121
|
+
version_hash: "1kmr27x"
|
|
3078
122
|
};
|
|
3079
123
|
async function get_hooks() {
|
|
3080
124
|
let handle;
|
|
@@ -3082,7 +126,7 @@ async function get_hooks() {
|
|
|
3082
126
|
let handleError;
|
|
3083
127
|
let handleValidationError;
|
|
3084
128
|
let init;
|
|
3085
|
-
({ handle, handleFetch, handleError, handleValidationError, init } = await import('./chunks/hooks.server-
|
|
129
|
+
({ handle, handleFetch, handleError, handleValidationError, init } = await import('./chunks/hooks.server-Cq7ufuFU.js'));
|
|
3086
130
|
let reroute;
|
|
3087
131
|
let transport;
|
|
3088
132
|
return {
|
|
@@ -3107,214 +151,6 @@ function with_resolvers() {
|
|
|
3107
151
|
}
|
|
3108
152
|
const NULL_BODY_STATUS = [101, 103, 204, 205, 304];
|
|
3109
153
|
const IN_WEBCONTAINER = !!globalThis.process?.versions?.webcontainer;
|
|
3110
|
-
const SVELTE_KIT_ASSETS = "/_svelte_kit_assets";
|
|
3111
|
-
const ENDPOINT_METHODS = ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"];
|
|
3112
|
-
const PAGE_METHODS = ["GET", "POST", "HEAD"];
|
|
3113
|
-
function negotiate(accept, types) {
|
|
3114
|
-
const parts = [];
|
|
3115
|
-
accept.split(",").forEach((str, i) => {
|
|
3116
|
-
const match = /([^/ \t]+)\/([^; \t]+)[ \t]*(?:;[ \t]*q=([0-9.]+))?/.exec(str);
|
|
3117
|
-
if (match) {
|
|
3118
|
-
const [, type, subtype, q = "1"] = match;
|
|
3119
|
-
parts.push({ type, subtype, q: +q, i });
|
|
3120
|
-
}
|
|
3121
|
-
});
|
|
3122
|
-
parts.sort((a, b) => {
|
|
3123
|
-
if (a.q !== b.q) {
|
|
3124
|
-
return b.q - a.q;
|
|
3125
|
-
}
|
|
3126
|
-
if (a.subtype === "*" !== (b.subtype === "*")) {
|
|
3127
|
-
return a.subtype === "*" ? 1 : -1;
|
|
3128
|
-
}
|
|
3129
|
-
if (a.type === "*" !== (b.type === "*")) {
|
|
3130
|
-
return a.type === "*" ? 1 : -1;
|
|
3131
|
-
}
|
|
3132
|
-
return a.i - b.i;
|
|
3133
|
-
});
|
|
3134
|
-
let accepted;
|
|
3135
|
-
let min_priority = Infinity;
|
|
3136
|
-
for (const mimetype of types) {
|
|
3137
|
-
const [type, subtype] = mimetype.split("/");
|
|
3138
|
-
const priority = parts.findIndex(
|
|
3139
|
-
(part) => (part.type === type || part.type === "*") && (part.subtype === subtype || part.subtype === "*")
|
|
3140
|
-
);
|
|
3141
|
-
if (priority !== -1 && priority < min_priority) {
|
|
3142
|
-
accepted = mimetype;
|
|
3143
|
-
min_priority = priority;
|
|
3144
|
-
}
|
|
3145
|
-
}
|
|
3146
|
-
return accepted;
|
|
3147
|
-
}
|
|
3148
|
-
function is_content_type(request, ...types) {
|
|
3149
|
-
const type = request.headers.get("content-type")?.split(";", 1)[0].trim() ?? "";
|
|
3150
|
-
return types.includes(type.toLowerCase());
|
|
3151
|
-
}
|
|
3152
|
-
function is_form_content_type(request) {
|
|
3153
|
-
return is_content_type(
|
|
3154
|
-
request,
|
|
3155
|
-
"application/x-www-form-urlencoded",
|
|
3156
|
-
"multipart/form-data",
|
|
3157
|
-
"text/plain",
|
|
3158
|
-
BINARY_FORM_CONTENT_TYPE
|
|
3159
|
-
);
|
|
3160
|
-
}
|
|
3161
|
-
function coalesce_to_error(err) {
|
|
3162
|
-
return err instanceof Error || err && /** @type {any} */
|
|
3163
|
-
err.name && /** @type {any} */
|
|
3164
|
-
err.message ? (
|
|
3165
|
-
/** @type {Error} */
|
|
3166
|
-
err
|
|
3167
|
-
) : new Error(JSON.stringify(err));
|
|
3168
|
-
}
|
|
3169
|
-
function normalize_error(error2) {
|
|
3170
|
-
return (
|
|
3171
|
-
/** @type {import('../exports/internal/index.js').Redirect | HttpError | SvelteKitError | Error} */
|
|
3172
|
-
error2
|
|
3173
|
-
);
|
|
3174
|
-
}
|
|
3175
|
-
function get_status(error2) {
|
|
3176
|
-
return error2 instanceof HttpError || error2 instanceof SvelteKitError ? error2.status : 500;
|
|
3177
|
-
}
|
|
3178
|
-
function get_message(error2) {
|
|
3179
|
-
return error2 instanceof SvelteKitError ? error2.text : "Internal Error";
|
|
3180
|
-
}
|
|
3181
|
-
const escape_html_attr_dict = {
|
|
3182
|
-
"&": "&",
|
|
3183
|
-
'"': """
|
|
3184
|
-
// Svelte also escapes < because the escape function could be called inside a `noscript` there
|
|
3185
|
-
// https://github.com/sveltejs/svelte/security/advisories/GHSA-8266-84wp-wv5c
|
|
3186
|
-
// However, that doesn't apply in SvelteKit
|
|
3187
|
-
};
|
|
3188
|
-
const escape_html_dict = {
|
|
3189
|
-
"&": "&",
|
|
3190
|
-
"<": "<"
|
|
3191
|
-
};
|
|
3192
|
-
const surrogates = (
|
|
3193
|
-
// high surrogate without paired low surrogate
|
|
3194
|
-
"[\\ud800-\\udbff](?![\\udc00-\\udfff])|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\udc00-\\udfff]"
|
|
3195
|
-
);
|
|
3196
|
-
const escape_html_attr_regex = new RegExp(
|
|
3197
|
-
`[${Object.keys(escape_html_attr_dict).join("")}]|` + surrogates,
|
|
3198
|
-
"g"
|
|
3199
|
-
);
|
|
3200
|
-
const escape_html_regex = new RegExp(
|
|
3201
|
-
`[${Object.keys(escape_html_dict).join("")}]|` + surrogates,
|
|
3202
|
-
"g"
|
|
3203
|
-
);
|
|
3204
|
-
function escape_html(str, is_attr) {
|
|
3205
|
-
const dict = is_attr ? escape_html_attr_dict : escape_html_dict;
|
|
3206
|
-
const escaped_str = str.replace(is_attr ? escape_html_attr_regex : escape_html_regex, (match) => {
|
|
3207
|
-
if (match.length === 2) {
|
|
3208
|
-
return match;
|
|
3209
|
-
}
|
|
3210
|
-
return dict[match] ?? `&#${match.charCodeAt(0)};`;
|
|
3211
|
-
});
|
|
3212
|
-
return escaped_str;
|
|
3213
|
-
}
|
|
3214
|
-
function method_not_allowed(mod, method) {
|
|
3215
|
-
return text(`${method} method not allowed`, {
|
|
3216
|
-
status: 405,
|
|
3217
|
-
headers: {
|
|
3218
|
-
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405
|
|
3219
|
-
// "The server must generate an Allow header field in a 405 status code response"
|
|
3220
|
-
allow: allowed_methods(mod).join(", ")
|
|
3221
|
-
}
|
|
3222
|
-
});
|
|
3223
|
-
}
|
|
3224
|
-
function allowed_methods(mod) {
|
|
3225
|
-
const allowed = ENDPOINT_METHODS.filter((method) => method in mod);
|
|
3226
|
-
if ("GET" in mod && !("HEAD" in mod)) {
|
|
3227
|
-
allowed.push("HEAD");
|
|
3228
|
-
}
|
|
3229
|
-
return allowed;
|
|
3230
|
-
}
|
|
3231
|
-
function get_global_name(options2) {
|
|
3232
|
-
return `__sveltekit_${options2.version_hash}`;
|
|
3233
|
-
}
|
|
3234
|
-
function static_error_page(options2, status, message) {
|
|
3235
|
-
let page = options2.templates.error({ status, message: escape_html(message) });
|
|
3236
|
-
return text(page, {
|
|
3237
|
-
headers: { "content-type": "text/html; charset=utf-8" },
|
|
3238
|
-
status
|
|
3239
|
-
});
|
|
3240
|
-
}
|
|
3241
|
-
async function handle_fatal_error(event, state, options2, error2) {
|
|
3242
|
-
error2 = error2 instanceof HttpError ? error2 : coalesce_to_error(error2);
|
|
3243
|
-
const status = get_status(error2);
|
|
3244
|
-
const body2 = await handle_error_and_jsonify(event, state, options2, error2);
|
|
3245
|
-
const type = negotiate(event.request.headers.get("accept") || "text/html", [
|
|
3246
|
-
"application/json",
|
|
3247
|
-
"text/html"
|
|
3248
|
-
]);
|
|
3249
|
-
if (event.isDataRequest || type === "application/json") {
|
|
3250
|
-
return json(body2, {
|
|
3251
|
-
status
|
|
3252
|
-
});
|
|
3253
|
-
}
|
|
3254
|
-
return static_error_page(options2, status, body2.message);
|
|
3255
|
-
}
|
|
3256
|
-
async function handle_error_and_jsonify(event, state, options2, error2) {
|
|
3257
|
-
if (error2 instanceof HttpError) {
|
|
3258
|
-
return { message: "Unknown Error", ...error2.body };
|
|
3259
|
-
}
|
|
3260
|
-
const status = get_status(error2);
|
|
3261
|
-
const message = get_message(error2);
|
|
3262
|
-
return await with_request_store(
|
|
3263
|
-
{ event, state },
|
|
3264
|
-
() => options2.hooks.handleError({ error: error2, event, status, message })
|
|
3265
|
-
) ?? { message };
|
|
3266
|
-
}
|
|
3267
|
-
function redirect_response(status, location) {
|
|
3268
|
-
const response = new Response(void 0, {
|
|
3269
|
-
status,
|
|
3270
|
-
headers: { location }
|
|
3271
|
-
});
|
|
3272
|
-
return response;
|
|
3273
|
-
}
|
|
3274
|
-
function clarify_devalue_error(event, error2) {
|
|
3275
|
-
if (error2.path) {
|
|
3276
|
-
return `Data returned from \`load\` while rendering ${event.route.id} is not serializable: ${error2.message} (${error2.path}). If you need to serialize/deserialize custom types, use transport hooks: https://svelte.dev/docs/kit/hooks#Universal-hooks-transport.`;
|
|
3277
|
-
}
|
|
3278
|
-
if (error2.path === "") {
|
|
3279
|
-
return `Data returned from \`load\` while rendering ${event.route.id} is not a plain object`;
|
|
3280
|
-
}
|
|
3281
|
-
return error2.message;
|
|
3282
|
-
}
|
|
3283
|
-
function serialize_uses(node) {
|
|
3284
|
-
const uses = {};
|
|
3285
|
-
if (node.uses && node.uses.dependencies.size > 0) {
|
|
3286
|
-
uses.dependencies = Array.from(node.uses.dependencies);
|
|
3287
|
-
}
|
|
3288
|
-
if (node.uses && node.uses.search_params.size > 0) {
|
|
3289
|
-
uses.search_params = Array.from(node.uses.search_params);
|
|
3290
|
-
}
|
|
3291
|
-
if (node.uses && node.uses.params.size > 0) {
|
|
3292
|
-
uses.params = Array.from(node.uses.params);
|
|
3293
|
-
}
|
|
3294
|
-
if (node.uses?.parent) uses.parent = 1;
|
|
3295
|
-
if (node.uses?.route) uses.route = 1;
|
|
3296
|
-
if (node.uses?.url) uses.url = 1;
|
|
3297
|
-
return uses;
|
|
3298
|
-
}
|
|
3299
|
-
function has_prerendered_path(manifest, pathname) {
|
|
3300
|
-
return manifest._.prerendered_routes.has(pathname) || pathname.at(-1) === "/" && manifest._.prerendered_routes.has(pathname.slice(0, -1));
|
|
3301
|
-
}
|
|
3302
|
-
function format_server_error(status, error2, event) {
|
|
3303
|
-
const formatted_text = `
|
|
3304
|
-
\x1B[1;31m[${status}] ${event.request.method} ${event.url.pathname}\x1B[0m`;
|
|
3305
|
-
if (status === 404) {
|
|
3306
|
-
return formatted_text;
|
|
3307
|
-
}
|
|
3308
|
-
return `${formatted_text}
|
|
3309
|
-
${error2.stack}`;
|
|
3310
|
-
}
|
|
3311
|
-
function get_node_type(node_id) {
|
|
3312
|
-
const parts = node_id?.split("/");
|
|
3313
|
-
const filename = parts?.at(-1);
|
|
3314
|
-
if (!filename) return "unknown";
|
|
3315
|
-
const dot_parts = filename.split(".");
|
|
3316
|
-
return dot_parts.slice(0, -1).join(".");
|
|
3317
|
-
}
|
|
3318
154
|
async function render_endpoint(event, event_state, mod, state) {
|
|
3319
155
|
const method = (
|
|
3320
156
|
/** @type {import('types').HttpMethod} */
|
|
@@ -3338,8 +174,8 @@ async function render_endpoint(event, event_state, mod, state) {
|
|
|
3338
174
|
return new Response(void 0, { status: 204 });
|
|
3339
175
|
}
|
|
3340
176
|
}
|
|
3341
|
-
event_state.is_endpoint_request = true;
|
|
3342
177
|
try {
|
|
178
|
+
event_state.allows_commands = true;
|
|
3343
179
|
const response = await with_request_store(
|
|
3344
180
|
{ event, state: event_state },
|
|
3345
181
|
() => handler(
|
|
@@ -3655,6 +491,7 @@ async function call_action(event, event_state, actions) {
|
|
|
3655
491
|
},
|
|
3656
492
|
fn: async (current2) => {
|
|
3657
493
|
const traced_event = merge_tracing(event, current2);
|
|
494
|
+
event_state.allows_commands = true;
|
|
3658
495
|
const result = await with_request_store(
|
|
3659
496
|
{ event: traced_event, state: event_state },
|
|
3660
497
|
() => action(traced_event)
|
|
@@ -3696,13 +533,14 @@ function try_serialize(data, fn, route_id) {
|
|
|
3696
533
|
);
|
|
3697
534
|
if (data instanceof Response) {
|
|
3698
535
|
throw new Error(
|
|
3699
|
-
`Data returned from action inside ${route_id} is not serializable. Form actions need to return plain objects or fail(). E.g. return { success: true } or return fail(400, { message: "invalid" })
|
|
536
|
+
`Data returned from action inside ${route_id} is not serializable. Form actions need to return plain objects or fail(). E.g. return { success: true } or return fail(400, { message: "invalid" });`,
|
|
537
|
+
{ cause: e }
|
|
3700
538
|
);
|
|
3701
539
|
}
|
|
3702
540
|
if ("path" in error2) {
|
|
3703
541
|
let message = `Data returned from action inside ${route_id} is not serializable: ${error2.message}`;
|
|
3704
542
|
if (error2.path !== "") message += ` (data.${error2.path})`;
|
|
3705
|
-
throw new Error(message);
|
|
543
|
+
throw new Error(message, { cause: e });
|
|
3706
544
|
}
|
|
3707
545
|
throw error2;
|
|
3708
546
|
}
|
|
@@ -3766,7 +604,6 @@ function server_data_serializer(event, event_state, options2) {
|
|
|
3766
604
|
options2,
|
|
3767
605
|
new Error(`Failed to serialize promise while rendering ${event.route.id}`)
|
|
3768
606
|
);
|
|
3769
|
-
data = void 0;
|
|
3770
607
|
str = uneval([, error2], replacer);
|
|
3771
608
|
}
|
|
3772
609
|
return {
|
|
@@ -3810,7 +647,7 @@ function server_data_serializer(event, event_state, options2) {
|
|
|
3810
647
|
event,
|
|
3811
648
|
/** @type {any} */
|
|
3812
649
|
e
|
|
3813
|
-
));
|
|
650
|
+
), { cause: e });
|
|
3814
651
|
}
|
|
3815
652
|
},
|
|
3816
653
|
get_data(csp) {
|
|
@@ -3903,7 +740,7 @@ function server_data_serializer_json(event, event_state, options2) {
|
|
|
3903
740
|
event,
|
|
3904
741
|
/** @type {any} */
|
|
3905
742
|
e
|
|
3906
|
-
));
|
|
743
|
+
), { cause: e });
|
|
3907
744
|
}
|
|
3908
745
|
},
|
|
3909
746
|
get_data() {
|
|
@@ -4435,16 +1272,22 @@ class BaseProvider {
|
|
|
4435
1272
|
#style_src_elem_needs_csp;
|
|
4436
1273
|
/** @type {import('types').CspDirectives} */
|
|
4437
1274
|
#directives;
|
|
4438
|
-
/** @type {import('types').Csp.Source
|
|
1275
|
+
/** @type {Set<import('types').Csp.Source>} */
|
|
4439
1276
|
#script_src;
|
|
4440
|
-
/** @type {import('types').Csp.Source
|
|
1277
|
+
/** @type {Set<import('types').Csp.Source>} */
|
|
4441
1278
|
#script_src_elem;
|
|
4442
|
-
/** @type {import('types').Csp.Source
|
|
1279
|
+
/** @type {Set<import('types').Csp.Source>} */
|
|
4443
1280
|
#style_src;
|
|
4444
|
-
/** @type {import('types').Csp.Source
|
|
1281
|
+
/** @type {Set<import('types').Csp.Source>} */
|
|
4445
1282
|
#style_src_attr;
|
|
4446
|
-
/** @type {import('types').Csp.Source
|
|
1283
|
+
/** @type {Set<import('types').Csp.Source>} */
|
|
4447
1284
|
#style_src_elem;
|
|
1285
|
+
/** @type {boolean} */
|
|
1286
|
+
script_needs_nonce;
|
|
1287
|
+
/** @type {boolean} */
|
|
1288
|
+
style_needs_nonce;
|
|
1289
|
+
/** @type {boolean} */
|
|
1290
|
+
script_needs_hash;
|
|
4448
1291
|
/** @type {string} */
|
|
4449
1292
|
#nonce;
|
|
4450
1293
|
/**
|
|
@@ -4456,26 +1299,28 @@ class BaseProvider {
|
|
|
4456
1299
|
this.#use_hashes = use_hashes;
|
|
4457
1300
|
this.#directives = directives;
|
|
4458
1301
|
const d = this.#directives;
|
|
4459
|
-
this.#script_src =
|
|
4460
|
-
this.#script_src_elem =
|
|
4461
|
-
this.#style_src =
|
|
4462
|
-
this.#style_src_attr =
|
|
4463
|
-
this.#style_src_elem =
|
|
1302
|
+
this.#script_src = /* @__PURE__ */ new Set();
|
|
1303
|
+
this.#script_src_elem = /* @__PURE__ */ new Set();
|
|
1304
|
+
this.#style_src = /* @__PURE__ */ new Set();
|
|
1305
|
+
this.#style_src_attr = /* @__PURE__ */ new Set();
|
|
1306
|
+
this.#style_src_elem = /* @__PURE__ */ new Set();
|
|
4464
1307
|
const effective_script_src = d["script-src"] || d["default-src"];
|
|
4465
1308
|
const script_src_elem = d["script-src-elem"];
|
|
4466
1309
|
const effective_style_src = d["style-src"] || d["default-src"];
|
|
4467
1310
|
const style_src_attr = d["style-src-attr"];
|
|
4468
1311
|
const style_src_elem = d["style-src-elem"];
|
|
4469
|
-
const
|
|
4470
|
-
|
|
4471
|
-
this.#
|
|
4472
|
-
this.#
|
|
4473
|
-
this.#
|
|
4474
|
-
this.#
|
|
1312
|
+
const style_needs_csp = (directive) => !!directive && !directive.some((value) => value === "unsafe-inline");
|
|
1313
|
+
const script_needs_csp = (directive) => !!directive && (!directive.some((value) => value === "unsafe-inline") || directive.some((value) => value === "strict-dynamic"));
|
|
1314
|
+
this.#script_src_needs_csp = script_needs_csp(effective_script_src);
|
|
1315
|
+
this.#script_src_elem_needs_csp = script_needs_csp(script_src_elem);
|
|
1316
|
+
this.#style_src_needs_csp = style_needs_csp(effective_style_src);
|
|
1317
|
+
this.#style_src_attr_needs_csp = style_needs_csp(style_src_attr);
|
|
1318
|
+
this.#style_src_elem_needs_csp = style_needs_csp(style_src_elem);
|
|
4475
1319
|
this.#script_needs_csp = this.#script_src_needs_csp || this.#script_src_elem_needs_csp;
|
|
4476
1320
|
this.#style_needs_csp = this.#style_src_needs_csp || this.#style_src_attr_needs_csp || this.#style_src_elem_needs_csp;
|
|
4477
1321
|
this.script_needs_nonce = this.#script_needs_csp && !this.#use_hashes;
|
|
4478
1322
|
this.style_needs_nonce = this.#style_needs_csp && !this.#use_hashes;
|
|
1323
|
+
this.script_needs_hash = this.#script_needs_csp && this.#use_hashes;
|
|
4479
1324
|
this.#nonce = nonce;
|
|
4480
1325
|
}
|
|
4481
1326
|
/** @param {string} content */
|
|
@@ -4483,10 +1328,21 @@ class BaseProvider {
|
|
|
4483
1328
|
if (!this.#script_needs_csp) return;
|
|
4484
1329
|
const source = this.#use_hashes ? `sha256-${sha256(content)}` : `nonce-${this.#nonce}`;
|
|
4485
1330
|
if (this.#script_src_needs_csp) {
|
|
4486
|
-
this.#script_src.
|
|
1331
|
+
this.#script_src.add(source);
|
|
4487
1332
|
}
|
|
4488
1333
|
if (this.#script_src_elem_needs_csp) {
|
|
4489
|
-
this.#script_src_elem.
|
|
1334
|
+
this.#script_src_elem.add(source);
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1337
|
+
/** @param {`sha256-${string}`[]} hashes */
|
|
1338
|
+
add_script_hashes(hashes) {
|
|
1339
|
+
for (const hash2 of hashes) {
|
|
1340
|
+
if (this.#script_src_needs_csp) {
|
|
1341
|
+
this.#script_src.add(hash2);
|
|
1342
|
+
}
|
|
1343
|
+
if (this.#script_src_elem_needs_csp) {
|
|
1344
|
+
this.#script_src_elem.add(hash2);
|
|
1345
|
+
}
|
|
4490
1346
|
}
|
|
4491
1347
|
}
|
|
4492
1348
|
/** @param {string} content */
|
|
@@ -4494,19 +1350,19 @@ class BaseProvider {
|
|
|
4494
1350
|
if (!this.#style_needs_csp) return;
|
|
4495
1351
|
const source = this.#use_hashes ? `sha256-${sha256(content)}` : `nonce-${this.#nonce}`;
|
|
4496
1352
|
if (this.#style_src_needs_csp) {
|
|
4497
|
-
this.#style_src.
|
|
1353
|
+
this.#style_src.add(source);
|
|
4498
1354
|
}
|
|
4499
1355
|
if (this.#style_src_attr_needs_csp) {
|
|
4500
|
-
this.#style_src_attr.
|
|
1356
|
+
this.#style_src_attr.add(source);
|
|
4501
1357
|
}
|
|
4502
1358
|
if (this.#style_src_elem_needs_csp) {
|
|
4503
1359
|
const sha256_empty_comment_hash = "sha256-9OlNO0DNEeaVzHL4RZwCLsBHA8WBQ8toBp/4F5XV2nc=";
|
|
4504
1360
|
const d = this.#directives;
|
|
4505
|
-
if (d["style-src-elem"] && !d["style-src-elem"].includes(sha256_empty_comment_hash) && !this.#style_src_elem.
|
|
4506
|
-
this.#style_src_elem.
|
|
1361
|
+
if (d["style-src-elem"] && !d["style-src-elem"].includes(sha256_empty_comment_hash) && !this.#style_src_elem.has(sha256_empty_comment_hash)) {
|
|
1362
|
+
this.#style_src_elem.add(sha256_empty_comment_hash);
|
|
4507
1363
|
}
|
|
4508
1364
|
if (source !== sha256_empty_comment_hash) {
|
|
4509
|
-
this.#style_src_elem.
|
|
1365
|
+
this.#style_src_elem.add(source);
|
|
4510
1366
|
}
|
|
4511
1367
|
}
|
|
4512
1368
|
}
|
|
@@ -4516,31 +1372,31 @@ class BaseProvider {
|
|
|
4516
1372
|
get_header(is_meta = false) {
|
|
4517
1373
|
const header = [];
|
|
4518
1374
|
const directives = { ...this.#directives };
|
|
4519
|
-
if (this.#style_src.
|
|
1375
|
+
if (this.#style_src.size > 0) {
|
|
4520
1376
|
directives["style-src"] = [
|
|
4521
1377
|
...directives["style-src"] || directives["default-src"] || [],
|
|
4522
1378
|
...this.#style_src
|
|
4523
1379
|
];
|
|
4524
1380
|
}
|
|
4525
|
-
if (this.#style_src_attr.
|
|
1381
|
+
if (this.#style_src_attr.size > 0) {
|
|
4526
1382
|
directives["style-src-attr"] = [
|
|
4527
1383
|
...directives["style-src-attr"] || [],
|
|
4528
1384
|
...this.#style_src_attr
|
|
4529
1385
|
];
|
|
4530
1386
|
}
|
|
4531
|
-
if (this.#style_src_elem.
|
|
1387
|
+
if (this.#style_src_elem.size > 0) {
|
|
4532
1388
|
directives["style-src-elem"] = [
|
|
4533
1389
|
...directives["style-src-elem"] || [],
|
|
4534
1390
|
...this.#style_src_elem
|
|
4535
1391
|
];
|
|
4536
1392
|
}
|
|
4537
|
-
if (this.#script_src.
|
|
1393
|
+
if (this.#script_src.size > 0) {
|
|
4538
1394
|
directives["script-src"] = [
|
|
4539
1395
|
...directives["script-src"] || directives["default-src"] || [],
|
|
4540
1396
|
...this.#script_src
|
|
4541
1397
|
];
|
|
4542
1398
|
}
|
|
4543
|
-
if (this.#script_src_elem.
|
|
1399
|
+
if (this.#script_src_elem.size > 0) {
|
|
4544
1400
|
directives["script-src-elem"] = [
|
|
4545
1401
|
...directives["script-src-elem"] || [],
|
|
4546
1402
|
...this.#script_src_elem
|
|
@@ -4614,6 +1470,9 @@ class Csp {
|
|
|
4614
1470
|
this.csp_provider = new CspProvider(use_hashes, directives, this.nonce);
|
|
4615
1471
|
this.report_only_provider = new CspReportOnlyProvider(use_hashes, reportOnly, this.nonce);
|
|
4616
1472
|
}
|
|
1473
|
+
get script_needs_hash() {
|
|
1474
|
+
return this.csp_provider.script_needs_hash || this.report_only_provider.script_needs_hash;
|
|
1475
|
+
}
|
|
4617
1476
|
get script_needs_nonce() {
|
|
4618
1477
|
return this.csp_provider.script_needs_nonce || this.report_only_provider.script_needs_nonce;
|
|
4619
1478
|
}
|
|
@@ -4625,6 +1484,11 @@ class Csp {
|
|
|
4625
1484
|
this.csp_provider.add_script(content);
|
|
4626
1485
|
this.report_only_provider.add_script(content);
|
|
4627
1486
|
}
|
|
1487
|
+
/** @param {`sha256-${string}`[]} hashes */
|
|
1488
|
+
add_script_hashes(hashes) {
|
|
1489
|
+
this.csp_provider.add_script_hashes(hashes);
|
|
1490
|
+
this.report_only_provider.add_script_hashes(hashes);
|
|
1491
|
+
}
|
|
4628
1492
|
/** @param {string} content */
|
|
4629
1493
|
add_style(content) {
|
|
4630
1494
|
this.csp_provider.add_style(content);
|
|
@@ -4662,20 +1526,9 @@ async function resolve_route(resolved_path, url, manifest) {
|
|
|
4662
1526
|
if (!manifest._.client.routes) {
|
|
4663
1527
|
return text("Server-side route resolution disabled", { status: 400 });
|
|
4664
1528
|
}
|
|
4665
|
-
let route = null;
|
|
4666
|
-
let params = {};
|
|
4667
1529
|
const matchers = await manifest._.matchers();
|
|
4668
|
-
|
|
4669
|
-
|
|
4670
|
-
if (!match) continue;
|
|
4671
|
-
const matched = exec(match, candidate.params, matchers);
|
|
4672
|
-
if (matched) {
|
|
4673
|
-
route = candidate;
|
|
4674
|
-
params = decode_params(matched);
|
|
4675
|
-
break;
|
|
4676
|
-
}
|
|
4677
|
-
}
|
|
4678
|
-
return create_server_routing_response(route, params, url, manifest).response;
|
|
1530
|
+
const result = find_route(resolved_path, manifest._.client.routes, matchers);
|
|
1531
|
+
return create_server_routing_response(result?.route ?? null, result?.params ?? {}, url, manifest).response;
|
|
4679
1532
|
}
|
|
4680
1533
|
function create_server_routing_response(route, params, url, manifest) {
|
|
4681
1534
|
const headers2 = new Headers({
|
|
@@ -4739,13 +1592,15 @@ async function render_response({
|
|
|
4739
1592
|
const stylesheets = new Set(client.stylesheets);
|
|
4740
1593
|
const fonts = new Set(client.fonts);
|
|
4741
1594
|
const link_headers = /* @__PURE__ */ new Set();
|
|
4742
|
-
const link_tags = /* @__PURE__ */ new Set();
|
|
4743
1595
|
const inline_styles = /* @__PURE__ */ new Map();
|
|
4744
1596
|
let rendered;
|
|
4745
1597
|
const form_value = action_result?.type === "success" || action_result?.type === "failure" ? action_result.data ?? null : null;
|
|
4746
1598
|
let base$1 = base;
|
|
4747
1599
|
let assets$1 = assets;
|
|
4748
1600
|
let base_expression = s(base);
|
|
1601
|
+
const csp = new Csp(options2.csp, {
|
|
1602
|
+
prerender: !!state.prerendering
|
|
1603
|
+
});
|
|
4749
1604
|
{
|
|
4750
1605
|
if (!state.prerendering?.fallback) {
|
|
4751
1606
|
const segments = event.url.pathname.slice(base.length).split("/").slice(2);
|
|
@@ -4801,10 +1656,12 @@ async function render_response({
|
|
|
4801
1656
|
page: props.page
|
|
4802
1657
|
}
|
|
4803
1658
|
]
|
|
4804
|
-
])
|
|
1659
|
+
]),
|
|
1660
|
+
csp: csp.script_needs_nonce ? { nonce: csp.nonce } : { hash: csp.script_needs_hash }
|
|
4805
1661
|
};
|
|
4806
1662
|
try {
|
|
4807
1663
|
if (DEV) ;
|
|
1664
|
+
event_state.allows_commands = false;
|
|
4808
1665
|
rendered = await with_request_store({ event, state: event_state }, async () => {
|
|
4809
1666
|
if (relative) override({ base: base$1, assets: assets$1 });
|
|
4810
1667
|
const maybe_promise = options2.root.render(props, render_opts);
|
|
@@ -4815,8 +1672,14 @@ async function render_response({
|
|
|
4815
1672
|
if (options2.async) {
|
|
4816
1673
|
reset();
|
|
4817
1674
|
}
|
|
4818
|
-
const { head: head2, html: html2, css } =
|
|
4819
|
-
|
|
1675
|
+
const { head: head2, html: html2, css, hashes } = (
|
|
1676
|
+
/** @type {ReturnType<typeof options.root.render>} */
|
|
1677
|
+
options2.async ? await rendered2 : rendered2
|
|
1678
|
+
);
|
|
1679
|
+
if (hashes) {
|
|
1680
|
+
csp.add_script_hashes(hashes.script);
|
|
1681
|
+
}
|
|
1682
|
+
return { head: head2, html: html2, css, hashes };
|
|
4820
1683
|
});
|
|
4821
1684
|
} finally {
|
|
4822
1685
|
reset();
|
|
@@ -4826,17 +1689,20 @@ async function render_response({
|
|
|
4826
1689
|
for (const url of node.stylesheets) stylesheets.add(url);
|
|
4827
1690
|
for (const url of node.fonts) fonts.add(url);
|
|
4828
1691
|
if (node.inline_styles && !client.inline) {
|
|
4829
|
-
Object.entries(await node.inline_styles()).forEach(([
|
|
1692
|
+
Object.entries(await node.inline_styles()).forEach(([filename, css]) => {
|
|
1693
|
+
if (typeof css === "string") {
|
|
1694
|
+
inline_styles.set(filename, css);
|
|
1695
|
+
return;
|
|
1696
|
+
}
|
|
1697
|
+
inline_styles.set(filename, css(`${assets$1}/${app_dir}/immutable/assets`, assets$1));
|
|
1698
|
+
});
|
|
4830
1699
|
}
|
|
4831
1700
|
}
|
|
4832
1701
|
} else {
|
|
4833
|
-
rendered = { head: "", html: "", css: { code: "", map: null } };
|
|
1702
|
+
rendered = { head: "", html: "", css: { code: "", map: null }, hashes: { script: [] } };
|
|
4834
1703
|
}
|
|
4835
|
-
|
|
1704
|
+
const head = new Head(rendered.head, !!state.prerendering);
|
|
4836
1705
|
let body2 = rendered.html;
|
|
4837
|
-
const csp = new Csp(options2.csp, {
|
|
4838
|
-
prerender: !!state.prerendering
|
|
4839
|
-
});
|
|
4840
1706
|
const prefixed = (path) => {
|
|
4841
1707
|
if (path.startsWith("/")) {
|
|
4842
1708
|
return base + path;
|
|
@@ -4846,10 +1712,9 @@ async function render_response({
|
|
|
4846
1712
|
const style = client.inline ? client.inline?.style : Array.from(inline_styles.values()).join("\n");
|
|
4847
1713
|
if (style) {
|
|
4848
1714
|
const attributes = [];
|
|
4849
|
-
if (csp.style_needs_nonce) attributes.push(`
|
|
1715
|
+
if (csp.style_needs_nonce) attributes.push(`nonce="${csp.nonce}"`);
|
|
4850
1716
|
csp.add_style(style);
|
|
4851
|
-
head
|
|
4852
|
-
<style${attributes.join("")}>${style}</style>`;
|
|
1717
|
+
head.add_style(style, attributes);
|
|
4853
1718
|
}
|
|
4854
1719
|
for (const dep of stylesheets) {
|
|
4855
1720
|
const path = prefixed(dep);
|
|
@@ -4861,14 +1726,13 @@ async function render_response({
|
|
|
4861
1726
|
link_headers.add(`<${encodeURI(path)}>; rel="preload"; as="style"; nopush`);
|
|
4862
1727
|
}
|
|
4863
1728
|
}
|
|
4864
|
-
head
|
|
4865
|
-
<link href="${path}" ${attributes.join(" ")}>`;
|
|
1729
|
+
head.add_stylesheet(path, attributes);
|
|
4866
1730
|
}
|
|
4867
1731
|
for (const dep of fonts) {
|
|
4868
1732
|
const path = prefixed(dep);
|
|
4869
1733
|
if (resolve_opts.preload({ type: "font", path })) {
|
|
4870
1734
|
const ext = dep.slice(dep.lastIndexOf(".") + 1);
|
|
4871
|
-
|
|
1735
|
+
head.add_link_tag(path, ['rel="preload"', 'as="font"', `type="font/${ext}"`, "crossorigin"]);
|
|
4872
1736
|
link_headers.add(
|
|
4873
1737
|
`<${encodeURI(path)}>; rel="preload"; as="font"; type="font/${ext}"; crossorigin; nopush`
|
|
4874
1738
|
);
|
|
@@ -4894,17 +1758,12 @@ async function render_response({
|
|
|
4894
1758
|
for (const path of included_modulepreloads) {
|
|
4895
1759
|
link_headers.add(`<${encodeURI(path)}>; rel="modulepreload"; nopush`);
|
|
4896
1760
|
if (options2.preload_strategy !== "modulepreload") {
|
|
4897
|
-
head
|
|
4898
|
-
<link rel="preload" as="script" crossorigin="anonymous" href="${path}">`;
|
|
1761
|
+
head.add_script_preload(path);
|
|
4899
1762
|
} else {
|
|
4900
|
-
|
|
1763
|
+
head.add_link_tag(path, ['rel="modulepreload"']);
|
|
4901
1764
|
}
|
|
4902
1765
|
}
|
|
4903
1766
|
}
|
|
4904
|
-
if (state.prerendering && link_tags.size > 0) {
|
|
4905
|
-
head += Array.from(link_tags).map((tag) => `
|
|
4906
|
-
${tag}`).join("");
|
|
4907
|
-
}
|
|
4908
1767
|
if (manifest._.client.routes && state.prerendering && !state.prerendering.fallback) {
|
|
4909
1768
|
const pathname = add_resolution_suffix(event.url.pathname);
|
|
4910
1769
|
state.prerendering.dependencies.set(
|
|
@@ -5066,16 +1925,14 @@ ${indent}}`);
|
|
|
5066
1925
|
"content-type": "text/html"
|
|
5067
1926
|
});
|
|
5068
1927
|
if (state.prerendering) {
|
|
5069
|
-
const http_equiv = [];
|
|
5070
1928
|
const csp_headers = csp.csp_provider.get_meta();
|
|
5071
1929
|
if (csp_headers) {
|
|
5072
|
-
|
|
1930
|
+
head.add_http_equiv(csp_headers);
|
|
5073
1931
|
}
|
|
5074
1932
|
if (state.prerendering.cache) {
|
|
5075
|
-
|
|
5076
|
-
|
|
5077
|
-
|
|
5078
|
-
head = http_equiv.join("\n") + head;
|
|
1933
|
+
head.add_http_equiv(
|
|
1934
|
+
`<meta http-equiv="cache-control" content="${state.prerendering.cache}">`
|
|
1935
|
+
);
|
|
5079
1936
|
}
|
|
5080
1937
|
} else {
|
|
5081
1938
|
const csp_header = csp.csp_provider.get_header();
|
|
@@ -5090,9 +1947,8 @@ ${indent}}`);
|
|
|
5090
1947
|
headers2.set("link", Array.from(link_headers).join(", "));
|
|
5091
1948
|
}
|
|
5092
1949
|
}
|
|
5093
|
-
head += rendered.head;
|
|
5094
1950
|
const html = options2.templates.app({
|
|
5095
|
-
head,
|
|
1951
|
+
head: head.build(),
|
|
5096
1952
|
body: body2,
|
|
5097
1953
|
assets: assets$1,
|
|
5098
1954
|
nonce: (
|
|
@@ -5127,6 +1983,73 @@ ${indent}}`);
|
|
|
5127
1983
|
}
|
|
5128
1984
|
);
|
|
5129
1985
|
}
|
|
1986
|
+
class Head {
|
|
1987
|
+
#rendered;
|
|
1988
|
+
#prerendering;
|
|
1989
|
+
/** @type {string[]} */
|
|
1990
|
+
#http_equiv = [];
|
|
1991
|
+
/** @type {string[]} */
|
|
1992
|
+
#link_tags = [];
|
|
1993
|
+
/** @type {string[]} */
|
|
1994
|
+
#script_preloads = [];
|
|
1995
|
+
/** @type {string[]} */
|
|
1996
|
+
#style_tags = [];
|
|
1997
|
+
/** @type {string[]} */
|
|
1998
|
+
#stylesheet_links = [];
|
|
1999
|
+
/**
|
|
2000
|
+
* @param {string} rendered
|
|
2001
|
+
* @param {boolean} prerendering
|
|
2002
|
+
*/
|
|
2003
|
+
constructor(rendered, prerendering) {
|
|
2004
|
+
this.#rendered = rendered;
|
|
2005
|
+
this.#prerendering = prerendering;
|
|
2006
|
+
}
|
|
2007
|
+
build() {
|
|
2008
|
+
return [
|
|
2009
|
+
...this.#http_equiv,
|
|
2010
|
+
...this.#link_tags,
|
|
2011
|
+
...this.#script_preloads,
|
|
2012
|
+
this.#rendered,
|
|
2013
|
+
...this.#style_tags,
|
|
2014
|
+
...this.#stylesheet_links
|
|
2015
|
+
].join("\n ");
|
|
2016
|
+
}
|
|
2017
|
+
/**
|
|
2018
|
+
* @param {string} style
|
|
2019
|
+
* @param {string[]} attributes
|
|
2020
|
+
*/
|
|
2021
|
+
add_style(style, attributes) {
|
|
2022
|
+
this.#style_tags.push(
|
|
2023
|
+
`<style${attributes.length ? " " + attributes.join(" ") : ""}>${style}</style>`
|
|
2024
|
+
);
|
|
2025
|
+
}
|
|
2026
|
+
/**
|
|
2027
|
+
* @param {string} href
|
|
2028
|
+
* @param {string[]} attributes
|
|
2029
|
+
*/
|
|
2030
|
+
add_stylesheet(href, attributes) {
|
|
2031
|
+
this.#stylesheet_links.push(`<link href="${href}" ${attributes.join(" ")}>`);
|
|
2032
|
+
}
|
|
2033
|
+
/** @param {string} href */
|
|
2034
|
+
add_script_preload(href) {
|
|
2035
|
+
this.#script_preloads.push(
|
|
2036
|
+
`<link rel="preload" as="script" crossorigin="anonymous" href="${href}">`
|
|
2037
|
+
);
|
|
2038
|
+
}
|
|
2039
|
+
/**
|
|
2040
|
+
* @param {string} href
|
|
2041
|
+
* @param {string[]} attributes
|
|
2042
|
+
*/
|
|
2043
|
+
add_link_tag(href, attributes) {
|
|
2044
|
+
if (!this.#prerendering) return;
|
|
2045
|
+
this.#link_tags.push(`<link href="${href}" ${attributes.join(" ")}>`);
|
|
2046
|
+
}
|
|
2047
|
+
/** @param {string} tag */
|
|
2048
|
+
add_http_equiv(tag) {
|
|
2049
|
+
if (!this.#prerendering) return;
|
|
2050
|
+
this.#http_equiv.push(tag);
|
|
2051
|
+
}
|
|
2052
|
+
}
|
|
5130
2053
|
class PageNodes {
|
|
5131
2054
|
data;
|
|
5132
2055
|
/**
|
|
@@ -5345,21 +2268,10 @@ async function handle_remote_call_internal(event, state, options2, manifest, id)
|
|
|
5345
2268
|
);
|
|
5346
2269
|
}
|
|
5347
2270
|
const { payloads } = await event.request.json();
|
|
5348
|
-
const args =
|
|
5349
|
-
|
|
5350
|
-
const results = await Promise.all(
|
|
5351
|
-
args.map(async (arg, i) => {
|
|
5352
|
-
try {
|
|
5353
|
-
return { type: "result", data: get_result(arg, i) };
|
|
5354
|
-
} catch (error2) {
|
|
5355
|
-
return {
|
|
5356
|
-
type: "error",
|
|
5357
|
-
error: await handle_error_and_jsonify(event, state, options2, error2),
|
|
5358
|
-
status: error2 instanceof HttpError || error2 instanceof SvelteKitError ? error2.status : 500
|
|
5359
|
-
};
|
|
5360
|
-
}
|
|
5361
|
-
})
|
|
2271
|
+
const args = await Promise.all(
|
|
2272
|
+
payloads.map((payload2) => parse_remote_arg(payload2, transport))
|
|
5362
2273
|
);
|
|
2274
|
+
const results = await with_request_store({ event, state }, () => info.run(args, options2));
|
|
5363
2275
|
return json(
|
|
5364
2276
|
/** @type {RemoteFunctionResponse} */
|
|
5365
2277
|
{
|
|
@@ -5386,6 +2298,7 @@ async function handle_remote_call_internal(event, state, options2, manifest, id)
|
|
|
5386
2298
|
);
|
|
5387
2299
|
}
|
|
5388
2300
|
const { data: data2, meta, form_data } = await deserialize_binary_form(event.request);
|
|
2301
|
+
form_client_refreshes = meta.remote_refreshes;
|
|
5389
2302
|
if (additional_args && !("id" in data2)) {
|
|
5390
2303
|
data2.id = JSON.parse(decodeURIComponent(additional_args));
|
|
5391
2304
|
}
|
|
@@ -5801,13 +2714,16 @@ async function render_page(event, event_state, page, options2, manifest, state,
|
|
|
5801
2714
|
data_serializer: ssr === false ? server_data_serializer(event, event_state, options2) : data_serializer
|
|
5802
2715
|
});
|
|
5803
2716
|
} catch (e) {
|
|
2717
|
+
if (e instanceof Redirect) {
|
|
2718
|
+
return redirect_response(e.status, e.location);
|
|
2719
|
+
}
|
|
5804
2720
|
return await respond_with_error({
|
|
5805
2721
|
event,
|
|
5806
2722
|
event_state,
|
|
5807
2723
|
options: options2,
|
|
5808
2724
|
manifest,
|
|
5809
2725
|
state,
|
|
5810
|
-
status: 500,
|
|
2726
|
+
status: e instanceof HttpError ? e.status : 500,
|
|
5811
2727
|
error: e,
|
|
5812
2728
|
resolve_opts
|
|
5813
2729
|
});
|
|
@@ -6262,190 +3178,193 @@ function add_cookies_to_headers(headers2, cookies) {
|
|
|
6262
3178
|
}
|
|
6263
3179
|
}
|
|
6264
3180
|
}
|
|
6265
|
-
var
|
|
6266
|
-
|
|
6267
|
-
|
|
6268
|
-
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
|
|
6274
|
-
|
|
6275
|
-
|
|
6276
|
-
|
|
6277
|
-
|
|
6278
|
-
|
|
6279
|
-
|
|
3181
|
+
var defaultParseOptions = {
|
|
3182
|
+
decodeValues: true,
|
|
3183
|
+
map: false,
|
|
3184
|
+
silent: false,
|
|
3185
|
+
split: "auto"
|
|
3186
|
+
// auto = split strings but not arrays
|
|
3187
|
+
};
|
|
3188
|
+
function isForbiddenKey(key2) {
|
|
3189
|
+
return typeof key2 !== "string" || key2 in {};
|
|
3190
|
+
}
|
|
3191
|
+
function createNullObj() {
|
|
3192
|
+
return /* @__PURE__ */ Object.create(null);
|
|
3193
|
+
}
|
|
3194
|
+
function isNonEmptyString(str) {
|
|
3195
|
+
return typeof str === "string" && !!str.trim();
|
|
3196
|
+
}
|
|
3197
|
+
function parseString(setCookieValue, options2) {
|
|
3198
|
+
var parts = setCookieValue.split(";").filter(isNonEmptyString);
|
|
3199
|
+
var nameValuePairStr = parts.shift();
|
|
3200
|
+
var parsed = parseNameValuePair(nameValuePairStr);
|
|
3201
|
+
var name = parsed.name;
|
|
3202
|
+
var value = parsed.value;
|
|
3203
|
+
options2 = options2 ? Object.assign({}, defaultParseOptions, options2) : defaultParseOptions;
|
|
3204
|
+
if (isForbiddenKey(name)) {
|
|
3205
|
+
return null;
|
|
6280
3206
|
}
|
|
6281
|
-
|
|
6282
|
-
|
|
3207
|
+
try {
|
|
3208
|
+
value = options2.decodeValues ? decodeURIComponent(value) : value;
|
|
3209
|
+
} catch (e) {
|
|
3210
|
+
console.error(
|
|
3211
|
+
"set-cookie-parser: failed to decode cookie value. Set options.decodeValues=false to disable decoding.",
|
|
3212
|
+
e
|
|
3213
|
+
);
|
|
6283
3214
|
}
|
|
6284
|
-
|
|
6285
|
-
|
|
6286
|
-
|
|
6287
|
-
|
|
6288
|
-
var
|
|
6289
|
-
var
|
|
6290
|
-
|
|
6291
|
-
|
|
6292
|
-
return null;
|
|
6293
|
-
}
|
|
6294
|
-
try {
|
|
6295
|
-
value = options2.decodeValues ? decodeURIComponent(value) : value;
|
|
6296
|
-
} catch (e) {
|
|
6297
|
-
console.error(
|
|
6298
|
-
"set-cookie-parser: failed to decode cookie value. Set options.decodeValues=false to disable decoding.",
|
|
6299
|
-
e
|
|
6300
|
-
);
|
|
3215
|
+
var cookie2 = createNullObj();
|
|
3216
|
+
cookie2.name = name;
|
|
3217
|
+
cookie2.value = value;
|
|
3218
|
+
parts.forEach(function(part) {
|
|
3219
|
+
var sides = part.split("=");
|
|
3220
|
+
var key2 = sides.shift().trimLeft().toLowerCase();
|
|
3221
|
+
if (isForbiddenKey(key2)) {
|
|
3222
|
+
return;
|
|
6301
3223
|
}
|
|
6302
|
-
var
|
|
6303
|
-
|
|
6304
|
-
|
|
6305
|
-
|
|
6306
|
-
var
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
|
|
6310
|
-
|
|
6311
|
-
|
|
6312
|
-
|
|
6313
|
-
|
|
6314
|
-
|
|
6315
|
-
|
|
6316
|
-
|
|
6317
|
-
|
|
6318
|
-
cookie2.secure = true;
|
|
6319
|
-
} else if (key2 === "httponly") {
|
|
6320
|
-
cookie2.httpOnly = true;
|
|
6321
|
-
} else if (key2 === "samesite") {
|
|
6322
|
-
cookie2.sameSite = value2;
|
|
6323
|
-
} else if (key2 === "partitioned") {
|
|
6324
|
-
cookie2.partitioned = true;
|
|
6325
|
-
} else if (key2) {
|
|
6326
|
-
cookie2[key2] = value2;
|
|
6327
|
-
}
|
|
6328
|
-
});
|
|
6329
|
-
return cookie2;
|
|
6330
|
-
}
|
|
6331
|
-
function parseNameValuePair(nameValuePairStr) {
|
|
6332
|
-
var name = "";
|
|
6333
|
-
var value = "";
|
|
6334
|
-
var nameValueArr = nameValuePairStr.split("=");
|
|
6335
|
-
if (nameValueArr.length > 1) {
|
|
6336
|
-
name = nameValueArr.shift();
|
|
6337
|
-
value = nameValueArr.join("=");
|
|
6338
|
-
} else {
|
|
6339
|
-
value = nameValuePairStr;
|
|
3224
|
+
var value2 = sides.join("=");
|
|
3225
|
+
if (key2 === "expires") {
|
|
3226
|
+
cookie2.expires = new Date(value2);
|
|
3227
|
+
} else if (key2 === "max-age") {
|
|
3228
|
+
var n = parseInt(value2, 10);
|
|
3229
|
+
if (!Number.isNaN(n)) cookie2.maxAge = n;
|
|
3230
|
+
} else if (key2 === "secure") {
|
|
3231
|
+
cookie2.secure = true;
|
|
3232
|
+
} else if (key2 === "httponly") {
|
|
3233
|
+
cookie2.httpOnly = true;
|
|
3234
|
+
} else if (key2 === "samesite") {
|
|
3235
|
+
cookie2.sameSite = value2;
|
|
3236
|
+
} else if (key2 === "partitioned") {
|
|
3237
|
+
cookie2.partitioned = true;
|
|
3238
|
+
} else if (key2) {
|
|
3239
|
+
cookie2[key2] = value2;
|
|
6340
3240
|
}
|
|
6341
|
-
|
|
3241
|
+
});
|
|
3242
|
+
return cookie2;
|
|
3243
|
+
}
|
|
3244
|
+
function parseNameValuePair(nameValuePairStr) {
|
|
3245
|
+
var name = "";
|
|
3246
|
+
var value = "";
|
|
3247
|
+
var nameValueArr = nameValuePairStr.split("=");
|
|
3248
|
+
if (nameValueArr.length > 1) {
|
|
3249
|
+
name = nameValueArr.shift();
|
|
3250
|
+
value = nameValueArr.join("=");
|
|
3251
|
+
} else {
|
|
3252
|
+
value = nameValuePairStr;
|
|
6342
3253
|
}
|
|
6343
|
-
|
|
6344
|
-
|
|
6345
|
-
|
|
6346
|
-
|
|
6347
|
-
|
|
6348
|
-
} else {
|
|
6349
|
-
return createNullObj();
|
|
6350
|
-
}
|
|
6351
|
-
}
|
|
6352
|
-
if (input.headers) {
|
|
6353
|
-
if (typeof input.headers.getSetCookie === "function") {
|
|
6354
|
-
input = input.headers.getSetCookie();
|
|
6355
|
-
} else if (input.headers["set-cookie"]) {
|
|
6356
|
-
input = input.headers["set-cookie"];
|
|
6357
|
-
} else {
|
|
6358
|
-
var sch = input.headers[Object.keys(input.headers).find(function(key2) {
|
|
6359
|
-
return key2.toLowerCase() === "set-cookie";
|
|
6360
|
-
})];
|
|
6361
|
-
if (!sch && input.headers.cookie && !options2.silent) {
|
|
6362
|
-
console.warn(
|
|
6363
|
-
"Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."
|
|
6364
|
-
);
|
|
6365
|
-
}
|
|
6366
|
-
input = sch;
|
|
6367
|
-
}
|
|
6368
|
-
}
|
|
6369
|
-
if (!Array.isArray(input)) {
|
|
6370
|
-
input = [input];
|
|
6371
|
-
}
|
|
3254
|
+
return { name, value };
|
|
3255
|
+
}
|
|
3256
|
+
function parseSetCookie(input, options2) {
|
|
3257
|
+
options2 = options2 ? Object.assign({}, defaultParseOptions, options2) : defaultParseOptions;
|
|
3258
|
+
if (!input) {
|
|
6372
3259
|
if (!options2.map) {
|
|
6373
|
-
return
|
|
6374
|
-
return parseString(str, options2);
|
|
6375
|
-
}).filter(Boolean);
|
|
3260
|
+
return [];
|
|
6376
3261
|
} else {
|
|
6377
|
-
|
|
6378
|
-
return input.filter(isNonEmptyString).reduce(function(cookies2, str) {
|
|
6379
|
-
var cookie2 = parseString(str, options2);
|
|
6380
|
-
if (cookie2 && !isForbiddenKey(cookie2.name)) {
|
|
6381
|
-
cookies2[cookie2.name] = cookie2;
|
|
6382
|
-
}
|
|
6383
|
-
return cookies2;
|
|
6384
|
-
}, cookies);
|
|
3262
|
+
return createNullObj();
|
|
6385
3263
|
}
|
|
6386
3264
|
}
|
|
6387
|
-
|
|
6388
|
-
if (
|
|
6389
|
-
|
|
6390
|
-
}
|
|
6391
|
-
|
|
6392
|
-
|
|
6393
|
-
|
|
6394
|
-
|
|
6395
|
-
|
|
6396
|
-
|
|
6397
|
-
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
var cookiesSeparatorFound;
|
|
6401
|
-
function skipWhitespace() {
|
|
6402
|
-
while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) {
|
|
6403
|
-
pos += 1;
|
|
3265
|
+
if (input.headers) {
|
|
3266
|
+
if (typeof input.headers.getSetCookie === "function") {
|
|
3267
|
+
input = input.headers.getSetCookie();
|
|
3268
|
+
} else if (input.headers["set-cookie"]) {
|
|
3269
|
+
input = input.headers["set-cookie"];
|
|
3270
|
+
} else {
|
|
3271
|
+
var sch = input.headers[Object.keys(input.headers).find(function(key2) {
|
|
3272
|
+
return key2.toLowerCase() === "set-cookie";
|
|
3273
|
+
})];
|
|
3274
|
+
if (!sch && input.headers.cookie && !options2.silent) {
|
|
3275
|
+
console.warn(
|
|
3276
|
+
"Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."
|
|
3277
|
+
);
|
|
6404
3278
|
}
|
|
6405
|
-
|
|
3279
|
+
input = sch;
|
|
6406
3280
|
}
|
|
6407
|
-
|
|
3281
|
+
}
|
|
3282
|
+
var split = options2.split;
|
|
3283
|
+
var isArray = Array.isArray(input);
|
|
3284
|
+
if (split === "auto") {
|
|
3285
|
+
split = !isArray;
|
|
3286
|
+
}
|
|
3287
|
+
if (!isArray) {
|
|
3288
|
+
input = [input];
|
|
3289
|
+
}
|
|
3290
|
+
input = input.filter(isNonEmptyString);
|
|
3291
|
+
if (split) {
|
|
3292
|
+
input = input.map(splitCookiesString).flat();
|
|
3293
|
+
}
|
|
3294
|
+
if (!options2.map) {
|
|
3295
|
+
return input.map(function(str) {
|
|
3296
|
+
return parseString(str, options2);
|
|
3297
|
+
}).filter(Boolean);
|
|
3298
|
+
} else {
|
|
3299
|
+
var cookies = createNullObj();
|
|
3300
|
+
return input.reduce(function(cookies2, str) {
|
|
3301
|
+
var cookie2 = parseString(str, options2);
|
|
3302
|
+
if (cookie2 && !isForbiddenKey(cookie2.name)) {
|
|
3303
|
+
cookies2[cookie2.name] = cookie2;
|
|
3304
|
+
}
|
|
3305
|
+
return cookies2;
|
|
3306
|
+
}, cookies);
|
|
3307
|
+
}
|
|
3308
|
+
}
|
|
3309
|
+
function splitCookiesString(cookiesString) {
|
|
3310
|
+
if (Array.isArray(cookiesString)) {
|
|
3311
|
+
return cookiesString;
|
|
3312
|
+
}
|
|
3313
|
+
if (typeof cookiesString !== "string") {
|
|
3314
|
+
return [];
|
|
3315
|
+
}
|
|
3316
|
+
var cookiesStrings = [];
|
|
3317
|
+
var pos = 0;
|
|
3318
|
+
var start;
|
|
3319
|
+
var ch;
|
|
3320
|
+
var lastComma;
|
|
3321
|
+
var nextStart;
|
|
3322
|
+
var cookiesSeparatorFound;
|
|
3323
|
+
function skipWhitespace() {
|
|
3324
|
+
while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) {
|
|
3325
|
+
pos += 1;
|
|
3326
|
+
}
|
|
3327
|
+
return pos < cookiesString.length;
|
|
3328
|
+
}
|
|
3329
|
+
function notSpecialChar() {
|
|
3330
|
+
ch = cookiesString.charAt(pos);
|
|
3331
|
+
return ch !== "=" && ch !== ";" && ch !== ",";
|
|
3332
|
+
}
|
|
3333
|
+
while (pos < cookiesString.length) {
|
|
3334
|
+
start = pos;
|
|
3335
|
+
cookiesSeparatorFound = false;
|
|
3336
|
+
while (skipWhitespace()) {
|
|
6408
3337
|
ch = cookiesString.charAt(pos);
|
|
6409
|
-
|
|
6410
|
-
|
|
6411
|
-
|
|
6412
|
-
|
|
6413
|
-
|
|
6414
|
-
|
|
6415
|
-
ch = cookiesString.charAt(pos);
|
|
6416
|
-
if (ch === ",") {
|
|
6417
|
-
lastComma = pos;
|
|
3338
|
+
if (ch === ",") {
|
|
3339
|
+
lastComma = pos;
|
|
3340
|
+
pos += 1;
|
|
3341
|
+
skipWhitespace();
|
|
3342
|
+
nextStart = pos;
|
|
3343
|
+
while (pos < cookiesString.length && notSpecialChar()) {
|
|
6418
3344
|
pos += 1;
|
|
6419
|
-
|
|
6420
|
-
|
|
6421
|
-
|
|
6422
|
-
|
|
6423
|
-
|
|
6424
|
-
|
|
6425
|
-
cookiesSeparatorFound = true;
|
|
6426
|
-
pos = nextStart;
|
|
6427
|
-
cookiesStrings.push(cookiesString.substring(start, lastComma));
|
|
6428
|
-
start = pos;
|
|
6429
|
-
} else {
|
|
6430
|
-
pos = lastComma + 1;
|
|
6431
|
-
}
|
|
3345
|
+
}
|
|
3346
|
+
if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") {
|
|
3347
|
+
cookiesSeparatorFound = true;
|
|
3348
|
+
pos = nextStart;
|
|
3349
|
+
cookiesStrings.push(cookiesString.substring(start, lastComma));
|
|
3350
|
+
start = pos;
|
|
6432
3351
|
} else {
|
|
6433
|
-
pos
|
|
3352
|
+
pos = lastComma + 1;
|
|
6434
3353
|
}
|
|
3354
|
+
} else {
|
|
3355
|
+
pos += 1;
|
|
6435
3356
|
}
|
|
6436
|
-
if (!cookiesSeparatorFound || pos >= cookiesString.length) {
|
|
6437
|
-
cookiesStrings.push(cookiesString.substring(start, cookiesString.length));
|
|
6438
|
-
}
|
|
6439
3357
|
}
|
|
6440
|
-
|
|
3358
|
+
if (!cookiesSeparatorFound || pos >= cookiesString.length) {
|
|
3359
|
+
cookiesStrings.push(cookiesString.substring(start, cookiesString.length));
|
|
3360
|
+
}
|
|
6441
3361
|
}
|
|
6442
|
-
|
|
6443
|
-
setCookie.exports.parse = parse;
|
|
6444
|
-
setCookie.exports.parseString = parseString;
|
|
6445
|
-
setCookie.exports.splitCookiesString = splitCookiesString;
|
|
6446
|
-
return setCookie.exports;
|
|
3362
|
+
return cookiesStrings;
|
|
6447
3363
|
}
|
|
6448
|
-
|
|
3364
|
+
parseSetCookie.parseSetCookie = parseSetCookie;
|
|
3365
|
+
parseSetCookie.parse = parseSetCookie;
|
|
3366
|
+
parseSetCookie.parseString = parseString;
|
|
3367
|
+
parseSetCookie.splitCookiesString = splitCookiesString;
|
|
6449
3368
|
function create_fetch({ event, options: options2, manifest, state, get_cookie_header, set_internal }) {
|
|
6450
3369
|
const server_fetch = async (info, init2) => {
|
|
6451
3370
|
const original_request = normalize_fetch_input(info, init2, event.url);
|
|
@@ -6467,7 +3386,8 @@ function create_fetch({ event, options: options2, manifest, state, get_cookie_he
|
|
|
6467
3386
|
if ((request.method === "GET" || request.method === "HEAD") && (mode === "no-cors" && url.origin !== event.url.origin || url.origin === event.url.origin)) {
|
|
6468
3387
|
request.headers.delete("origin");
|
|
6469
3388
|
}
|
|
6470
|
-
|
|
3389
|
+
const decoded = decodeURIComponent(url.pathname);
|
|
3390
|
+
if (url.origin !== event.url.origin || base && decoded !== base && !decoded.startsWith(`${base}/`)) {
|
|
6471
3391
|
if (`.${url.hostname}`.endsWith(`.${event.url.hostname}`) && credentials !== "omit") {
|
|
6472
3392
|
const cookie2 = get_cookie_header(url, request.headers.get("cookie"));
|
|
6473
3393
|
if (cookie2) request.headers.set("cookie", cookie2);
|
|
@@ -6475,7 +3395,6 @@ function create_fetch({ event, options: options2, manifest, state, get_cookie_he
|
|
|
6475
3395
|
return fetch(request);
|
|
6476
3396
|
}
|
|
6477
3397
|
const prefix = assets || base;
|
|
6478
|
-
const decoded = decodeURIComponent(url.pathname);
|
|
6479
3398
|
const filename = (decoded.startsWith(prefix) ? decoded.slice(prefix.length) : decoded).slice(1);
|
|
6480
3399
|
const filename_html = `${filename}/index.html`;
|
|
6481
3400
|
const is_asset = manifest.assets.has(filename) || filename in manifest._.server_assets;
|
|
@@ -6525,8 +3444,8 @@ function create_fetch({ event, options: options2, manifest, state, get_cookie_he
|
|
|
6525
3444
|
const response = await internal_fetch(request, options2, manifest, state);
|
|
6526
3445
|
const set_cookie = response.headers.get("set-cookie");
|
|
6527
3446
|
if (set_cookie) {
|
|
6528
|
-
for (const str of
|
|
6529
|
-
const { name, value, ...options3 } =
|
|
3447
|
+
for (const str of splitCookiesString(set_cookie)) {
|
|
3448
|
+
const { name, value, ...options3 } = parseString(str, {
|
|
6530
3449
|
decodeValues: false
|
|
6531
3450
|
});
|
|
6532
3451
|
const path = options3.path ?? (url.pathname.split("/").slice(0, -1).join("/") || "/");
|
|
@@ -6776,16 +3695,11 @@ async function internal_respond(request, options2, manifest, state) {
|
|
|
6776
3695
|
}
|
|
6777
3696
|
if (!state.prerendering?.fallback) {
|
|
6778
3697
|
const matchers = await manifest._.matchers();
|
|
6779
|
-
|
|
6780
|
-
|
|
6781
|
-
|
|
6782
|
-
|
|
6783
|
-
|
|
6784
|
-
route = candidate;
|
|
6785
|
-
event.route = { id: route.id };
|
|
6786
|
-
event.params = decode_params(matched);
|
|
6787
|
-
break;
|
|
6788
|
-
}
|
|
3698
|
+
const result = find_route(resolved_path, manifest._.routes, matchers);
|
|
3699
|
+
if (result) {
|
|
3700
|
+
route = result.route;
|
|
3701
|
+
event.route = { id: route.id };
|
|
3702
|
+
event.params = result.params;
|
|
6789
3703
|
}
|
|
6790
3704
|
}
|
|
6791
3705
|
let resolve_opts = {
|
|
@@ -6863,6 +3777,7 @@ async function internal_respond(request, options2, manifest, state) {
|
|
|
6863
3777
|
current: root_span
|
|
6864
3778
|
}
|
|
6865
3779
|
};
|
|
3780
|
+
event_state.allows_commands = MUTATIVE_METHODS.includes(request.method);
|
|
6866
3781
|
return await with_request_store(
|
|
6867
3782
|
{ event: traced_event, state: event_state },
|
|
6868
3783
|
() => options2.hooks.handle({
|
|
@@ -7014,20 +3929,20 @@ async function internal_respond(request, options2, manifest, state) {
|
|
|
7014
3929
|
resolve_opts
|
|
7015
3930
|
);
|
|
7016
3931
|
} else {
|
|
7017
|
-
const
|
|
3932
|
+
const allowed_methods = new Set(allowed_page_methods);
|
|
7018
3933
|
const node = await manifest._.nodes[route.page.leaf]();
|
|
7019
3934
|
if (node?.server?.actions) {
|
|
7020
|
-
|
|
3935
|
+
allowed_methods.add("POST");
|
|
7021
3936
|
}
|
|
7022
3937
|
if (method === "OPTIONS") {
|
|
7023
3938
|
response2 = new Response(null, {
|
|
7024
3939
|
status: 204,
|
|
7025
3940
|
headers: {
|
|
7026
|
-
allow: Array.from(
|
|
3941
|
+
allow: Array.from(allowed_methods.values()).join(", ")
|
|
7027
3942
|
}
|
|
7028
3943
|
});
|
|
7029
3944
|
} else {
|
|
7030
|
-
const mod = [...
|
|
3945
|
+
const mod = [...allowed_methods].reduce(
|
|
7031
3946
|
(acc, curr) => {
|
|
7032
3947
|
acc[curr] = true;
|
|
7033
3948
|
return acc;
|