@gulbanana/jagman 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. package/LICENSE +663 -0
  2. package/README.md +40 -0
  3. package/bin/jagman.js +35 -0
  4. package/build/client/_app/immutable/assets/0.B3c8us65.css +1 -0
  5. package/build/client/_app/immutable/assets/0.B3c8us65.css.br +0 -0
  6. package/build/client/_app/immutable/assets/0.B3c8us65.css.gz +0 -0
  7. package/build/client/_app/immutable/assets/2.QhF3SmLf.css +1 -0
  8. package/build/client/_app/immutable/assets/2.QhF3SmLf.css.br +0 -0
  9. package/build/client/_app/immutable/assets/2.QhF3SmLf.css.gz +0 -0
  10. package/build/client/_app/immutable/assets/4.BoAskxZr.css +1 -0
  11. package/build/client/_app/immutable/assets/4.BoAskxZr.css.br +0 -0
  12. package/build/client/_app/immutable/assets/4.BoAskxZr.css.gz +0 -0
  13. package/build/client/_app/immutable/assets/5.DYpN9IwI.css +1 -0
  14. package/build/client/_app/immutable/assets/5.DYpN9IwI.css.br +0 -0
  15. package/build/client/_app/immutable/assets/5.DYpN9IwI.css.gz +0 -0
  16. package/build/client/_app/immutable/assets/7.BBPBRqyF.css +1 -0
  17. package/build/client/_app/immutable/assets/7.BBPBRqyF.css.br +0 -0
  18. package/build/client/_app/immutable/assets/7.BBPBRqyF.css.gz +0 -0
  19. package/build/client/_app/immutable/assets/8.WP6ZlE0M.css +1 -0
  20. package/build/client/_app/immutable/assets/8.WP6ZlE0M.css.br +0 -0
  21. package/build/client/_app/immutable/assets/8.WP6ZlE0M.css.gz +0 -0
  22. package/build/client/_app/immutable/assets/9.DH8YZ1_b.css +1 -0
  23. package/build/client/_app/immutable/assets/9.DH8YZ1_b.css.br +0 -0
  24. package/build/client/_app/immutable/assets/9.DH8YZ1_b.css.gz +0 -0
  25. package/build/client/_app/immutable/assets/ErrorSpan.BarpW_JY.css +1 -0
  26. package/build/client/_app/immutable/assets/ErrorSpan.BarpW_JY.css.br +0 -0
  27. package/build/client/_app/immutable/assets/ErrorSpan.BarpW_JY.css.gz +0 -0
  28. package/build/client/_app/immutable/assets/Icon.Di_GsCEs.css +1 -0
  29. package/build/client/_app/immutable/assets/Icon.Di_GsCEs.css.br +0 -0
  30. package/build/client/_app/immutable/assets/Icon.Di_GsCEs.css.gz +0 -0
  31. package/build/client/_app/immutable/assets/Pane.LvSW-vL-.css +1 -0
  32. package/build/client/_app/immutable/assets/Pane.LvSW-vL-.css.br +0 -0
  33. package/build/client/_app/immutable/assets/Pane.LvSW-vL-.css.gz +0 -0
  34. package/build/client/_app/immutable/assets/favicon.DGDeBov5.svg +191 -0
  35. package/build/client/_app/immutable/assets/favicon.DGDeBov5.svg.br +0 -0
  36. package/build/client/_app/immutable/assets/favicon.DGDeBov5.svg.gz +0 -0
  37. package/build/client/_app/immutable/assets/feather-sprite.BfIm3Xr9.svg +1 -0
  38. package/build/client/_app/immutable/assets/feather-sprite.BfIm3Xr9.svg.br +0 -0
  39. package/build/client/_app/immutable/assets/feather-sprite.BfIm3Xr9.svg.gz +0 -0
  40. package/build/client/_app/immutable/assets/gc-dark.DHisUerN.svg +101 -0
  41. package/build/client/_app/immutable/assets/gc-dark.DHisUerN.svg.br +0 -0
  42. package/build/client/_app/immutable/assets/gc-dark.DHisUerN.svg.gz +0 -0
  43. package/build/client/_app/immutable/assets/gc-light.C55NzigM.svg +100 -0
  44. package/build/client/_app/immutable/assets/gc-light.C55NzigM.svg.br +0 -0
  45. package/build/client/_app/immutable/assets/gc-light.C55NzigM.svg.gz +0 -0
  46. package/build/client/_app/immutable/chunks/B3ZkAhB4.js +1 -0
  47. package/build/client/_app/immutable/chunks/B3ZkAhB4.js.br +0 -0
  48. package/build/client/_app/immutable/chunks/B3ZkAhB4.js.gz +0 -0
  49. package/build/client/_app/immutable/chunks/B9tazVuH.js +2 -0
  50. package/build/client/_app/immutable/chunks/B9tazVuH.js.br +0 -0
  51. package/build/client/_app/immutable/chunks/B9tazVuH.js.gz +0 -0
  52. package/build/client/_app/immutable/chunks/BdkrN5mN.js +1 -0
  53. package/build/client/_app/immutable/chunks/BdkrN5mN.js.br +0 -0
  54. package/build/client/_app/immutable/chunks/BdkrN5mN.js.gz +0 -0
  55. package/build/client/_app/immutable/chunks/ByNAvWKi.js +1 -0
  56. package/build/client/_app/immutable/chunks/ByNAvWKi.js.br +0 -0
  57. package/build/client/_app/immutable/chunks/ByNAvWKi.js.gz +0 -0
  58. package/build/client/_app/immutable/chunks/C8oOvULD.js +1 -0
  59. package/build/client/_app/immutable/chunks/C8oOvULD.js.br +0 -0
  60. package/build/client/_app/immutable/chunks/C8oOvULD.js.gz +0 -0
  61. package/build/client/_app/immutable/chunks/CCH3sm1V.js +1 -0
  62. package/build/client/_app/immutable/chunks/CCH3sm1V.js.br +0 -0
  63. package/build/client/_app/immutable/chunks/CCH3sm1V.js.gz +0 -0
  64. package/build/client/_app/immutable/chunks/CDD8JGhu.js +1 -0
  65. package/build/client/_app/immutable/chunks/CDD8JGhu.js.br +0 -0
  66. package/build/client/_app/immutable/chunks/CDD8JGhu.js.gz +0 -0
  67. package/build/client/_app/immutable/chunks/CKIpFoVh.js +1 -0
  68. package/build/client/_app/immutable/chunks/CKIpFoVh.js.br +0 -0
  69. package/build/client/_app/immutable/chunks/CKIpFoVh.js.gz +0 -0
  70. package/build/client/_app/immutable/chunks/CMyhPqp1.js +1 -0
  71. package/build/client/_app/immutable/chunks/CMyhPqp1.js.br +0 -0
  72. package/build/client/_app/immutable/chunks/CMyhPqp1.js.gz +0 -0
  73. package/build/client/_app/immutable/chunks/COe4_SPO.js +1 -0
  74. package/build/client/_app/immutable/chunks/COe4_SPO.js.br +0 -0
  75. package/build/client/_app/immutable/chunks/COe4_SPO.js.gz +0 -0
  76. package/build/client/_app/immutable/chunks/CaZKc3PV.js +2 -0
  77. package/build/client/_app/immutable/chunks/CaZKc3PV.js.br +0 -0
  78. package/build/client/_app/immutable/chunks/CaZKc3PV.js.gz +0 -0
  79. package/build/client/_app/immutable/chunks/Cj8zunyE.js +1 -0
  80. package/build/client/_app/immutable/chunks/Cj8zunyE.js.br +2 -0
  81. package/build/client/_app/immutable/chunks/Cj8zunyE.js.gz +0 -0
  82. package/build/client/_app/immutable/chunks/CvfIoSRb.js +1 -0
  83. package/build/client/_app/immutable/chunks/CvfIoSRb.js.br +0 -0
  84. package/build/client/_app/immutable/chunks/CvfIoSRb.js.gz +0 -0
  85. package/build/client/_app/immutable/chunks/DhBP0au1.js +1 -0
  86. package/build/client/_app/immutable/chunks/DhBP0au1.js.br +0 -0
  87. package/build/client/_app/immutable/chunks/DhBP0au1.js.gz +0 -0
  88. package/build/client/_app/immutable/chunks/F2VqmO6x.js +1 -0
  89. package/build/client/_app/immutable/chunks/F2VqmO6x.js.br +0 -0
  90. package/build/client/_app/immutable/chunks/F2VqmO6x.js.gz +0 -0
  91. package/build/client/_app/immutable/chunks/hlNgmD7C.js +1 -0
  92. package/build/client/_app/immutable/chunks/hlNgmD7C.js.br +0 -0
  93. package/build/client/_app/immutable/chunks/hlNgmD7C.js.gz +0 -0
  94. package/build/client/_app/immutable/chunks/tW0gGpbB.js +2 -0
  95. package/build/client/_app/immutable/chunks/tW0gGpbB.js.br +0 -0
  96. package/build/client/_app/immutable/chunks/tW0gGpbB.js.gz +0 -0
  97. package/build/client/_app/immutable/entry/app.BJglbmCx.js +2 -0
  98. package/build/client/_app/immutable/entry/app.BJglbmCx.js.br +0 -0
  99. package/build/client/_app/immutable/entry/app.BJglbmCx.js.gz +0 -0
  100. package/build/client/_app/immutable/entry/start.f6OGjaz6.js +1 -0
  101. package/build/client/_app/immutable/entry/start.f6OGjaz6.js.br +2 -0
  102. package/build/client/_app/immutable/entry/start.f6OGjaz6.js.gz +0 -0
  103. package/build/client/_app/immutable/nodes/0.BcUb2smo.js +1 -0
  104. package/build/client/_app/immutable/nodes/0.BcUb2smo.js.br +0 -0
  105. package/build/client/_app/immutable/nodes/0.BcUb2smo.js.gz +0 -0
  106. package/build/client/_app/immutable/nodes/1.xem2AZVD.js +1 -0
  107. package/build/client/_app/immutable/nodes/1.xem2AZVD.js.br +0 -0
  108. package/build/client/_app/immutable/nodes/1.xem2AZVD.js.gz +0 -0
  109. package/build/client/_app/immutable/nodes/2.CDTJMs0M.js +1 -0
  110. package/build/client/_app/immutable/nodes/2.CDTJMs0M.js.br +1 -0
  111. package/build/client/_app/immutable/nodes/2.CDTJMs0M.js.gz +0 -0
  112. package/build/client/_app/immutable/nodes/3.Kr4ly1KY.js +1 -0
  113. package/build/client/_app/immutable/nodes/3.Kr4ly1KY.js.br +0 -0
  114. package/build/client/_app/immutable/nodes/3.Kr4ly1KY.js.gz +0 -0
  115. package/build/client/_app/immutable/nodes/4.CkrrNwwZ.js +1 -0
  116. package/build/client/_app/immutable/nodes/4.CkrrNwwZ.js.br +0 -0
  117. package/build/client/_app/immutable/nodes/4.CkrrNwwZ.js.gz +0 -0
  118. package/build/client/_app/immutable/nodes/5.Ck9pAYWh.js +3 -0
  119. package/build/client/_app/immutable/nodes/5.Ck9pAYWh.js.br +0 -0
  120. package/build/client/_app/immutable/nodes/5.Ck9pAYWh.js.gz +0 -0
  121. package/build/client/_app/immutable/nodes/6.BZru-VFo.js +1 -0
  122. package/build/client/_app/immutable/nodes/6.BZru-VFo.js.br +0 -0
  123. package/build/client/_app/immutable/nodes/6.BZru-VFo.js.gz +0 -0
  124. package/build/client/_app/immutable/nodes/7.DQKVlDfB.js +1 -0
  125. package/build/client/_app/immutable/nodes/7.DQKVlDfB.js.br +0 -0
  126. package/build/client/_app/immutable/nodes/7.DQKVlDfB.js.gz +0 -0
  127. package/build/client/_app/immutable/nodes/8.CRaTbcsI.js +1 -0
  128. package/build/client/_app/immutable/nodes/8.CRaTbcsI.js.br +0 -0
  129. package/build/client/_app/immutable/nodes/8.CRaTbcsI.js.gz +0 -0
  130. package/build/client/_app/immutable/nodes/9.ZY9fPTpH.js +1 -0
  131. package/build/client/_app/immutable/nodes/9.ZY9fPTpH.js.br +0 -0
  132. package/build/client/_app/immutable/nodes/9.ZY9fPTpH.js.gz +0 -0
  133. package/build/client/_app/version.json +1 -0
  134. package/build/client/_app/version.json.br +0 -0
  135. package/build/client/_app/version.json.gz +0 -0
  136. package/build/env.js +94 -0
  137. package/build/handler.js +1494 -0
  138. package/build/index.js +345 -0
  139. package/build/server/chunks/0-DFKHNL47.js +9 -0
  140. package/build/server/chunks/0-DFKHNL47.js.map +1 -0
  141. package/build/server/chunks/1-rBV5UzK8.js +9 -0
  142. package/build/server/chunks/1-rBV5UzK8.js.map +1 -0
  143. package/build/server/chunks/2-DNhpm2f0.js +9 -0
  144. package/build/server/chunks/2-DNhpm2f0.js.map +1 -0
  145. package/build/server/chunks/3-BriZP-4z.js +9 -0
  146. package/build/server/chunks/3-BriZP-4z.js.map +1 -0
  147. package/build/server/chunks/4-BRqbjiow.js +9 -0
  148. package/build/server/chunks/4-BRqbjiow.js.map +1 -0
  149. package/build/server/chunks/5-DxPUkn7K.js +9 -0
  150. package/build/server/chunks/5-DxPUkn7K.js.map +1 -0
  151. package/build/server/chunks/6-OQ8ks1e7.js +19 -0
  152. package/build/server/chunks/6-OQ8ks1e7.js.map +1 -0
  153. package/build/server/chunks/7-wbR5qPH1.js +9 -0
  154. package/build/server/chunks/7-wbR5qPH1.js.map +1 -0
  155. package/build/server/chunks/8-BL7_9qSi.js +9 -0
  156. package/build/server/chunks/8-BL7_9qSi.js.map +1 -0
  157. package/build/server/chunks/9-DC9G3Slz.js +9 -0
  158. package/build/server/chunks/9-DC9G3Slz.js.map +1 -0
  159. package/build/server/chunks/ErrorSpan-BSqKaGqG.js +9 -0
  160. package/build/server/chunks/ErrorSpan-BSqKaGqG.js.map +1 -0
  161. package/build/server/chunks/Icon-Dr5EwAkb.js +10 -0
  162. package/build/server/chunks/Icon-Dr5EwAkb.js.map +1 -0
  163. package/build/server/chunks/Pane-DcSwhEiL.js +41 -0
  164. package/build/server/chunks/Pane-DcSwhEiL.js.map +1 -0
  165. package/build/server/chunks/_error.svelte-Cw0MGN-r.js +18 -0
  166. package/build/server/chunks/_error.svelte-Cw0MGN-r.js.map +1 -0
  167. package/build/server/chunks/_layout.svelte-CFeu3znf.js +14 -0
  168. package/build/server/chunks/_layout.svelte-CFeu3znf.js.map +1 -0
  169. package/build/server/chunks/_layout.svelte-CQ3MtcgC.js +33 -0
  170. package/build/server/chunks/_layout.svelte-CQ3MtcgC.js.map +1 -0
  171. package/build/server/chunks/_layout.svelte-D_GQeKpE.js +9 -0
  172. package/build/server/chunks/_layout.svelte-D_GQeKpE.js.map +1 -0
  173. package/build/server/chunks/_page.svelte-C8O6i1zq.js +282 -0
  174. package/build/server/chunks/_page.svelte-C8O6i1zq.js.map +1 -0
  175. package/build/server/chunks/_page.svelte-CfJpXtNh.js +104 -0
  176. package/build/server/chunks/_page.svelte-CfJpXtNh.js.map +1 -0
  177. package/build/server/chunks/_page.svelte-CkpYjdBP.js +68 -0
  178. package/build/server/chunks/_page.svelte-CkpYjdBP.js.map +1 -0
  179. package/build/server/chunks/_page.svelte-DbAHpdpc.js +6 -0
  180. package/build/server/chunks/_page.svelte-DbAHpdpc.js.map +1 -0
  181. package/build/server/chunks/agent-C7A3zEr3.js +708 -0
  182. package/build/server/chunks/agent-C7A3zEr3.js.map +1 -0
  183. package/build/server/chunks/data.remote-3GWudL8p.js +28 -0
  184. package/build/server/chunks/data.remote-3GWudL8p.js.map +1 -0
  185. package/build/server/chunks/data.remote2-DPGOveFg.js +23 -0
  186. package/build/server/chunks/data.remote2-DPGOveFg.js.map +1 -0
  187. package/build/server/chunks/data.remote3-CDhxyD61.js +25 -0
  188. package/build/server/chunks/data.remote3-CDhxyD61.js.map +1 -0
  189. package/build/server/chunks/error.svelte-D0cH8izO.js +13 -0
  190. package/build/server/chunks/error.svelte-D0cH8izO.js.map +1 -0
  191. package/build/server/chunks/exports-DsGzTZ0S.js +121 -0
  192. package/build/server/chunks/exports-DsGzTZ0S.js.map +1 -0
  193. package/build/server/chunks/hooks.server-Cke-TrVc.js +14 -0
  194. package/build/server/chunks/hooks.server-Cke-TrVc.js.map +1 -0
  195. package/build/server/chunks/index-CoD1IJuy.js +190 -0
  196. package/build/server/chunks/index-CoD1IJuy.js.map +1 -0
  197. package/build/server/chunks/index-DwoWbz0A.js +1819 -0
  198. package/build/server/chunks/index-DwoWbz0A.js.map +1 -0
  199. package/build/server/chunks/index2-Ej5CkWKF.js +44 -0
  200. package/build/server/chunks/index2-Ej5CkWKF.js.map +1 -0
  201. package/build/server/chunks/mock-data-D8qN6SIX.js +18 -0
  202. package/build/server/chunks/mock-data-D8qN6SIX.js.map +1 -0
  203. package/build/server/chunks/opencode-vgZ5DMQ2.js +452 -0
  204. package/build/server/chunks/opencode-vgZ5DMQ2.js.map +1 -0
  205. package/build/server/chunks/remote-1jrju9-CYV2OBS9.js +16 -0
  206. package/build/server/chunks/remote-1jrju9-CYV2OBS9.js.map +1 -0
  207. package/build/server/chunks/remote-1t3e9fx-Bq2E-Huu.js +16 -0
  208. package/build/server/chunks/remote-1t3e9fx-Bq2E-Huu.js.map +1 -0
  209. package/build/server/chunks/remote-dsfuc2-DwI4AU9q.js +15 -0
  210. package/build/server/chunks/remote-dsfuc2-DwI4AU9q.js.map +1 -0
  211. package/build/server/chunks/root-C5lyo0VT.js +2906 -0
  212. package/build/server/chunks/root-C5lyo0VT.js.map +1 -0
  213. package/build/server/chunks/shared-bytReIJX.js +1236 -0
  214. package/build/server/chunks/shared-bytReIJX.js.map +1 -0
  215. package/build/server/index.js +4422 -0
  216. package/build/server/index.js.map +1 -0
  217. package/build/server/manifest.js +83 -0
  218. package/build/server/manifest.js.map +1 -0
  219. package/build/shims.js +32 -0
  220. package/package.json +70 -0
@@ -0,0 +1,2906 @@
1
+ import { r as render, L as LEGACY_PROPS, p as define_property, C as CONNECTED, R as REACTION_RAN, E as ERROR_VALUE, q as COMMENT_NODE, H as HYDRATION_START, t as HYDRATION_ERROR, S as STATE_SYMBOL, u as object_prototype, w as array_prototype, U as UNINITIALIZED, x as get_descriptor, y as DERIVED, z as DIRTY, M as MAYBE_DIRTY, A as is_extensible, B as get_prototype_of, F as is_array, G as CLEAN, I as INERT, J as EFFECT, K as BLOCK_EFFECT, N as deferred, W as WAS_MARKED, O as DESTROYED, P as MANAGED_EFFECT, Q as run_all, T as BRANCH_EFFECT, V as ROOT_EFFECT, X as RENDER_EFFECT, Y as HEAD_EFFECT, Z as ASYNC, _ as REACTION_IS_UPDATING, $ as EFFECT_PRESERVED, a0 as EFFECT_TRANSPARENT, a1 as BOUNDARY_EFFECT, a2 as includes, a3 as index_of, a4 as STALE_REACTION, n as noop, a5 as EAGER_EFFECT, a6 as array_from, a7 as is_passive_event, a8 as setContext, d as derived, a9 as HYDRATION_END, aa as HYDRATION_START_ELSE, ab as HYDRATION_START_FAILED, ac as USER_EFFECT } from './index-DwoWbz0A.js';
2
+
3
+ const DEV = false;
4
+
5
+ // eslint-disable-next-line n/prefer-global/process
6
+ const IN_WEBCONTAINER = !!globalThis.process?.versions?.webcontainer;
7
+
8
+ /** @import { RequestEvent } from '@sveltejs/kit' */
9
+ /** @import { RequestStore } from 'types' */
10
+ /** @import { AsyncLocalStorage } from 'node:async_hooks' */
11
+
12
+
13
+ /** @type {RequestStore | null} */
14
+ let sync_store = null;
15
+
16
+ /** @type {AsyncLocalStorage<RequestStore | null> | null} */
17
+ let als;
18
+
19
+ import('node:async_hooks')
20
+ .then((hooks) => (als = new hooks.AsyncLocalStorage()))
21
+ .catch(() => {
22
+ // can't use AsyncLocalStorage, but can still call getRequestEvent synchronously.
23
+ // this isn't behind `supports` because it's basically just StackBlitz (i.e.
24
+ // in-browser usage) that doesn't support it AFAICT
25
+ });
26
+
27
+ function get_request_store() {
28
+ const result = try_get_request_store();
29
+ if (!result) {
30
+ let message = 'Could not get the request store.';
31
+
32
+ if (als) {
33
+ message += ' This is an internal error.';
34
+ } else {
35
+ message +=
36
+ ' In environments without `AsyncLocalStorage`, the request store (used by e.g. remote functions) must be accessed synchronously, not after an `await`.' +
37
+ ' If it was accessed synchronously then this is an internal error.';
38
+ }
39
+
40
+ throw new Error(message);
41
+ }
42
+ return result;
43
+ }
44
+
45
+ function try_get_request_store() {
46
+ return sync_store ?? als?.getStore() ?? null;
47
+ }
48
+
49
+ /**
50
+ * @template T
51
+ * @param {RequestStore | null} store
52
+ * @param {() => T} fn
53
+ */
54
+ function with_request_store(store, fn) {
55
+ try {
56
+ sync_store = store;
57
+ return als ? als.run(store, fn) : fn();
58
+ } finally {
59
+ // Since AsyncLocalStorage is not working in webcontainers, we don't reset `sync_store`
60
+ // and handle only one request at a time in `src/runtime/server/index.js`.
61
+ if (!IN_WEBCONTAINER) {
62
+ sync_store = null;
63
+ }
64
+ }
65
+ }
66
+
67
+ const text_encoder = new TextEncoder();
68
+ const text_decoder = new TextDecoder();
69
+ function get_relative_path(from, to) {
70
+ const from_parts = from.split(/[/\\]/);
71
+ const to_parts = to.split(/[/\\]/);
72
+ from_parts.pop();
73
+ while (from_parts[0] === to_parts[0]) {
74
+ from_parts.shift();
75
+ to_parts.shift();
76
+ }
77
+ let i = from_parts.length;
78
+ while (i--) from_parts[i] = "..";
79
+ return from_parts.concat(to_parts).join("/");
80
+ }
81
+ function base64_encode(bytes) {
82
+ if (globalThis.Buffer) {
83
+ return globalThis.Buffer.from(bytes).toString("base64");
84
+ }
85
+ let binary = "";
86
+ for (let i = 0; i < bytes.length; i++) {
87
+ binary += String.fromCharCode(bytes[i]);
88
+ }
89
+ return btoa(binary);
90
+ }
91
+ function base64_decode(encoded) {
92
+ if (globalThis.Buffer) {
93
+ const buffer = globalThis.Buffer.from(encoded, "base64");
94
+ return new Uint8Array(buffer);
95
+ }
96
+ const binary = atob(encoded);
97
+ const bytes = new Uint8Array(binary.length);
98
+ for (let i = 0; i < binary.length; i++) {
99
+ bytes[i] = binary.charCodeAt(i);
100
+ }
101
+ return bytes;
102
+ }
103
+
104
+ const internal = new URL("sveltekit-internal://");
105
+ function resolve(base, path) {
106
+ if (path[0] === "/" && path[1] === "/") return path;
107
+ let url = new URL(base, internal);
108
+ url = new URL(path, url);
109
+ return url.protocol === internal.protocol ? url.pathname + url.search + url.hash : url.href;
110
+ }
111
+ function normalize_path(path, trailing_slash) {
112
+ if (path === "/" || trailing_slash === "ignore") return path;
113
+ if (trailing_slash === "never") {
114
+ return path.endsWith("/") ? path.slice(0, -1) : path;
115
+ } else if (trailing_slash === "always" && !path.endsWith("/")) {
116
+ return path + "/";
117
+ }
118
+ return path;
119
+ }
120
+ function decode_pathname(pathname) {
121
+ return pathname.split("%25").map(decodeURI).join("%25");
122
+ }
123
+ function decode_params(params) {
124
+ for (const key in params) {
125
+ params[key] = decodeURIComponent(params[key]);
126
+ }
127
+ return params;
128
+ }
129
+ function make_trackable(url, callback, search_params_callback, allow_hash = false) {
130
+ const tracked = new URL(url);
131
+ Object.defineProperty(tracked, "searchParams", {
132
+ value: new Proxy(tracked.searchParams, {
133
+ get(obj, key) {
134
+ if (key === "get" || key === "getAll" || key === "has") {
135
+ return (param, ...rest) => {
136
+ search_params_callback(param);
137
+ return obj[key](param, ...rest);
138
+ };
139
+ }
140
+ callback();
141
+ const value = Reflect.get(obj, key);
142
+ return typeof value === "function" ? value.bind(obj) : value;
143
+ }
144
+ }),
145
+ enumerable: true,
146
+ configurable: true
147
+ });
148
+ const tracked_url_properties = ["href", "pathname", "search", "toString", "toJSON"];
149
+ if (allow_hash) tracked_url_properties.push("hash");
150
+ for (const property of tracked_url_properties) {
151
+ Object.defineProperty(tracked, property, {
152
+ get() {
153
+ callback();
154
+ return url[property];
155
+ },
156
+ enumerable: true,
157
+ configurable: true
158
+ });
159
+ }
160
+ {
161
+ tracked[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")] = (depth, opts, inspect) => {
162
+ return inspect(url, opts);
163
+ };
164
+ tracked.searchParams[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")] = (depth, opts, inspect) => {
165
+ return inspect(url.searchParams, opts);
166
+ };
167
+ }
168
+ if (!allow_hash) {
169
+ disable_hash(tracked);
170
+ }
171
+ return tracked;
172
+ }
173
+ function disable_hash(url) {
174
+ allow_nodejs_console_log(url);
175
+ Object.defineProperty(url, "hash", {
176
+ get() {
177
+ throw new Error(
178
+ "Cannot access event.url.hash. Consider using `page.url.hash` inside a component instead"
179
+ );
180
+ }
181
+ });
182
+ }
183
+ function disable_search(url) {
184
+ allow_nodejs_console_log(url);
185
+ for (const property of ["search", "searchParams"]) {
186
+ Object.defineProperty(url, property, {
187
+ get() {
188
+ throw new Error(`Cannot access url.${property} on a page with prerendering enabled`);
189
+ }
190
+ });
191
+ }
192
+ }
193
+ function allow_nodejs_console_log(url) {
194
+ {
195
+ url[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")] = (depth, opts, inspect) => {
196
+ return inspect(new URL(url), opts);
197
+ };
198
+ }
199
+ }
200
+
201
+ function equals(value) {
202
+ return value === this.v;
203
+ }
204
+ function safe_not_equal(a, b) {
205
+ return a != a ? b == b : a !== b || a !== null && typeof a === "object" || typeof a === "function";
206
+ }
207
+ function safe_equals(value) {
208
+ return !safe_not_equal(value, this.v);
209
+ }
210
+ function effect_update_depth_exceeded() {
211
+ {
212
+ throw new Error(`https://svelte.dev/e/effect_update_depth_exceeded`);
213
+ }
214
+ }
215
+ function hydration_failed() {
216
+ {
217
+ throw new Error(`https://svelte.dev/e/hydration_failed`);
218
+ }
219
+ }
220
+ function state_descriptors_fixed() {
221
+ {
222
+ throw new Error(`https://svelte.dev/e/state_descriptors_fixed`);
223
+ }
224
+ }
225
+ function state_prototype_fixed() {
226
+ {
227
+ throw new Error(`https://svelte.dev/e/state_prototype_fixed`);
228
+ }
229
+ }
230
+ function state_unsafe_mutation() {
231
+ {
232
+ throw new Error(`https://svelte.dev/e/state_unsafe_mutation`);
233
+ }
234
+ }
235
+ function svelte_boundary_reset_onerror() {
236
+ {
237
+ throw new Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`);
238
+ }
239
+ }
240
+ function hydration_mismatch(location) {
241
+ {
242
+ console.warn(`https://svelte.dev/e/hydration_mismatch`);
243
+ }
244
+ }
245
+ function svelte_boundary_reset_noop() {
246
+ {
247
+ console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`);
248
+ }
249
+ }
250
+ let hydrating = false;
251
+ function set_hydrating(value) {
252
+ hydrating = value;
253
+ }
254
+ let hydrate_node;
255
+ function set_hydrate_node(node) {
256
+ if (node === null) {
257
+ hydration_mismatch();
258
+ throw HYDRATION_ERROR;
259
+ }
260
+ return hydrate_node = node;
261
+ }
262
+ function hydrate_next() {
263
+ return set_hydrate_node(/* @__PURE__ */ get_next_sibling(hydrate_node));
264
+ }
265
+ function next(count = 1) {
266
+ if (hydrating) {
267
+ var i = count;
268
+ var node = hydrate_node;
269
+ while (i--) {
270
+ node = /** @type {TemplateNode} */
271
+ /* @__PURE__ */ get_next_sibling(node);
272
+ }
273
+ hydrate_node = node;
274
+ }
275
+ }
276
+ function skip_nodes(remove = true) {
277
+ var depth = 0;
278
+ var node = hydrate_node;
279
+ while (true) {
280
+ if (node.nodeType === COMMENT_NODE) {
281
+ var data = (
282
+ /** @type {Comment} */
283
+ node.data
284
+ );
285
+ if (data === HYDRATION_END) {
286
+ if (depth === 0) return node;
287
+ depth -= 1;
288
+ } else if (data === HYDRATION_START || data === HYDRATION_START_ELSE || // "[1", "[2", etc. for if blocks
289
+ data[0] === "[" && !isNaN(Number(data.slice(1)))) {
290
+ depth += 1;
291
+ }
292
+ }
293
+ var next2 = (
294
+ /** @type {TemplateNode} */
295
+ /* @__PURE__ */ get_next_sibling(node)
296
+ );
297
+ if (remove) node.remove();
298
+ node = next2;
299
+ }
300
+ }
301
+ let tracing_mode_flag = false;
302
+ let component_context = null;
303
+ function set_component_context(context) {
304
+ component_context = context;
305
+ }
306
+ function push(props, runes = false, fn) {
307
+ component_context = {
308
+ p: component_context,
309
+ i: false,
310
+ c: null,
311
+ e: null,
312
+ s: props,
313
+ x: null,
314
+ l: null
315
+ };
316
+ }
317
+ function pop(component) {
318
+ var context = (
319
+ /** @type {ComponentContext} */
320
+ component_context
321
+ );
322
+ var effects = context.e;
323
+ if (effects !== null) {
324
+ context.e = null;
325
+ for (var fn of effects) {
326
+ create_user_effect(fn);
327
+ }
328
+ }
329
+ context.i = true;
330
+ component_context = context.p;
331
+ return (
332
+ /** @type {T} */
333
+ {}
334
+ );
335
+ }
336
+ function is_runes() {
337
+ return true;
338
+ }
339
+ let micro_tasks = [];
340
+ function run_micro_tasks() {
341
+ var tasks = micro_tasks;
342
+ micro_tasks = [];
343
+ run_all(tasks);
344
+ }
345
+ function queue_micro_task(fn) {
346
+ if (micro_tasks.length === 0 && !is_flushing_sync) {
347
+ var tasks = micro_tasks;
348
+ queueMicrotask(() => {
349
+ if (tasks === micro_tasks) run_micro_tasks();
350
+ });
351
+ }
352
+ micro_tasks.push(fn);
353
+ }
354
+ function flush_tasks() {
355
+ while (micro_tasks.length > 0) {
356
+ run_micro_tasks();
357
+ }
358
+ }
359
+ function handle_error(error) {
360
+ var effect = active_effect;
361
+ if (effect === null) {
362
+ active_reaction.f |= ERROR_VALUE;
363
+ return error;
364
+ }
365
+ if ((effect.f & REACTION_RAN) === 0 && (effect.f & EFFECT) === 0) {
366
+ throw error;
367
+ }
368
+ invoke_error_boundary(error, effect);
369
+ }
370
+ function invoke_error_boundary(error, effect) {
371
+ while (effect !== null) {
372
+ if ((effect.f & BOUNDARY_EFFECT) !== 0) {
373
+ if ((effect.f & REACTION_RAN) === 0) {
374
+ throw error;
375
+ }
376
+ try {
377
+ effect.b.error(error);
378
+ return;
379
+ } catch (e) {
380
+ error = e;
381
+ }
382
+ }
383
+ effect = effect.parent;
384
+ }
385
+ throw error;
386
+ }
387
+ const STATUS_MASK = -7169;
388
+ function set_signal_status(signal, status) {
389
+ signal.f = signal.f & STATUS_MASK | status;
390
+ }
391
+ function update_derived_status(derived2) {
392
+ if ((derived2.f & CONNECTED) !== 0 || derived2.deps === null) {
393
+ set_signal_status(derived2, CLEAN);
394
+ } else {
395
+ set_signal_status(derived2, MAYBE_DIRTY);
396
+ }
397
+ }
398
+ function clear_marked(deps) {
399
+ if (deps === null) return;
400
+ for (const dep of deps) {
401
+ if ((dep.f & DERIVED) === 0 || (dep.f & WAS_MARKED) === 0) {
402
+ continue;
403
+ }
404
+ dep.f ^= WAS_MARKED;
405
+ clear_marked(
406
+ /** @type {Derived} */
407
+ dep.deps
408
+ );
409
+ }
410
+ }
411
+ function defer_effect(effect, dirty_effects, maybe_dirty_effects) {
412
+ if ((effect.f & DIRTY) !== 0) {
413
+ dirty_effects.add(effect);
414
+ } else if ((effect.f & MAYBE_DIRTY) !== 0) {
415
+ maybe_dirty_effects.add(effect);
416
+ }
417
+ clear_marked(effect.deps);
418
+ set_signal_status(effect, CLEAN);
419
+ }
420
+ const batches = /* @__PURE__ */ new Set();
421
+ let current_batch = null;
422
+ let batch_values = null;
423
+ let queued_root_effects = [];
424
+ let last_scheduled_effect = null;
425
+ let is_flushing = false;
426
+ let is_flushing_sync = false;
427
+ class Batch {
428
+ /**
429
+ * The current values of any sources that are updated in this batch
430
+ * They keys of this map are identical to `this.#previous`
431
+ * @type {Map<Source, any>}
432
+ */
433
+ current = /* @__PURE__ */ new Map();
434
+ /**
435
+ * The values of any sources that are updated in this batch _before_ those updates took place.
436
+ * They keys of this map are identical to `this.#current`
437
+ * @type {Map<Source, any>}
438
+ */
439
+ previous = /* @__PURE__ */ new Map();
440
+ /**
441
+ * When the batch is committed (and the DOM is updated), we need to remove old branches
442
+ * and append new ones by calling the functions added inside (if/each/key/etc) blocks
443
+ * @type {Set<() => void>}
444
+ */
445
+ #commit_callbacks = /* @__PURE__ */ new Set();
446
+ /**
447
+ * If a fork is discarded, we need to destroy any effects that are no longer needed
448
+ * @type {Set<(batch: Batch) => void>}
449
+ */
450
+ #discard_callbacks = /* @__PURE__ */ new Set();
451
+ /**
452
+ * The number of async effects that are currently in flight
453
+ */
454
+ #pending = 0;
455
+ /**
456
+ * The number of async effects that are currently in flight, _not_ inside a pending boundary
457
+ */
458
+ #blocking_pending = 0;
459
+ /**
460
+ * A deferred that resolves when the batch is committed, used with `settled()`
461
+ * TODO replace with Promise.withResolvers once supported widely enough
462
+ * @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
463
+ */
464
+ #deferred = null;
465
+ /**
466
+ * Deferred effects (which run after async work has completed) that are DIRTY
467
+ * @type {Set<Effect>}
468
+ */
469
+ #dirty_effects = /* @__PURE__ */ new Set();
470
+ /**
471
+ * Deferred effects that are MAYBE_DIRTY
472
+ * @type {Set<Effect>}
473
+ */
474
+ #maybe_dirty_effects = /* @__PURE__ */ new Set();
475
+ /**
476
+ * A map of branches that still exist, but will be destroyed when this batch
477
+ * is committed — we skip over these during `process`.
478
+ * The value contains child effects that were dirty/maybe_dirty before being reset,
479
+ * so they can be rescheduled if the branch survives.
480
+ * @type {Map<Effect, { d: Effect[], m: Effect[] }>}
481
+ */
482
+ #skipped_branches = /* @__PURE__ */ new Map();
483
+ is_fork = false;
484
+ #decrement_queued = false;
485
+ #is_deferred() {
486
+ return this.is_fork || this.#blocking_pending > 0;
487
+ }
488
+ /**
489
+ * Add an effect to the #skipped_branches map and reset its children
490
+ * @param {Effect} effect
491
+ */
492
+ skip_effect(effect) {
493
+ if (!this.#skipped_branches.has(effect)) {
494
+ this.#skipped_branches.set(effect, { d: [], m: [] });
495
+ }
496
+ }
497
+ /**
498
+ * Remove an effect from the #skipped_branches map and reschedule
499
+ * any tracked dirty/maybe_dirty child effects
500
+ * @param {Effect} effect
501
+ */
502
+ unskip_effect(effect) {
503
+ var tracked = this.#skipped_branches.get(effect);
504
+ if (tracked) {
505
+ this.#skipped_branches.delete(effect);
506
+ for (var e of tracked.d) {
507
+ set_signal_status(e, DIRTY);
508
+ schedule_effect(e);
509
+ }
510
+ for (e of tracked.m) {
511
+ set_signal_status(e, MAYBE_DIRTY);
512
+ schedule_effect(e);
513
+ }
514
+ }
515
+ }
516
+ /**
517
+ *
518
+ * @param {Effect[]} root_effects
519
+ */
520
+ process(root_effects) {
521
+ queued_root_effects = [];
522
+ this.apply();
523
+ var effects = [];
524
+ var render_effects = [];
525
+ for (const root2 of root_effects) {
526
+ this.#traverse_effect_tree(root2, effects, render_effects);
527
+ }
528
+ if (this.#is_deferred()) {
529
+ this.#defer_effects(render_effects);
530
+ this.#defer_effects(effects);
531
+ for (const [e, t] of this.#skipped_branches) {
532
+ reset_branch(e, t);
533
+ }
534
+ } else {
535
+ for (const fn of this.#commit_callbacks) fn();
536
+ this.#commit_callbacks.clear();
537
+ if (this.#pending === 0) {
538
+ this.#commit();
539
+ }
540
+ current_batch = null;
541
+ flush_queued_effects(render_effects);
542
+ flush_queued_effects(effects);
543
+ this.#deferred?.resolve();
544
+ }
545
+ batch_values = null;
546
+ }
547
+ /**
548
+ * Traverse the effect tree, executing effects or stashing
549
+ * them for later execution as appropriate
550
+ * @param {Effect} root
551
+ * @param {Effect[]} effects
552
+ * @param {Effect[]} render_effects
553
+ */
554
+ #traverse_effect_tree(root2, effects, render_effects) {
555
+ root2.f ^= CLEAN;
556
+ var effect = root2.first;
557
+ while (effect !== null) {
558
+ var flags2 = effect.f;
559
+ var is_branch = (flags2 & (BRANCH_EFFECT | ROOT_EFFECT)) !== 0;
560
+ var is_skippable_branch = is_branch && (flags2 & CLEAN) !== 0;
561
+ var skip = is_skippable_branch || (flags2 & INERT) !== 0 || this.#skipped_branches.has(effect);
562
+ if (!skip && effect.fn !== null) {
563
+ if (is_branch) {
564
+ effect.f ^= CLEAN;
565
+ } else if ((flags2 & EFFECT) !== 0) {
566
+ effects.push(effect);
567
+ } else if (is_dirty(effect)) {
568
+ if ((flags2 & BLOCK_EFFECT) !== 0) this.#maybe_dirty_effects.add(effect);
569
+ update_effect(effect);
570
+ }
571
+ var child = effect.first;
572
+ if (child !== null) {
573
+ effect = child;
574
+ continue;
575
+ }
576
+ }
577
+ while (effect !== null) {
578
+ var next2 = effect.next;
579
+ if (next2 !== null) {
580
+ effect = next2;
581
+ break;
582
+ }
583
+ effect = effect.parent;
584
+ }
585
+ }
586
+ }
587
+ /**
588
+ * @param {Effect[]} effects
589
+ */
590
+ #defer_effects(effects) {
591
+ for (var i = 0; i < effects.length; i += 1) {
592
+ defer_effect(effects[i], this.#dirty_effects, this.#maybe_dirty_effects);
593
+ }
594
+ }
595
+ /**
596
+ * Associate a change to a given source with the current
597
+ * batch, noting its previous and current values
598
+ * @param {Source} source
599
+ * @param {any} value
600
+ */
601
+ capture(source2, value) {
602
+ if (value !== UNINITIALIZED && !this.previous.has(source2)) {
603
+ this.previous.set(source2, value);
604
+ }
605
+ if ((source2.f & ERROR_VALUE) === 0) {
606
+ this.current.set(source2, source2.v);
607
+ batch_values?.set(source2, source2.v);
608
+ }
609
+ }
610
+ activate() {
611
+ current_batch = this;
612
+ this.apply();
613
+ }
614
+ deactivate() {
615
+ if (current_batch !== this) return;
616
+ current_batch = null;
617
+ batch_values = null;
618
+ }
619
+ flush() {
620
+ this.activate();
621
+ if (queued_root_effects.length > 0) {
622
+ flush_effects();
623
+ if (current_batch !== null && current_batch !== this) {
624
+ return;
625
+ }
626
+ } else if (this.#pending === 0) {
627
+ this.process([]);
628
+ }
629
+ this.deactivate();
630
+ }
631
+ discard() {
632
+ for (const fn of this.#discard_callbacks) fn(this);
633
+ this.#discard_callbacks.clear();
634
+ }
635
+ #commit() {
636
+ if (batches.size > 1) {
637
+ this.previous.clear();
638
+ var previous_batch_values = batch_values;
639
+ var is_earlier = true;
640
+ for (const batch of batches) {
641
+ if (batch === this) {
642
+ is_earlier = false;
643
+ continue;
644
+ }
645
+ const sources = [];
646
+ for (const [source2, value] of this.current) {
647
+ if (batch.current.has(source2)) {
648
+ if (is_earlier && value !== batch.current.get(source2)) {
649
+ batch.current.set(source2, value);
650
+ } else {
651
+ continue;
652
+ }
653
+ }
654
+ sources.push(source2);
655
+ }
656
+ if (sources.length === 0) {
657
+ continue;
658
+ }
659
+ const others = [...batch.current.keys()].filter((s) => !this.current.has(s));
660
+ if (others.length > 0) {
661
+ var prev_queued_root_effects = queued_root_effects;
662
+ queued_root_effects = [];
663
+ const marked = /* @__PURE__ */ new Set();
664
+ const checked = /* @__PURE__ */ new Map();
665
+ for (const source2 of sources) {
666
+ mark_effects(source2, others, marked, checked);
667
+ }
668
+ if (queued_root_effects.length > 0) {
669
+ current_batch = batch;
670
+ batch.apply();
671
+ for (const root2 of queued_root_effects) {
672
+ batch.#traverse_effect_tree(root2, [], []);
673
+ }
674
+ batch.deactivate();
675
+ }
676
+ queued_root_effects = prev_queued_root_effects;
677
+ }
678
+ }
679
+ current_batch = null;
680
+ batch_values = previous_batch_values;
681
+ }
682
+ batches.delete(this);
683
+ }
684
+ /**
685
+ *
686
+ * @param {boolean} blocking
687
+ */
688
+ increment(blocking) {
689
+ this.#pending += 1;
690
+ if (blocking) this.#blocking_pending += 1;
691
+ }
692
+ /**
693
+ *
694
+ * @param {boolean} blocking
695
+ */
696
+ decrement(blocking) {
697
+ this.#pending -= 1;
698
+ if (blocking) this.#blocking_pending -= 1;
699
+ if (this.#decrement_queued) return;
700
+ this.#decrement_queued = true;
701
+ queue_micro_task(() => {
702
+ this.#decrement_queued = false;
703
+ if (!this.#is_deferred()) {
704
+ this.revive();
705
+ } else if (queued_root_effects.length > 0) {
706
+ this.flush();
707
+ }
708
+ });
709
+ }
710
+ revive() {
711
+ for (const e of this.#dirty_effects) {
712
+ this.#maybe_dirty_effects.delete(e);
713
+ set_signal_status(e, DIRTY);
714
+ schedule_effect(e);
715
+ }
716
+ for (const e of this.#maybe_dirty_effects) {
717
+ set_signal_status(e, MAYBE_DIRTY);
718
+ schedule_effect(e);
719
+ }
720
+ this.flush();
721
+ }
722
+ /** @param {() => void} fn */
723
+ oncommit(fn) {
724
+ this.#commit_callbacks.add(fn);
725
+ }
726
+ /** @param {(batch: Batch) => void} fn */
727
+ ondiscard(fn) {
728
+ this.#discard_callbacks.add(fn);
729
+ }
730
+ settled() {
731
+ return (this.#deferred ??= deferred()).promise;
732
+ }
733
+ static ensure() {
734
+ if (current_batch === null) {
735
+ const batch = current_batch = new Batch();
736
+ batches.add(current_batch);
737
+ if (!is_flushing_sync) {
738
+ queue_micro_task(() => {
739
+ if (current_batch !== batch) {
740
+ return;
741
+ }
742
+ batch.flush();
743
+ });
744
+ }
745
+ }
746
+ return current_batch;
747
+ }
748
+ apply() {
749
+ return;
750
+ }
751
+ }
752
+ function flushSync(fn) {
753
+ var was_flushing_sync = is_flushing_sync;
754
+ is_flushing_sync = true;
755
+ try {
756
+ var result;
757
+ if (fn) ;
758
+ while (true) {
759
+ flush_tasks();
760
+ if (queued_root_effects.length === 0) {
761
+ current_batch?.flush();
762
+ if (queued_root_effects.length === 0) {
763
+ last_scheduled_effect = null;
764
+ return (
765
+ /** @type {T} */
766
+ result
767
+ );
768
+ }
769
+ }
770
+ flush_effects();
771
+ }
772
+ } finally {
773
+ is_flushing_sync = was_flushing_sync;
774
+ }
775
+ }
776
+ function flush_effects() {
777
+ is_flushing = true;
778
+ try {
779
+ var flush_count = 0;
780
+ while (queued_root_effects.length > 0) {
781
+ var batch = Batch.ensure();
782
+ if (flush_count++ > 1e3) {
783
+ var updates, entry;
784
+ if (DEV) ;
785
+ infinite_loop_guard();
786
+ }
787
+ batch.process(queued_root_effects);
788
+ old_values.clear();
789
+ if (DEV) ;
790
+ }
791
+ } finally {
792
+ queued_root_effects = [];
793
+ is_flushing = false;
794
+ last_scheduled_effect = null;
795
+ }
796
+ }
797
+ function infinite_loop_guard() {
798
+ try {
799
+ effect_update_depth_exceeded();
800
+ } catch (error) {
801
+ invoke_error_boundary(error, last_scheduled_effect);
802
+ }
803
+ }
804
+ let eager_block_effects = null;
805
+ function flush_queued_effects(effects) {
806
+ var length = effects.length;
807
+ if (length === 0) return;
808
+ var i = 0;
809
+ while (i < length) {
810
+ var effect = effects[i++];
811
+ if ((effect.f & (DESTROYED | INERT)) === 0 && is_dirty(effect)) {
812
+ eager_block_effects = /* @__PURE__ */ new Set();
813
+ update_effect(effect);
814
+ if (effect.deps === null && effect.first === null && effect.nodes === null && effect.teardown === null && effect.ac === null) {
815
+ unlink_effect(effect);
816
+ }
817
+ if (eager_block_effects?.size > 0) {
818
+ old_values.clear();
819
+ for (const e of eager_block_effects) {
820
+ if ((e.f & (DESTROYED | INERT)) !== 0) continue;
821
+ const ordered_effects = [e];
822
+ let ancestor = e.parent;
823
+ while (ancestor !== null) {
824
+ if (eager_block_effects.has(ancestor)) {
825
+ eager_block_effects.delete(ancestor);
826
+ ordered_effects.push(ancestor);
827
+ }
828
+ ancestor = ancestor.parent;
829
+ }
830
+ for (let j = ordered_effects.length - 1; j >= 0; j--) {
831
+ const e2 = ordered_effects[j];
832
+ if ((e2.f & (DESTROYED | INERT)) !== 0) continue;
833
+ update_effect(e2);
834
+ }
835
+ }
836
+ eager_block_effects.clear();
837
+ }
838
+ }
839
+ }
840
+ eager_block_effects = null;
841
+ }
842
+ function mark_effects(value, sources, marked, checked) {
843
+ if (marked.has(value)) return;
844
+ marked.add(value);
845
+ if (value.reactions !== null) {
846
+ for (const reaction of value.reactions) {
847
+ const flags2 = reaction.f;
848
+ if ((flags2 & DERIVED) !== 0) {
849
+ mark_effects(
850
+ /** @type {Derived} */
851
+ reaction,
852
+ sources,
853
+ marked,
854
+ checked
855
+ );
856
+ } else if ((flags2 & (ASYNC | BLOCK_EFFECT)) !== 0 && (flags2 & DIRTY) === 0 && depends_on(reaction, sources, checked)) {
857
+ set_signal_status(reaction, DIRTY);
858
+ schedule_effect(
859
+ /** @type {Effect} */
860
+ reaction
861
+ );
862
+ }
863
+ }
864
+ }
865
+ }
866
+ function depends_on(reaction, sources, checked) {
867
+ const depends = checked.get(reaction);
868
+ if (depends !== void 0) return depends;
869
+ if (reaction.deps !== null) {
870
+ for (const dep of reaction.deps) {
871
+ if (includes.call(sources, dep)) {
872
+ return true;
873
+ }
874
+ if ((dep.f & DERIVED) !== 0 && depends_on(
875
+ /** @type {Derived} */
876
+ dep,
877
+ sources,
878
+ checked
879
+ )) {
880
+ checked.set(
881
+ /** @type {Derived} */
882
+ dep,
883
+ true
884
+ );
885
+ return true;
886
+ }
887
+ }
888
+ }
889
+ checked.set(reaction, false);
890
+ return false;
891
+ }
892
+ function schedule_effect(signal) {
893
+ var effect = last_scheduled_effect = signal;
894
+ var boundary2 = effect.b;
895
+ if (boundary2?.is_pending && (signal.f & (EFFECT | RENDER_EFFECT | MANAGED_EFFECT)) !== 0 && (signal.f & REACTION_RAN) === 0) {
896
+ boundary2.defer_effect(signal);
897
+ return;
898
+ }
899
+ while (effect.parent !== null) {
900
+ effect = effect.parent;
901
+ var flags2 = effect.f;
902
+ if (is_flushing && effect === active_effect && (flags2 & BLOCK_EFFECT) !== 0 && (flags2 & HEAD_EFFECT) === 0 && (flags2 & REACTION_RAN) !== 0) {
903
+ return;
904
+ }
905
+ if ((flags2 & (ROOT_EFFECT | BRANCH_EFFECT)) !== 0) {
906
+ if ((flags2 & CLEAN) === 0) {
907
+ return;
908
+ }
909
+ effect.f ^= CLEAN;
910
+ }
911
+ }
912
+ queued_root_effects.push(effect);
913
+ }
914
+ function reset_branch(effect, tracked) {
915
+ if ((effect.f & BRANCH_EFFECT) !== 0 && (effect.f & CLEAN) !== 0) {
916
+ return;
917
+ }
918
+ if ((effect.f & DIRTY) !== 0) {
919
+ tracked.d.push(effect);
920
+ } else if ((effect.f & MAYBE_DIRTY) !== 0) {
921
+ tracked.m.push(effect);
922
+ }
923
+ set_signal_status(effect, CLEAN);
924
+ var e = effect.first;
925
+ while (e !== null) {
926
+ reset_branch(e, tracked);
927
+ e = e.next;
928
+ }
929
+ }
930
+ function createSubscriber(start) {
931
+ let subscribers = 0;
932
+ let version = source(0);
933
+ let stop;
934
+ return () => {
935
+ if (effect_tracking()) {
936
+ get(version);
937
+ render_effect(() => {
938
+ if (subscribers === 0) {
939
+ stop = untrack(() => start(() => increment(version)));
940
+ }
941
+ subscribers += 1;
942
+ return () => {
943
+ queue_micro_task(() => {
944
+ subscribers -= 1;
945
+ if (subscribers === 0) {
946
+ stop?.();
947
+ stop = void 0;
948
+ increment(version);
949
+ }
950
+ });
951
+ };
952
+ });
953
+ }
954
+ };
955
+ }
956
+ var flags = EFFECT_TRANSPARENT | EFFECT_PRESERVED;
957
+ function boundary(node, props, children, transform_error) {
958
+ new Boundary(node, props, children, transform_error);
959
+ }
960
+ class Boundary {
961
+ /** @type {Boundary | null} */
962
+ parent;
963
+ is_pending = false;
964
+ /**
965
+ * API-level transformError transform function. Transforms errors before they reach the `failed` snippet.
966
+ * Inherited from parent boundary, or defaults to identity.
967
+ * @type {(error: unknown) => unknown}
968
+ */
969
+ transform_error;
970
+ /** @type {TemplateNode} */
971
+ #anchor;
972
+ /** @type {TemplateNode | null} */
973
+ #hydrate_open = hydrating ? hydrate_node : null;
974
+ /** @type {BoundaryProps} */
975
+ #props;
976
+ /** @type {((anchor: Node) => void)} */
977
+ #children;
978
+ /** @type {Effect} */
979
+ #effect;
980
+ /** @type {Effect | null} */
981
+ #main_effect = null;
982
+ /** @type {Effect | null} */
983
+ #pending_effect = null;
984
+ /** @type {Effect | null} */
985
+ #failed_effect = null;
986
+ /** @type {DocumentFragment | null} */
987
+ #offscreen_fragment = null;
988
+ #local_pending_count = 0;
989
+ #pending_count = 0;
990
+ #pending_count_update_queued = false;
991
+ /** @type {Set<Effect>} */
992
+ #dirty_effects = /* @__PURE__ */ new Set();
993
+ /** @type {Set<Effect>} */
994
+ #maybe_dirty_effects = /* @__PURE__ */ new Set();
995
+ /**
996
+ * A source containing the number of pending async deriveds/expressions.
997
+ * Only created if `$effect.pending()` is used inside the boundary,
998
+ * otherwise updating the source results in needless `Batch.ensure()`
999
+ * calls followed by no-op flushes
1000
+ * @type {Source<number> | null}
1001
+ */
1002
+ #effect_pending = null;
1003
+ #effect_pending_subscriber = createSubscriber(() => {
1004
+ this.#effect_pending = source(this.#local_pending_count);
1005
+ return () => {
1006
+ this.#effect_pending = null;
1007
+ };
1008
+ });
1009
+ /**
1010
+ * @param {TemplateNode} node
1011
+ * @param {BoundaryProps} props
1012
+ * @param {((anchor: Node) => void)} children
1013
+ * @param {((error: unknown) => unknown) | undefined} [transform_error]
1014
+ */
1015
+ constructor(node, props, children, transform_error) {
1016
+ this.#anchor = node;
1017
+ this.#props = props;
1018
+ this.#children = (anchor) => {
1019
+ var effect = (
1020
+ /** @type {Effect} */
1021
+ active_effect
1022
+ );
1023
+ effect.b = this;
1024
+ effect.f |= BOUNDARY_EFFECT;
1025
+ children(anchor);
1026
+ };
1027
+ this.parent = /** @type {Effect} */
1028
+ active_effect.b;
1029
+ this.transform_error = transform_error ?? this.parent?.transform_error ?? ((e) => e);
1030
+ this.#effect = block(() => {
1031
+ if (hydrating) {
1032
+ const comment = (
1033
+ /** @type {Comment} */
1034
+ this.#hydrate_open
1035
+ );
1036
+ hydrate_next();
1037
+ const server_rendered_pending = comment.data === HYDRATION_START_ELSE;
1038
+ const server_rendered_failed = comment.data.startsWith(HYDRATION_START_FAILED);
1039
+ if (server_rendered_failed) {
1040
+ const serialized_error = JSON.parse(comment.data.slice(HYDRATION_START_FAILED.length));
1041
+ this.#hydrate_failed_content(serialized_error);
1042
+ } else if (server_rendered_pending) {
1043
+ this.#hydrate_pending_content();
1044
+ } else {
1045
+ this.#hydrate_resolved_content();
1046
+ }
1047
+ } else {
1048
+ this.#render();
1049
+ }
1050
+ }, flags);
1051
+ if (hydrating) {
1052
+ this.#anchor = hydrate_node;
1053
+ }
1054
+ }
1055
+ #hydrate_resolved_content() {
1056
+ try {
1057
+ this.#main_effect = branch(() => this.#children(this.#anchor));
1058
+ } catch (error) {
1059
+ this.error(error);
1060
+ }
1061
+ }
1062
+ /**
1063
+ * @param {unknown} error The deserialized error from the server's hydration comment
1064
+ */
1065
+ #hydrate_failed_content(error) {
1066
+ const failed = this.#props.failed;
1067
+ if (!failed) return;
1068
+ this.#failed_effect = branch(() => {
1069
+ failed(
1070
+ this.#anchor,
1071
+ () => error,
1072
+ () => () => {
1073
+ }
1074
+ );
1075
+ });
1076
+ }
1077
+ #hydrate_pending_content() {
1078
+ const pending = this.#props.pending;
1079
+ if (!pending) return;
1080
+ this.is_pending = true;
1081
+ this.#pending_effect = branch(() => pending(this.#anchor));
1082
+ queue_micro_task(() => {
1083
+ var fragment = this.#offscreen_fragment = document.createDocumentFragment();
1084
+ var anchor = create_text();
1085
+ fragment.append(anchor);
1086
+ this.#main_effect = this.#run(() => {
1087
+ Batch.ensure();
1088
+ return branch(() => this.#children(anchor));
1089
+ });
1090
+ if (this.#pending_count === 0) {
1091
+ this.#anchor.before(fragment);
1092
+ this.#offscreen_fragment = null;
1093
+ pause_effect(
1094
+ /** @type {Effect} */
1095
+ this.#pending_effect,
1096
+ () => {
1097
+ this.#pending_effect = null;
1098
+ }
1099
+ );
1100
+ this.#resolve();
1101
+ }
1102
+ });
1103
+ }
1104
+ #render() {
1105
+ try {
1106
+ this.is_pending = this.has_pending_snippet();
1107
+ this.#pending_count = 0;
1108
+ this.#local_pending_count = 0;
1109
+ this.#main_effect = branch(() => {
1110
+ this.#children(this.#anchor);
1111
+ });
1112
+ if (this.#pending_count > 0) {
1113
+ var fragment = this.#offscreen_fragment = document.createDocumentFragment();
1114
+ move_effect(this.#main_effect, fragment);
1115
+ const pending = (
1116
+ /** @type {(anchor: Node) => void} */
1117
+ this.#props.pending
1118
+ );
1119
+ this.#pending_effect = branch(() => pending(this.#anchor));
1120
+ } else {
1121
+ this.#resolve();
1122
+ }
1123
+ } catch (error) {
1124
+ this.error(error);
1125
+ }
1126
+ }
1127
+ #resolve() {
1128
+ this.is_pending = false;
1129
+ for (const e of this.#dirty_effects) {
1130
+ set_signal_status(e, DIRTY);
1131
+ schedule_effect(e);
1132
+ }
1133
+ for (const e of this.#maybe_dirty_effects) {
1134
+ set_signal_status(e, MAYBE_DIRTY);
1135
+ schedule_effect(e);
1136
+ }
1137
+ this.#dirty_effects.clear();
1138
+ this.#maybe_dirty_effects.clear();
1139
+ }
1140
+ /**
1141
+ * Defer an effect inside a pending boundary until the boundary resolves
1142
+ * @param {Effect} effect
1143
+ */
1144
+ defer_effect(effect) {
1145
+ defer_effect(effect, this.#dirty_effects, this.#maybe_dirty_effects);
1146
+ }
1147
+ /**
1148
+ * Returns `false` if the effect exists inside a boundary whose pending snippet is shown
1149
+ * @returns {boolean}
1150
+ */
1151
+ is_rendered() {
1152
+ return !this.is_pending && (!this.parent || this.parent.is_rendered());
1153
+ }
1154
+ has_pending_snippet() {
1155
+ return !!this.#props.pending;
1156
+ }
1157
+ /**
1158
+ * @template T
1159
+ * @param {() => T} fn
1160
+ */
1161
+ #run(fn) {
1162
+ var previous_effect = active_effect;
1163
+ var previous_reaction = active_reaction;
1164
+ var previous_ctx = component_context;
1165
+ set_active_effect(this.#effect);
1166
+ set_active_reaction(this.#effect);
1167
+ set_component_context(this.#effect.ctx);
1168
+ try {
1169
+ return fn();
1170
+ } catch (e) {
1171
+ handle_error(e);
1172
+ return null;
1173
+ } finally {
1174
+ set_active_effect(previous_effect);
1175
+ set_active_reaction(previous_reaction);
1176
+ set_component_context(previous_ctx);
1177
+ }
1178
+ }
1179
+ /**
1180
+ * Updates the pending count associated with the currently visible pending snippet,
1181
+ * if any, such that we can replace the snippet with content once work is done
1182
+ * @param {1 | -1} d
1183
+ */
1184
+ #update_pending_count(d) {
1185
+ if (!this.has_pending_snippet()) {
1186
+ if (this.parent) {
1187
+ this.parent.#update_pending_count(d);
1188
+ }
1189
+ return;
1190
+ }
1191
+ this.#pending_count += d;
1192
+ if (this.#pending_count === 0) {
1193
+ this.#resolve();
1194
+ if (this.#pending_effect) {
1195
+ pause_effect(this.#pending_effect, () => {
1196
+ this.#pending_effect = null;
1197
+ });
1198
+ }
1199
+ if (this.#offscreen_fragment) {
1200
+ this.#anchor.before(this.#offscreen_fragment);
1201
+ this.#offscreen_fragment = null;
1202
+ }
1203
+ }
1204
+ }
1205
+ /**
1206
+ * Update the source that powers `$effect.pending()` inside this boundary,
1207
+ * and controls when the current `pending` snippet (if any) is removed.
1208
+ * Do not call from inside the class
1209
+ * @param {1 | -1} d
1210
+ */
1211
+ update_pending_count(d) {
1212
+ this.#update_pending_count(d);
1213
+ this.#local_pending_count += d;
1214
+ if (!this.#effect_pending || this.#pending_count_update_queued) return;
1215
+ this.#pending_count_update_queued = true;
1216
+ queue_micro_task(() => {
1217
+ this.#pending_count_update_queued = false;
1218
+ if (this.#effect_pending) {
1219
+ internal_set(this.#effect_pending, this.#local_pending_count);
1220
+ }
1221
+ });
1222
+ }
1223
+ get_effect_pending() {
1224
+ this.#effect_pending_subscriber();
1225
+ return get(
1226
+ /** @type {Source<number>} */
1227
+ this.#effect_pending
1228
+ );
1229
+ }
1230
+ /** @param {unknown} error */
1231
+ error(error) {
1232
+ var onerror = this.#props.onerror;
1233
+ let failed = this.#props.failed;
1234
+ if (!onerror && !failed) {
1235
+ throw error;
1236
+ }
1237
+ if (this.#main_effect) {
1238
+ destroy_effect(this.#main_effect);
1239
+ this.#main_effect = null;
1240
+ }
1241
+ if (this.#pending_effect) {
1242
+ destroy_effect(this.#pending_effect);
1243
+ this.#pending_effect = null;
1244
+ }
1245
+ if (this.#failed_effect) {
1246
+ destroy_effect(this.#failed_effect);
1247
+ this.#failed_effect = null;
1248
+ }
1249
+ if (hydrating) {
1250
+ set_hydrate_node(
1251
+ /** @type {TemplateNode} */
1252
+ this.#hydrate_open
1253
+ );
1254
+ next();
1255
+ set_hydrate_node(skip_nodes());
1256
+ }
1257
+ var did_reset = false;
1258
+ var calling_on_error = false;
1259
+ const reset = () => {
1260
+ if (did_reset) {
1261
+ svelte_boundary_reset_noop();
1262
+ return;
1263
+ }
1264
+ did_reset = true;
1265
+ if (calling_on_error) {
1266
+ svelte_boundary_reset_onerror();
1267
+ }
1268
+ if (this.#failed_effect !== null) {
1269
+ pause_effect(this.#failed_effect, () => {
1270
+ this.#failed_effect = null;
1271
+ });
1272
+ }
1273
+ this.#run(() => {
1274
+ Batch.ensure();
1275
+ this.#render();
1276
+ });
1277
+ };
1278
+ const handle_error_result = (transformed_error) => {
1279
+ try {
1280
+ calling_on_error = true;
1281
+ onerror?.(transformed_error, reset);
1282
+ calling_on_error = false;
1283
+ } catch (error2) {
1284
+ invoke_error_boundary(error2, this.#effect && this.#effect.parent);
1285
+ }
1286
+ if (failed) {
1287
+ this.#failed_effect = this.#run(() => {
1288
+ Batch.ensure();
1289
+ try {
1290
+ return branch(() => {
1291
+ var effect = (
1292
+ /** @type {Effect} */
1293
+ active_effect
1294
+ );
1295
+ effect.b = this;
1296
+ effect.f |= BOUNDARY_EFFECT;
1297
+ failed(
1298
+ this.#anchor,
1299
+ () => transformed_error,
1300
+ () => reset
1301
+ );
1302
+ });
1303
+ } catch (error2) {
1304
+ invoke_error_boundary(
1305
+ error2,
1306
+ /** @type {Effect} */
1307
+ this.#effect.parent
1308
+ );
1309
+ return null;
1310
+ }
1311
+ });
1312
+ }
1313
+ };
1314
+ queue_micro_task(() => {
1315
+ var result;
1316
+ try {
1317
+ result = this.transform_error(error);
1318
+ } catch (e) {
1319
+ invoke_error_boundary(e, this.#effect && this.#effect.parent);
1320
+ return;
1321
+ }
1322
+ if (result !== null && typeof result === "object" && typeof /** @type {any} */
1323
+ result.then === "function") {
1324
+ result.then(
1325
+ handle_error_result,
1326
+ /** @param {unknown} e */
1327
+ (e) => invoke_error_boundary(e, this.#effect && this.#effect.parent)
1328
+ );
1329
+ } else {
1330
+ handle_error_result(result);
1331
+ }
1332
+ });
1333
+ }
1334
+ }
1335
+ function destroy_derived_effects(derived2) {
1336
+ var effects = derived2.effects;
1337
+ if (effects !== null) {
1338
+ derived2.effects = null;
1339
+ for (var i = 0; i < effects.length; i += 1) {
1340
+ destroy_effect(
1341
+ /** @type {Effect} */
1342
+ effects[i]
1343
+ );
1344
+ }
1345
+ }
1346
+ }
1347
+ function get_derived_parent_effect(derived2) {
1348
+ var parent = derived2.parent;
1349
+ while (parent !== null) {
1350
+ if ((parent.f & DERIVED) === 0) {
1351
+ return (parent.f & DESTROYED) === 0 ? (
1352
+ /** @type {Effect} */
1353
+ parent
1354
+ ) : null;
1355
+ }
1356
+ parent = parent.parent;
1357
+ }
1358
+ return null;
1359
+ }
1360
+ function execute_derived(derived2) {
1361
+ var value;
1362
+ var prev_active_effect = active_effect;
1363
+ set_active_effect(get_derived_parent_effect(derived2));
1364
+ {
1365
+ try {
1366
+ derived2.f &= ~WAS_MARKED;
1367
+ destroy_derived_effects(derived2);
1368
+ value = update_reaction(derived2);
1369
+ } finally {
1370
+ set_active_effect(prev_active_effect);
1371
+ }
1372
+ }
1373
+ return value;
1374
+ }
1375
+ function update_derived(derived2) {
1376
+ var value = execute_derived(derived2);
1377
+ if (!derived2.equals(value)) {
1378
+ derived2.wv = increment_write_version();
1379
+ if (!current_batch?.is_fork || derived2.deps === null) {
1380
+ derived2.v = value;
1381
+ if (derived2.deps === null) {
1382
+ set_signal_status(derived2, CLEAN);
1383
+ return;
1384
+ }
1385
+ }
1386
+ }
1387
+ if (is_destroying_effect) {
1388
+ return;
1389
+ }
1390
+ if (batch_values !== null) {
1391
+ if (effect_tracking() || current_batch?.is_fork) {
1392
+ batch_values.set(derived2, value);
1393
+ }
1394
+ } else {
1395
+ update_derived_status(derived2);
1396
+ }
1397
+ }
1398
+ function freeze_derived_effects(derived2) {
1399
+ if (derived2.effects === null) return;
1400
+ for (const e of derived2.effects) {
1401
+ if (e.teardown || e.ac) {
1402
+ e.teardown?.();
1403
+ e.ac?.abort(STALE_REACTION);
1404
+ e.teardown = noop;
1405
+ e.ac = null;
1406
+ remove_reactions(e, 0);
1407
+ destroy_effect_children(e);
1408
+ }
1409
+ }
1410
+ }
1411
+ function unfreeze_derived_effects(derived2) {
1412
+ if (derived2.effects === null) return;
1413
+ for (const e of derived2.effects) {
1414
+ if (e.teardown) {
1415
+ update_effect(e);
1416
+ }
1417
+ }
1418
+ }
1419
+ let eager_effects = /* @__PURE__ */ new Set();
1420
+ const old_values = /* @__PURE__ */ new Map();
1421
+ let eager_effects_deferred = false;
1422
+ function source(v, stack) {
1423
+ var signal = {
1424
+ f: 0,
1425
+ // TODO ideally we could skip this altogether, but it causes type errors
1426
+ v,
1427
+ reactions: null,
1428
+ equals,
1429
+ rv: 0,
1430
+ wv: 0
1431
+ };
1432
+ return signal;
1433
+ }
1434
+ // @__NO_SIDE_EFFECTS__
1435
+ function state(v, stack) {
1436
+ const s = source(v);
1437
+ push_reaction_value(s);
1438
+ return s;
1439
+ }
1440
+ // @__NO_SIDE_EFFECTS__
1441
+ function mutable_source(initial_value, immutable = false, trackable = true) {
1442
+ const s = source(initial_value);
1443
+ if (!immutable) {
1444
+ s.equals = safe_equals;
1445
+ }
1446
+ return s;
1447
+ }
1448
+ function set(source2, value, should_proxy = false) {
1449
+ if (active_reaction !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
1450
+ // to ensure we error if state is set inside an inspect effect
1451
+ (!untracking || (active_reaction.f & EAGER_EFFECT) !== 0) && is_runes() && (active_reaction.f & (DERIVED | BLOCK_EFFECT | ASYNC | EAGER_EFFECT)) !== 0 && (current_sources === null || !includes.call(current_sources, source2))) {
1452
+ state_unsafe_mutation();
1453
+ }
1454
+ let new_value = should_proxy ? proxy(value) : value;
1455
+ return internal_set(source2, new_value);
1456
+ }
1457
+ function internal_set(source2, value) {
1458
+ if (!source2.equals(value)) {
1459
+ var old_value = source2.v;
1460
+ if (is_destroying_effect) {
1461
+ old_values.set(source2, value);
1462
+ } else {
1463
+ old_values.set(source2, old_value);
1464
+ }
1465
+ source2.v = value;
1466
+ var batch = Batch.ensure();
1467
+ batch.capture(source2, old_value);
1468
+ if ((source2.f & DERIVED) !== 0) {
1469
+ const derived2 = (
1470
+ /** @type {Derived} */
1471
+ source2
1472
+ );
1473
+ if ((source2.f & DIRTY) !== 0) {
1474
+ execute_derived(derived2);
1475
+ }
1476
+ update_derived_status(derived2);
1477
+ }
1478
+ source2.wv = increment_write_version();
1479
+ mark_reactions(source2, DIRTY);
1480
+ if (active_effect !== null && (active_effect.f & CLEAN) !== 0 && (active_effect.f & (BRANCH_EFFECT | ROOT_EFFECT)) === 0) {
1481
+ if (untracked_writes === null) {
1482
+ set_untracked_writes([source2]);
1483
+ } else {
1484
+ untracked_writes.push(source2);
1485
+ }
1486
+ }
1487
+ if (!batch.is_fork && eager_effects.size > 0 && !eager_effects_deferred) {
1488
+ flush_eager_effects();
1489
+ }
1490
+ }
1491
+ return value;
1492
+ }
1493
+ function flush_eager_effects() {
1494
+ eager_effects_deferred = false;
1495
+ for (const effect of eager_effects) {
1496
+ if ((effect.f & CLEAN) !== 0) {
1497
+ set_signal_status(effect, MAYBE_DIRTY);
1498
+ }
1499
+ if (is_dirty(effect)) {
1500
+ update_effect(effect);
1501
+ }
1502
+ }
1503
+ eager_effects.clear();
1504
+ }
1505
+ function increment(source2) {
1506
+ set(source2, source2.v + 1);
1507
+ }
1508
+ function mark_reactions(signal, status) {
1509
+ var reactions = signal.reactions;
1510
+ if (reactions === null) return;
1511
+ var length = reactions.length;
1512
+ for (var i = 0; i < length; i++) {
1513
+ var reaction = reactions[i];
1514
+ var flags2 = reaction.f;
1515
+ var not_dirty = (flags2 & DIRTY) === 0;
1516
+ if (not_dirty) {
1517
+ set_signal_status(reaction, status);
1518
+ }
1519
+ if ((flags2 & DERIVED) !== 0) {
1520
+ var derived2 = (
1521
+ /** @type {Derived} */
1522
+ reaction
1523
+ );
1524
+ batch_values?.delete(derived2);
1525
+ if ((flags2 & WAS_MARKED) === 0) {
1526
+ if (flags2 & CONNECTED) {
1527
+ reaction.f |= WAS_MARKED;
1528
+ }
1529
+ mark_reactions(derived2, MAYBE_DIRTY);
1530
+ }
1531
+ } else if (not_dirty) {
1532
+ if ((flags2 & BLOCK_EFFECT) !== 0 && eager_block_effects !== null) {
1533
+ eager_block_effects.add(
1534
+ /** @type {Effect} */
1535
+ reaction
1536
+ );
1537
+ }
1538
+ schedule_effect(
1539
+ /** @type {Effect} */
1540
+ reaction
1541
+ );
1542
+ }
1543
+ }
1544
+ }
1545
+ function proxy(value) {
1546
+ if (typeof value !== "object" || value === null || STATE_SYMBOL in value) {
1547
+ return value;
1548
+ }
1549
+ const prototype = get_prototype_of(value);
1550
+ if (prototype !== object_prototype && prototype !== array_prototype) {
1551
+ return value;
1552
+ }
1553
+ var sources = /* @__PURE__ */ new Map();
1554
+ var is_proxied_array = is_array(value);
1555
+ var version = /* @__PURE__ */ state(0);
1556
+ var parent_version = update_version;
1557
+ var with_parent = (fn) => {
1558
+ if (update_version === parent_version) {
1559
+ return fn();
1560
+ }
1561
+ var reaction = active_reaction;
1562
+ var version2 = update_version;
1563
+ set_active_reaction(null);
1564
+ set_update_version(parent_version);
1565
+ var result = fn();
1566
+ set_active_reaction(reaction);
1567
+ set_update_version(version2);
1568
+ return result;
1569
+ };
1570
+ if (is_proxied_array) {
1571
+ sources.set("length", /* @__PURE__ */ state(
1572
+ /** @type {any[]} */
1573
+ value.length
1574
+ ));
1575
+ }
1576
+ return new Proxy(
1577
+ /** @type {any} */
1578
+ value,
1579
+ {
1580
+ defineProperty(_, prop, descriptor) {
1581
+ if (!("value" in descriptor) || descriptor.configurable === false || descriptor.enumerable === false || descriptor.writable === false) {
1582
+ state_descriptors_fixed();
1583
+ }
1584
+ var s = sources.get(prop);
1585
+ if (s === void 0) {
1586
+ with_parent(() => {
1587
+ var s2 = /* @__PURE__ */ state(descriptor.value);
1588
+ sources.set(prop, s2);
1589
+ return s2;
1590
+ });
1591
+ } else {
1592
+ set(s, descriptor.value, true);
1593
+ }
1594
+ return true;
1595
+ },
1596
+ deleteProperty(target, prop) {
1597
+ var s = sources.get(prop);
1598
+ if (s === void 0) {
1599
+ if (prop in target) {
1600
+ const s2 = with_parent(() => /* @__PURE__ */ state(UNINITIALIZED));
1601
+ sources.set(prop, s2);
1602
+ increment(version);
1603
+ }
1604
+ } else {
1605
+ set(s, UNINITIALIZED);
1606
+ increment(version);
1607
+ }
1608
+ return true;
1609
+ },
1610
+ get(target, prop, receiver) {
1611
+ if (prop === STATE_SYMBOL) {
1612
+ return value;
1613
+ }
1614
+ var s = sources.get(prop);
1615
+ var exists = prop in target;
1616
+ if (s === void 0 && (!exists || get_descriptor(target, prop)?.writable)) {
1617
+ s = with_parent(() => {
1618
+ var p = proxy(exists ? target[prop] : UNINITIALIZED);
1619
+ var s2 = /* @__PURE__ */ state(p);
1620
+ return s2;
1621
+ });
1622
+ sources.set(prop, s);
1623
+ }
1624
+ if (s !== void 0) {
1625
+ var v = get(s);
1626
+ return v === UNINITIALIZED ? void 0 : v;
1627
+ }
1628
+ return Reflect.get(target, prop, receiver);
1629
+ },
1630
+ getOwnPropertyDescriptor(target, prop) {
1631
+ var descriptor = Reflect.getOwnPropertyDescriptor(target, prop);
1632
+ if (descriptor && "value" in descriptor) {
1633
+ var s = sources.get(prop);
1634
+ if (s) descriptor.value = get(s);
1635
+ } else if (descriptor === void 0) {
1636
+ var source2 = sources.get(prop);
1637
+ var value2 = source2?.v;
1638
+ if (source2 !== void 0 && value2 !== UNINITIALIZED) {
1639
+ return {
1640
+ enumerable: true,
1641
+ configurable: true,
1642
+ value: value2,
1643
+ writable: true
1644
+ };
1645
+ }
1646
+ }
1647
+ return descriptor;
1648
+ },
1649
+ has(target, prop) {
1650
+ if (prop === STATE_SYMBOL) {
1651
+ return true;
1652
+ }
1653
+ var s = sources.get(prop);
1654
+ var has = s !== void 0 && s.v !== UNINITIALIZED || Reflect.has(target, prop);
1655
+ if (s !== void 0 || active_effect !== null && (!has || get_descriptor(target, prop)?.writable)) {
1656
+ if (s === void 0) {
1657
+ s = with_parent(() => {
1658
+ var p = has ? proxy(target[prop]) : UNINITIALIZED;
1659
+ var s2 = /* @__PURE__ */ state(p);
1660
+ return s2;
1661
+ });
1662
+ sources.set(prop, s);
1663
+ }
1664
+ var value2 = get(s);
1665
+ if (value2 === UNINITIALIZED) {
1666
+ return false;
1667
+ }
1668
+ }
1669
+ return has;
1670
+ },
1671
+ set(target, prop, value2, receiver) {
1672
+ var s = sources.get(prop);
1673
+ var has = prop in target;
1674
+ if (is_proxied_array && prop === "length") {
1675
+ for (var i = value2; i < /** @type {Source<number>} */
1676
+ s.v; i += 1) {
1677
+ var other_s = sources.get(i + "");
1678
+ if (other_s !== void 0) {
1679
+ set(other_s, UNINITIALIZED);
1680
+ } else if (i in target) {
1681
+ other_s = with_parent(() => /* @__PURE__ */ state(UNINITIALIZED));
1682
+ sources.set(i + "", other_s);
1683
+ }
1684
+ }
1685
+ }
1686
+ if (s === void 0) {
1687
+ if (!has || get_descriptor(target, prop)?.writable) {
1688
+ s = with_parent(() => /* @__PURE__ */ state(void 0));
1689
+ set(s, proxy(value2));
1690
+ sources.set(prop, s);
1691
+ }
1692
+ } else {
1693
+ has = s.v !== UNINITIALIZED;
1694
+ var p = with_parent(() => proxy(value2));
1695
+ set(s, p);
1696
+ }
1697
+ var descriptor = Reflect.getOwnPropertyDescriptor(target, prop);
1698
+ if (descriptor?.set) {
1699
+ descriptor.set.call(receiver, value2);
1700
+ }
1701
+ if (!has) {
1702
+ if (is_proxied_array && typeof prop === "string") {
1703
+ var ls = (
1704
+ /** @type {Source<number>} */
1705
+ sources.get("length")
1706
+ );
1707
+ var n = Number(prop);
1708
+ if (Number.isInteger(n) && n >= ls.v) {
1709
+ set(ls, n + 1);
1710
+ }
1711
+ }
1712
+ increment(version);
1713
+ }
1714
+ return true;
1715
+ },
1716
+ ownKeys(target) {
1717
+ get(version);
1718
+ var own_keys = Reflect.ownKeys(target).filter((key2) => {
1719
+ var source3 = sources.get(key2);
1720
+ return source3 === void 0 || source3.v !== UNINITIALIZED;
1721
+ });
1722
+ for (var [key, source2] of sources) {
1723
+ if (source2.v !== UNINITIALIZED && !(key in target)) {
1724
+ own_keys.push(key);
1725
+ }
1726
+ }
1727
+ return own_keys;
1728
+ },
1729
+ setPrototypeOf() {
1730
+ state_prototype_fixed();
1731
+ }
1732
+ }
1733
+ );
1734
+ }
1735
+ var $window;
1736
+ var first_child_getter;
1737
+ var next_sibling_getter;
1738
+ function init_operations() {
1739
+ if ($window !== void 0) {
1740
+ return;
1741
+ }
1742
+ $window = window;
1743
+ var element_prototype = Element.prototype;
1744
+ var node_prototype = Node.prototype;
1745
+ var text_prototype = Text.prototype;
1746
+ first_child_getter = get_descriptor(node_prototype, "firstChild").get;
1747
+ next_sibling_getter = get_descriptor(node_prototype, "nextSibling").get;
1748
+ if (is_extensible(element_prototype)) {
1749
+ element_prototype.__click = void 0;
1750
+ element_prototype.__className = void 0;
1751
+ element_prototype.__attributes = null;
1752
+ element_prototype.__style = void 0;
1753
+ element_prototype.__e = void 0;
1754
+ }
1755
+ if (is_extensible(text_prototype)) {
1756
+ text_prototype.__t = void 0;
1757
+ }
1758
+ }
1759
+ function create_text(value = "") {
1760
+ return document.createTextNode(value);
1761
+ }
1762
+ // @__NO_SIDE_EFFECTS__
1763
+ function get_first_child(node) {
1764
+ return (
1765
+ /** @type {TemplateNode | null} */
1766
+ first_child_getter.call(node)
1767
+ );
1768
+ }
1769
+ // @__NO_SIDE_EFFECTS__
1770
+ function get_next_sibling(node) {
1771
+ return (
1772
+ /** @type {TemplateNode | null} */
1773
+ next_sibling_getter.call(node)
1774
+ );
1775
+ }
1776
+ function clear_text_content(node) {
1777
+ node.textContent = "";
1778
+ }
1779
+ function without_reactive_context(fn) {
1780
+ var previous_reaction = active_reaction;
1781
+ var previous_effect = active_effect;
1782
+ set_active_reaction(null);
1783
+ set_active_effect(null);
1784
+ try {
1785
+ return fn();
1786
+ } finally {
1787
+ set_active_reaction(previous_reaction);
1788
+ set_active_effect(previous_effect);
1789
+ }
1790
+ }
1791
+ function push_effect(effect, parent_effect) {
1792
+ var parent_last = parent_effect.last;
1793
+ if (parent_last === null) {
1794
+ parent_effect.last = parent_effect.first = effect;
1795
+ } else {
1796
+ parent_last.next = effect;
1797
+ effect.prev = parent_last;
1798
+ parent_effect.last = effect;
1799
+ }
1800
+ }
1801
+ function create_effect(type, fn, sync) {
1802
+ var parent = active_effect;
1803
+ if (parent !== null && (parent.f & INERT) !== 0) {
1804
+ type |= INERT;
1805
+ }
1806
+ var effect = {
1807
+ ctx: component_context,
1808
+ deps: null,
1809
+ nodes: null,
1810
+ f: type | DIRTY | CONNECTED,
1811
+ first: null,
1812
+ fn,
1813
+ last: null,
1814
+ next: null,
1815
+ parent,
1816
+ b: parent && parent.b,
1817
+ prev: null,
1818
+ teardown: null,
1819
+ wv: 0,
1820
+ ac: null
1821
+ };
1822
+ if (sync) {
1823
+ try {
1824
+ update_effect(effect);
1825
+ } catch (e2) {
1826
+ destroy_effect(effect);
1827
+ throw e2;
1828
+ }
1829
+ } else if (fn !== null) {
1830
+ schedule_effect(effect);
1831
+ }
1832
+ var e = effect;
1833
+ if (sync && e.deps === null && e.teardown === null && e.nodes === null && e.first === e.last && // either `null`, or a singular child
1834
+ (e.f & EFFECT_PRESERVED) === 0) {
1835
+ e = e.first;
1836
+ if ((type & BLOCK_EFFECT) !== 0 && (type & EFFECT_TRANSPARENT) !== 0 && e !== null) {
1837
+ e.f |= EFFECT_TRANSPARENT;
1838
+ }
1839
+ }
1840
+ if (e !== null) {
1841
+ e.parent = parent;
1842
+ if (parent !== null) {
1843
+ push_effect(e, parent);
1844
+ }
1845
+ if (active_reaction !== null && (active_reaction.f & DERIVED) !== 0 && (type & ROOT_EFFECT) === 0) {
1846
+ var derived2 = (
1847
+ /** @type {Derived} */
1848
+ active_reaction
1849
+ );
1850
+ (derived2.effects ??= []).push(e);
1851
+ }
1852
+ }
1853
+ return effect;
1854
+ }
1855
+ function effect_tracking() {
1856
+ return active_reaction !== null && !untracking;
1857
+ }
1858
+ function create_user_effect(fn) {
1859
+ return create_effect(EFFECT | USER_EFFECT, fn, false);
1860
+ }
1861
+ function component_root(fn) {
1862
+ Batch.ensure();
1863
+ const effect = create_effect(ROOT_EFFECT | EFFECT_PRESERVED, fn, true);
1864
+ return (options = {}) => {
1865
+ return new Promise((fulfil) => {
1866
+ if (options.outro) {
1867
+ pause_effect(effect, () => {
1868
+ destroy_effect(effect);
1869
+ fulfil(void 0);
1870
+ });
1871
+ } else {
1872
+ destroy_effect(effect);
1873
+ fulfil(void 0);
1874
+ }
1875
+ });
1876
+ };
1877
+ }
1878
+ function render_effect(fn, flags2 = 0) {
1879
+ return create_effect(RENDER_EFFECT | flags2, fn, true);
1880
+ }
1881
+ function block(fn, flags2 = 0) {
1882
+ var effect = create_effect(BLOCK_EFFECT | flags2, fn, true);
1883
+ return effect;
1884
+ }
1885
+ function branch(fn) {
1886
+ return create_effect(BRANCH_EFFECT | EFFECT_PRESERVED, fn, true);
1887
+ }
1888
+ function execute_effect_teardown(effect) {
1889
+ var teardown = effect.teardown;
1890
+ if (teardown !== null) {
1891
+ const previously_destroying_effect = is_destroying_effect;
1892
+ const previous_reaction = active_reaction;
1893
+ set_is_destroying_effect(true);
1894
+ set_active_reaction(null);
1895
+ try {
1896
+ teardown.call(null);
1897
+ } finally {
1898
+ set_is_destroying_effect(previously_destroying_effect);
1899
+ set_active_reaction(previous_reaction);
1900
+ }
1901
+ }
1902
+ }
1903
+ function destroy_effect_children(signal, remove_dom = false) {
1904
+ var effect = signal.first;
1905
+ signal.first = signal.last = null;
1906
+ while (effect !== null) {
1907
+ const controller = effect.ac;
1908
+ if (controller !== null) {
1909
+ without_reactive_context(() => {
1910
+ controller.abort(STALE_REACTION);
1911
+ });
1912
+ }
1913
+ var next2 = effect.next;
1914
+ if ((effect.f & ROOT_EFFECT) !== 0) {
1915
+ effect.parent = null;
1916
+ } else {
1917
+ destroy_effect(effect, remove_dom);
1918
+ }
1919
+ effect = next2;
1920
+ }
1921
+ }
1922
+ function destroy_block_effect_children(signal) {
1923
+ var effect = signal.first;
1924
+ while (effect !== null) {
1925
+ var next2 = effect.next;
1926
+ if ((effect.f & BRANCH_EFFECT) === 0) {
1927
+ destroy_effect(effect);
1928
+ }
1929
+ effect = next2;
1930
+ }
1931
+ }
1932
+ function destroy_effect(effect, remove_dom = true) {
1933
+ var removed = false;
1934
+ if ((remove_dom || (effect.f & HEAD_EFFECT) !== 0) && effect.nodes !== null && effect.nodes.end !== null) {
1935
+ remove_effect_dom(
1936
+ effect.nodes.start,
1937
+ /** @type {TemplateNode} */
1938
+ effect.nodes.end
1939
+ );
1940
+ removed = true;
1941
+ }
1942
+ destroy_effect_children(effect, remove_dom && !removed);
1943
+ remove_reactions(effect, 0);
1944
+ set_signal_status(effect, DESTROYED);
1945
+ var transitions = effect.nodes && effect.nodes.t;
1946
+ if (transitions !== null) {
1947
+ for (const transition of transitions) {
1948
+ transition.stop();
1949
+ }
1950
+ }
1951
+ execute_effect_teardown(effect);
1952
+ var parent = effect.parent;
1953
+ if (parent !== null && parent.first !== null) {
1954
+ unlink_effect(effect);
1955
+ }
1956
+ effect.next = effect.prev = effect.teardown = effect.ctx = effect.deps = effect.fn = effect.nodes = effect.ac = null;
1957
+ }
1958
+ function remove_effect_dom(node, end) {
1959
+ while (node !== null) {
1960
+ var next2 = node === end ? null : /* @__PURE__ */ get_next_sibling(node);
1961
+ node.remove();
1962
+ node = next2;
1963
+ }
1964
+ }
1965
+ function unlink_effect(effect) {
1966
+ var parent = effect.parent;
1967
+ var prev = effect.prev;
1968
+ var next2 = effect.next;
1969
+ if (prev !== null) prev.next = next2;
1970
+ if (next2 !== null) next2.prev = prev;
1971
+ if (parent !== null) {
1972
+ if (parent.first === effect) parent.first = next2;
1973
+ if (parent.last === effect) parent.last = prev;
1974
+ }
1975
+ }
1976
+ function pause_effect(effect, callback, destroy = true) {
1977
+ var transitions = [];
1978
+ pause_children(effect, transitions, true);
1979
+ var fn = () => {
1980
+ if (destroy) destroy_effect(effect);
1981
+ if (callback) callback();
1982
+ };
1983
+ var remaining = transitions.length;
1984
+ if (remaining > 0) {
1985
+ var check = () => --remaining || fn();
1986
+ for (var transition of transitions) {
1987
+ transition.out(check);
1988
+ }
1989
+ } else {
1990
+ fn();
1991
+ }
1992
+ }
1993
+ function pause_children(effect, transitions, local) {
1994
+ if ((effect.f & INERT) !== 0) return;
1995
+ effect.f ^= INERT;
1996
+ var t = effect.nodes && effect.nodes.t;
1997
+ if (t !== null) {
1998
+ for (const transition of t) {
1999
+ if (transition.is_global || local) {
2000
+ transitions.push(transition);
2001
+ }
2002
+ }
2003
+ }
2004
+ var child = effect.first;
2005
+ while (child !== null) {
2006
+ var sibling = child.next;
2007
+ var transparent = (child.f & EFFECT_TRANSPARENT) !== 0 || // If this is a branch effect without a block effect parent,
2008
+ // it means the parent block effect was pruned. In that case,
2009
+ // transparency information was transferred to the branch effect.
2010
+ (child.f & BRANCH_EFFECT) !== 0 && (effect.f & BLOCK_EFFECT) !== 0;
2011
+ pause_children(child, transitions, transparent ? local : false);
2012
+ child = sibling;
2013
+ }
2014
+ }
2015
+ function move_effect(effect, fragment) {
2016
+ if (!effect.nodes) return;
2017
+ var node = effect.nodes.start;
2018
+ var end = effect.nodes.end;
2019
+ while (node !== null) {
2020
+ var next2 = node === end ? null : /* @__PURE__ */ get_next_sibling(node);
2021
+ fragment.append(node);
2022
+ node = next2;
2023
+ }
2024
+ }
2025
+ let is_updating_effect = false;
2026
+ let is_destroying_effect = false;
2027
+ function set_is_destroying_effect(value) {
2028
+ is_destroying_effect = value;
2029
+ }
2030
+ let active_reaction = null;
2031
+ let untracking = false;
2032
+ function set_active_reaction(reaction) {
2033
+ active_reaction = reaction;
2034
+ }
2035
+ let active_effect = null;
2036
+ function set_active_effect(effect) {
2037
+ active_effect = effect;
2038
+ }
2039
+ let current_sources = null;
2040
+ function push_reaction_value(value) {
2041
+ if (active_reaction !== null && true) {
2042
+ if (current_sources === null) {
2043
+ current_sources = [value];
2044
+ } else {
2045
+ current_sources.push(value);
2046
+ }
2047
+ }
2048
+ }
2049
+ let new_deps = null;
2050
+ let skipped_deps = 0;
2051
+ let untracked_writes = null;
2052
+ function set_untracked_writes(value) {
2053
+ untracked_writes = value;
2054
+ }
2055
+ let write_version = 1;
2056
+ let read_version = 0;
2057
+ let update_version = read_version;
2058
+ function set_update_version(value) {
2059
+ update_version = value;
2060
+ }
2061
+ function increment_write_version() {
2062
+ return ++write_version;
2063
+ }
2064
+ function is_dirty(reaction) {
2065
+ var flags2 = reaction.f;
2066
+ if ((flags2 & DIRTY) !== 0) {
2067
+ return true;
2068
+ }
2069
+ if (flags2 & DERIVED) {
2070
+ reaction.f &= ~WAS_MARKED;
2071
+ }
2072
+ if ((flags2 & MAYBE_DIRTY) !== 0) {
2073
+ var dependencies = (
2074
+ /** @type {Value[]} */
2075
+ reaction.deps
2076
+ );
2077
+ var length = dependencies.length;
2078
+ for (var i = 0; i < length; i++) {
2079
+ var dependency = dependencies[i];
2080
+ if (is_dirty(
2081
+ /** @type {Derived} */
2082
+ dependency
2083
+ )) {
2084
+ update_derived(
2085
+ /** @type {Derived} */
2086
+ dependency
2087
+ );
2088
+ }
2089
+ if (dependency.wv > reaction.wv) {
2090
+ return true;
2091
+ }
2092
+ }
2093
+ if ((flags2 & CONNECTED) !== 0 && // During time traveling we don't want to reset the status so that
2094
+ // traversal of the graph in the other batches still happens
2095
+ batch_values === null) {
2096
+ set_signal_status(reaction, CLEAN);
2097
+ }
2098
+ }
2099
+ return false;
2100
+ }
2101
+ function schedule_possible_effect_self_invalidation(signal, effect, root2 = true) {
2102
+ var reactions = signal.reactions;
2103
+ if (reactions === null) return;
2104
+ if (current_sources !== null && includes.call(current_sources, signal)) {
2105
+ return;
2106
+ }
2107
+ for (var i = 0; i < reactions.length; i++) {
2108
+ var reaction = reactions[i];
2109
+ if ((reaction.f & DERIVED) !== 0) {
2110
+ schedule_possible_effect_self_invalidation(
2111
+ /** @type {Derived} */
2112
+ reaction,
2113
+ effect,
2114
+ false
2115
+ );
2116
+ } else if (effect === reaction) {
2117
+ if (root2) {
2118
+ set_signal_status(reaction, DIRTY);
2119
+ } else if ((reaction.f & CLEAN) !== 0) {
2120
+ set_signal_status(reaction, MAYBE_DIRTY);
2121
+ }
2122
+ schedule_effect(
2123
+ /** @type {Effect} */
2124
+ reaction
2125
+ );
2126
+ }
2127
+ }
2128
+ }
2129
+ function update_reaction(reaction) {
2130
+ var previous_deps = new_deps;
2131
+ var previous_skipped_deps = skipped_deps;
2132
+ var previous_untracked_writes = untracked_writes;
2133
+ var previous_reaction = active_reaction;
2134
+ var previous_sources = current_sources;
2135
+ var previous_component_context = component_context;
2136
+ var previous_untracking = untracking;
2137
+ var previous_update_version = update_version;
2138
+ var flags2 = reaction.f;
2139
+ new_deps = /** @type {null | Value[]} */
2140
+ null;
2141
+ skipped_deps = 0;
2142
+ untracked_writes = null;
2143
+ active_reaction = (flags2 & (BRANCH_EFFECT | ROOT_EFFECT)) === 0 ? reaction : null;
2144
+ current_sources = null;
2145
+ set_component_context(reaction.ctx);
2146
+ untracking = false;
2147
+ update_version = ++read_version;
2148
+ if (reaction.ac !== null) {
2149
+ without_reactive_context(() => {
2150
+ reaction.ac.abort(STALE_REACTION);
2151
+ });
2152
+ reaction.ac = null;
2153
+ }
2154
+ try {
2155
+ reaction.f |= REACTION_IS_UPDATING;
2156
+ var fn = (
2157
+ /** @type {Function} */
2158
+ reaction.fn
2159
+ );
2160
+ var result = fn();
2161
+ reaction.f |= REACTION_RAN;
2162
+ var deps = reaction.deps;
2163
+ var is_fork = current_batch?.is_fork;
2164
+ if (new_deps !== null) {
2165
+ var i;
2166
+ if (!is_fork) {
2167
+ remove_reactions(reaction, skipped_deps);
2168
+ }
2169
+ if (deps !== null && skipped_deps > 0) {
2170
+ deps.length = skipped_deps + new_deps.length;
2171
+ for (i = 0; i < new_deps.length; i++) {
2172
+ deps[skipped_deps + i] = new_deps[i];
2173
+ }
2174
+ } else {
2175
+ reaction.deps = deps = new_deps;
2176
+ }
2177
+ if (effect_tracking() && (reaction.f & CONNECTED) !== 0) {
2178
+ for (i = skipped_deps; i < deps.length; i++) {
2179
+ (deps[i].reactions ??= []).push(reaction);
2180
+ }
2181
+ }
2182
+ } else if (!is_fork && deps !== null && skipped_deps < deps.length) {
2183
+ remove_reactions(reaction, skipped_deps);
2184
+ deps.length = skipped_deps;
2185
+ }
2186
+ if (is_runes() && untracked_writes !== null && !untracking && deps !== null && (reaction.f & (DERIVED | MAYBE_DIRTY | DIRTY)) === 0) {
2187
+ for (i = 0; i < /** @type {Source[]} */
2188
+ untracked_writes.length; i++) {
2189
+ schedule_possible_effect_self_invalidation(
2190
+ untracked_writes[i],
2191
+ /** @type {Effect} */
2192
+ reaction
2193
+ );
2194
+ }
2195
+ }
2196
+ if (previous_reaction !== null && previous_reaction !== reaction) {
2197
+ read_version++;
2198
+ if (previous_reaction.deps !== null) {
2199
+ for (let i2 = 0; i2 < previous_skipped_deps; i2 += 1) {
2200
+ previous_reaction.deps[i2].rv = read_version;
2201
+ }
2202
+ }
2203
+ if (previous_deps !== null) {
2204
+ for (const dep of previous_deps) {
2205
+ dep.rv = read_version;
2206
+ }
2207
+ }
2208
+ if (untracked_writes !== null) {
2209
+ if (previous_untracked_writes === null) {
2210
+ previous_untracked_writes = untracked_writes;
2211
+ } else {
2212
+ previous_untracked_writes.push(.../** @type {Source[]} */
2213
+ untracked_writes);
2214
+ }
2215
+ }
2216
+ }
2217
+ if ((reaction.f & ERROR_VALUE) !== 0) {
2218
+ reaction.f ^= ERROR_VALUE;
2219
+ }
2220
+ return result;
2221
+ } catch (error) {
2222
+ return handle_error(error);
2223
+ } finally {
2224
+ reaction.f ^= REACTION_IS_UPDATING;
2225
+ new_deps = previous_deps;
2226
+ skipped_deps = previous_skipped_deps;
2227
+ untracked_writes = previous_untracked_writes;
2228
+ active_reaction = previous_reaction;
2229
+ current_sources = previous_sources;
2230
+ set_component_context(previous_component_context);
2231
+ untracking = previous_untracking;
2232
+ update_version = previous_update_version;
2233
+ }
2234
+ }
2235
+ function remove_reaction(signal, dependency) {
2236
+ let reactions = dependency.reactions;
2237
+ if (reactions !== null) {
2238
+ var index = index_of.call(reactions, signal);
2239
+ if (index !== -1) {
2240
+ var new_length = reactions.length - 1;
2241
+ if (new_length === 0) {
2242
+ reactions = dependency.reactions = null;
2243
+ } else {
2244
+ reactions[index] = reactions[new_length];
2245
+ reactions.pop();
2246
+ }
2247
+ }
2248
+ }
2249
+ if (reactions === null && (dependency.f & DERIVED) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
2250
+ // to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
2251
+ // allows us to skip the expensive work of disconnecting and immediately reconnecting it
2252
+ (new_deps === null || !includes.call(new_deps, dependency))) {
2253
+ var derived2 = (
2254
+ /** @type {Derived} */
2255
+ dependency
2256
+ );
2257
+ if ((derived2.f & CONNECTED) !== 0) {
2258
+ derived2.f ^= CONNECTED;
2259
+ derived2.f &= ~WAS_MARKED;
2260
+ }
2261
+ update_derived_status(derived2);
2262
+ freeze_derived_effects(derived2);
2263
+ remove_reactions(derived2, 0);
2264
+ }
2265
+ }
2266
+ function remove_reactions(signal, start_index) {
2267
+ var dependencies = signal.deps;
2268
+ if (dependencies === null) return;
2269
+ for (var i = start_index; i < dependencies.length; i++) {
2270
+ remove_reaction(signal, dependencies[i]);
2271
+ }
2272
+ }
2273
+ function update_effect(effect) {
2274
+ var flags2 = effect.f;
2275
+ if ((flags2 & DESTROYED) !== 0) {
2276
+ return;
2277
+ }
2278
+ set_signal_status(effect, CLEAN);
2279
+ var previous_effect = active_effect;
2280
+ var was_updating_effect = is_updating_effect;
2281
+ active_effect = effect;
2282
+ is_updating_effect = true;
2283
+ try {
2284
+ if ((flags2 & (BLOCK_EFFECT | MANAGED_EFFECT)) !== 0) {
2285
+ destroy_block_effect_children(effect);
2286
+ } else {
2287
+ destroy_effect_children(effect);
2288
+ }
2289
+ execute_effect_teardown(effect);
2290
+ var teardown = update_reaction(effect);
2291
+ effect.teardown = typeof teardown === "function" ? teardown : null;
2292
+ effect.wv = write_version;
2293
+ var dep;
2294
+ if (DEV && tracing_mode_flag && (effect.f & DIRTY) !== 0 && effect.deps !== null) ;
2295
+ } finally {
2296
+ is_updating_effect = was_updating_effect;
2297
+ active_effect = previous_effect;
2298
+ }
2299
+ }
2300
+ function get(signal) {
2301
+ var flags2 = signal.f;
2302
+ var is_derived = (flags2 & DERIVED) !== 0;
2303
+ if (active_reaction !== null && !untracking) {
2304
+ var destroyed = active_effect !== null && (active_effect.f & DESTROYED) !== 0;
2305
+ if (!destroyed && (current_sources === null || !includes.call(current_sources, signal))) {
2306
+ var deps = active_reaction.deps;
2307
+ if ((active_reaction.f & REACTION_IS_UPDATING) !== 0) {
2308
+ if (signal.rv < read_version) {
2309
+ signal.rv = read_version;
2310
+ if (new_deps === null && deps !== null && deps[skipped_deps] === signal) {
2311
+ skipped_deps++;
2312
+ } else if (new_deps === null) {
2313
+ new_deps = [signal];
2314
+ } else {
2315
+ new_deps.push(signal);
2316
+ }
2317
+ }
2318
+ } else {
2319
+ (active_reaction.deps ??= []).push(signal);
2320
+ var reactions = signal.reactions;
2321
+ if (reactions === null) {
2322
+ signal.reactions = [active_reaction];
2323
+ } else if (!includes.call(reactions, active_reaction)) {
2324
+ reactions.push(active_reaction);
2325
+ }
2326
+ }
2327
+ }
2328
+ }
2329
+ if (is_destroying_effect && old_values.has(signal)) {
2330
+ return old_values.get(signal);
2331
+ }
2332
+ if (is_derived) {
2333
+ var derived2 = (
2334
+ /** @type {Derived} */
2335
+ signal
2336
+ );
2337
+ if (is_destroying_effect) {
2338
+ var value = derived2.v;
2339
+ if ((derived2.f & CLEAN) === 0 && derived2.reactions !== null || depends_on_old_values(derived2)) {
2340
+ value = execute_derived(derived2);
2341
+ }
2342
+ old_values.set(derived2, value);
2343
+ return value;
2344
+ }
2345
+ var should_connect = (derived2.f & CONNECTED) === 0 && !untracking && active_reaction !== null && (is_updating_effect || (active_reaction.f & CONNECTED) !== 0);
2346
+ var is_new = (derived2.f & REACTION_RAN) === 0;
2347
+ if (is_dirty(derived2)) {
2348
+ if (should_connect) {
2349
+ derived2.f |= CONNECTED;
2350
+ }
2351
+ update_derived(derived2);
2352
+ }
2353
+ if (should_connect && !is_new) {
2354
+ unfreeze_derived_effects(derived2);
2355
+ reconnect(derived2);
2356
+ }
2357
+ }
2358
+ if (batch_values?.has(signal)) {
2359
+ return batch_values.get(signal);
2360
+ }
2361
+ if ((signal.f & ERROR_VALUE) !== 0) {
2362
+ throw signal.v;
2363
+ }
2364
+ return signal.v;
2365
+ }
2366
+ function reconnect(derived2) {
2367
+ derived2.f |= CONNECTED;
2368
+ if (derived2.deps === null) return;
2369
+ for (const dep of derived2.deps) {
2370
+ (dep.reactions ??= []).push(derived2);
2371
+ if ((dep.f & DERIVED) !== 0 && (dep.f & CONNECTED) === 0) {
2372
+ unfreeze_derived_effects(
2373
+ /** @type {Derived} */
2374
+ dep
2375
+ );
2376
+ reconnect(
2377
+ /** @type {Derived} */
2378
+ dep
2379
+ );
2380
+ }
2381
+ }
2382
+ }
2383
+ function depends_on_old_values(derived2) {
2384
+ if (derived2.v === UNINITIALIZED) return true;
2385
+ if (derived2.deps === null) return false;
2386
+ for (const dep of derived2.deps) {
2387
+ if (old_values.has(dep)) {
2388
+ return true;
2389
+ }
2390
+ if ((dep.f & DERIVED) !== 0 && depends_on_old_values(
2391
+ /** @type {Derived} */
2392
+ dep
2393
+ )) {
2394
+ return true;
2395
+ }
2396
+ }
2397
+ return false;
2398
+ }
2399
+ function untrack(fn) {
2400
+ var previous_untracking = untracking;
2401
+ try {
2402
+ untracking = true;
2403
+ return fn();
2404
+ } finally {
2405
+ untracking = previous_untracking;
2406
+ }
2407
+ }
2408
+ const event_symbol = /* @__PURE__ */ Symbol("events");
2409
+ const all_registered_events = /* @__PURE__ */ new Set();
2410
+ const root_event_handles = /* @__PURE__ */ new Set();
2411
+ let last_propagated_event = null;
2412
+ function handle_event_propagation(event) {
2413
+ var handler_element = this;
2414
+ var owner_document = (
2415
+ /** @type {Node} */
2416
+ handler_element.ownerDocument
2417
+ );
2418
+ var event_name = event.type;
2419
+ var path = event.composedPath?.() || [];
2420
+ var current_target = (
2421
+ /** @type {null | Element} */
2422
+ path[0] || event.target
2423
+ );
2424
+ last_propagated_event = event;
2425
+ var path_idx = 0;
2426
+ var handled_at = last_propagated_event === event && event[event_symbol];
2427
+ if (handled_at) {
2428
+ var at_idx = path.indexOf(handled_at);
2429
+ if (at_idx !== -1 && (handler_element === document || handler_element === /** @type {any} */
2430
+ window)) {
2431
+ event[event_symbol] = handler_element;
2432
+ return;
2433
+ }
2434
+ var handler_idx = path.indexOf(handler_element);
2435
+ if (handler_idx === -1) {
2436
+ return;
2437
+ }
2438
+ if (at_idx <= handler_idx) {
2439
+ path_idx = at_idx;
2440
+ }
2441
+ }
2442
+ current_target = /** @type {Element} */
2443
+ path[path_idx] || event.target;
2444
+ if (current_target === handler_element) return;
2445
+ define_property(event, "currentTarget", {
2446
+ configurable: true,
2447
+ get() {
2448
+ return current_target || owner_document;
2449
+ }
2450
+ });
2451
+ var previous_reaction = active_reaction;
2452
+ var previous_effect = active_effect;
2453
+ set_active_reaction(null);
2454
+ set_active_effect(null);
2455
+ try {
2456
+ var throw_error;
2457
+ var other_errors = [];
2458
+ while (current_target !== null) {
2459
+ var parent_element = current_target.assignedSlot || current_target.parentNode || /** @type {any} */
2460
+ current_target.host || null;
2461
+ try {
2462
+ var delegated = current_target[event_symbol]?.[event_name];
2463
+ if (delegated != null && (!/** @type {any} */
2464
+ current_target.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
2465
+ // -> the target could not have been disabled because it emits the event in the first place
2466
+ event.target === current_target)) {
2467
+ delegated.call(current_target, event);
2468
+ }
2469
+ } catch (error) {
2470
+ if (throw_error) {
2471
+ other_errors.push(error);
2472
+ } else {
2473
+ throw_error = error;
2474
+ }
2475
+ }
2476
+ if (event.cancelBubble || parent_element === handler_element || parent_element === null) {
2477
+ break;
2478
+ }
2479
+ current_target = parent_element;
2480
+ }
2481
+ if (throw_error) {
2482
+ for (let error of other_errors) {
2483
+ queueMicrotask(() => {
2484
+ throw error;
2485
+ });
2486
+ }
2487
+ throw throw_error;
2488
+ }
2489
+ } finally {
2490
+ event[event_symbol] = handler_element;
2491
+ delete event.currentTarget;
2492
+ set_active_reaction(previous_reaction);
2493
+ set_active_effect(previous_effect);
2494
+ }
2495
+ }
2496
+ function assign_nodes(start, end) {
2497
+ var effect = (
2498
+ /** @type {Effect} */
2499
+ active_effect
2500
+ );
2501
+ if (effect.nodes === null) {
2502
+ effect.nodes = { start, end, a: null, t: null };
2503
+ }
2504
+ }
2505
+ function mount(component, options) {
2506
+ return _mount(component, options);
2507
+ }
2508
+ function hydrate(component, options) {
2509
+ init_operations();
2510
+ options.intro = options.intro ?? false;
2511
+ const target = options.target;
2512
+ const was_hydrating = hydrating;
2513
+ const previous_hydrate_node = hydrate_node;
2514
+ try {
2515
+ var anchor = /* @__PURE__ */ get_first_child(target);
2516
+ while (anchor && (anchor.nodeType !== COMMENT_NODE || /** @type {Comment} */
2517
+ anchor.data !== HYDRATION_START)) {
2518
+ anchor = /* @__PURE__ */ get_next_sibling(anchor);
2519
+ }
2520
+ if (!anchor) {
2521
+ throw HYDRATION_ERROR;
2522
+ }
2523
+ set_hydrating(true);
2524
+ set_hydrate_node(
2525
+ /** @type {Comment} */
2526
+ anchor
2527
+ );
2528
+ const instance = _mount(component, { ...options, anchor });
2529
+ set_hydrating(false);
2530
+ return (
2531
+ /** @type {Exports} */
2532
+ instance
2533
+ );
2534
+ } catch (error) {
2535
+ if (error instanceof Error && error.message.split("\n").some((line) => line.startsWith("https://svelte.dev/e/"))) {
2536
+ throw error;
2537
+ }
2538
+ if (error !== HYDRATION_ERROR) {
2539
+ console.warn("Failed to hydrate: ", error);
2540
+ }
2541
+ if (options.recover === false) {
2542
+ hydration_failed();
2543
+ }
2544
+ init_operations();
2545
+ clear_text_content(target);
2546
+ set_hydrating(false);
2547
+ return mount(component, options);
2548
+ } finally {
2549
+ set_hydrating(was_hydrating);
2550
+ set_hydrate_node(previous_hydrate_node);
2551
+ }
2552
+ }
2553
+ const listeners = /* @__PURE__ */ new Map();
2554
+ function _mount(Component, { target, anchor, props = {}, events, context, intro = true, transformError }) {
2555
+ init_operations();
2556
+ var component = void 0;
2557
+ var unmount2 = component_root(() => {
2558
+ var anchor_node = anchor ?? target.appendChild(create_text());
2559
+ boundary(
2560
+ /** @type {TemplateNode} */
2561
+ anchor_node,
2562
+ {
2563
+ pending: () => {
2564
+ }
2565
+ },
2566
+ (anchor_node2) => {
2567
+ push({});
2568
+ var ctx = (
2569
+ /** @type {ComponentContext} */
2570
+ component_context
2571
+ );
2572
+ if (context) ctx.c = context;
2573
+ if (events) {
2574
+ props.$$events = events;
2575
+ }
2576
+ if (hydrating) {
2577
+ assign_nodes(
2578
+ /** @type {TemplateNode} */
2579
+ anchor_node2,
2580
+ null
2581
+ );
2582
+ }
2583
+ component = Component(anchor_node2, props) || {};
2584
+ if (hydrating) {
2585
+ active_effect.nodes.end = hydrate_node;
2586
+ if (hydrate_node === null || hydrate_node.nodeType !== COMMENT_NODE || /** @type {Comment} */
2587
+ hydrate_node.data !== HYDRATION_END) {
2588
+ hydration_mismatch();
2589
+ throw HYDRATION_ERROR;
2590
+ }
2591
+ }
2592
+ pop();
2593
+ },
2594
+ transformError
2595
+ );
2596
+ var registered_events = /* @__PURE__ */ new Set();
2597
+ var event_handle = (events2) => {
2598
+ for (var i = 0; i < events2.length; i++) {
2599
+ var event_name = events2[i];
2600
+ if (registered_events.has(event_name)) continue;
2601
+ registered_events.add(event_name);
2602
+ var passive = is_passive_event(event_name);
2603
+ for (const node of [target, document]) {
2604
+ var counts = listeners.get(node);
2605
+ if (counts === void 0) {
2606
+ counts = /* @__PURE__ */ new Map();
2607
+ listeners.set(node, counts);
2608
+ }
2609
+ var count = counts.get(event_name);
2610
+ if (count === void 0) {
2611
+ node.addEventListener(event_name, handle_event_propagation, { passive });
2612
+ counts.set(event_name, 1);
2613
+ } else {
2614
+ counts.set(event_name, count + 1);
2615
+ }
2616
+ }
2617
+ }
2618
+ };
2619
+ event_handle(array_from(all_registered_events));
2620
+ root_event_handles.add(event_handle);
2621
+ return () => {
2622
+ for (var event_name of registered_events) {
2623
+ for (const node of [target, document]) {
2624
+ var counts = (
2625
+ /** @type {Map<string, number>} */
2626
+ listeners.get(node)
2627
+ );
2628
+ var count = (
2629
+ /** @type {number} */
2630
+ counts.get(event_name)
2631
+ );
2632
+ if (--count == 0) {
2633
+ node.removeEventListener(event_name, handle_event_propagation);
2634
+ counts.delete(event_name);
2635
+ if (counts.size === 0) {
2636
+ listeners.delete(node);
2637
+ }
2638
+ } else {
2639
+ counts.set(event_name, count);
2640
+ }
2641
+ }
2642
+ }
2643
+ root_event_handles.delete(event_handle);
2644
+ if (anchor_node !== anchor) {
2645
+ anchor_node.parentNode?.removeChild(anchor_node);
2646
+ }
2647
+ };
2648
+ });
2649
+ mounted_components.set(component, unmount2);
2650
+ return component;
2651
+ }
2652
+ let mounted_components = /* @__PURE__ */ new WeakMap();
2653
+ function unmount(component, options) {
2654
+ const fn = mounted_components.get(component);
2655
+ if (fn) {
2656
+ mounted_components.delete(component);
2657
+ return fn(options);
2658
+ }
2659
+ return Promise.resolve();
2660
+ }
2661
+ function asClassComponent$1(component) {
2662
+ return class extends Svelte4Component {
2663
+ /** @param {any} options */
2664
+ constructor(options) {
2665
+ super({
2666
+ component,
2667
+ ...options
2668
+ });
2669
+ }
2670
+ };
2671
+ }
2672
+ class Svelte4Component {
2673
+ /** @type {any} */
2674
+ #events;
2675
+ /** @type {Record<string, any>} */
2676
+ #instance;
2677
+ /**
2678
+ * @param {ComponentConstructorOptions & {
2679
+ * component: any;
2680
+ * }} options
2681
+ */
2682
+ constructor(options) {
2683
+ var sources = /* @__PURE__ */ new Map();
2684
+ var add_source = (key, value) => {
2685
+ var s = /* @__PURE__ */ mutable_source(value, false, false);
2686
+ sources.set(key, s);
2687
+ return s;
2688
+ };
2689
+ const props = new Proxy(
2690
+ { ...options.props || {}, $$events: {} },
2691
+ {
2692
+ get(target, prop) {
2693
+ return get(sources.get(prop) ?? add_source(prop, Reflect.get(target, prop)));
2694
+ },
2695
+ has(target, prop) {
2696
+ if (prop === LEGACY_PROPS) return true;
2697
+ get(sources.get(prop) ?? add_source(prop, Reflect.get(target, prop)));
2698
+ return Reflect.has(target, prop);
2699
+ },
2700
+ set(target, prop, value) {
2701
+ set(sources.get(prop) ?? add_source(prop, value), value);
2702
+ return Reflect.set(target, prop, value);
2703
+ }
2704
+ }
2705
+ );
2706
+ this.#instance = (options.hydrate ? hydrate : mount)(options.component, {
2707
+ target: options.target,
2708
+ anchor: options.anchor,
2709
+ props,
2710
+ context: options.context,
2711
+ intro: options.intro ?? false,
2712
+ recover: options.recover,
2713
+ transformError: options.transformError
2714
+ });
2715
+ if (!options?.props?.$$host || options.sync === false) {
2716
+ flushSync();
2717
+ }
2718
+ this.#events = props.$$events;
2719
+ for (const key of Object.keys(this.#instance)) {
2720
+ if (key === "$set" || key === "$destroy" || key === "$on") continue;
2721
+ define_property(this, key, {
2722
+ get() {
2723
+ return this.#instance[key];
2724
+ },
2725
+ /** @param {any} value */
2726
+ set(value) {
2727
+ this.#instance[key] = value;
2728
+ },
2729
+ enumerable: true
2730
+ });
2731
+ }
2732
+ this.#instance.$set = /** @param {Record<string, any>} next */
2733
+ (next2) => {
2734
+ Object.assign(props, next2);
2735
+ };
2736
+ this.#instance.$destroy = () => {
2737
+ unmount(this.#instance);
2738
+ };
2739
+ }
2740
+ /** @param {Record<string, any>} props */
2741
+ $set(props) {
2742
+ this.#instance.$set(props);
2743
+ }
2744
+ /**
2745
+ * @param {string} event
2746
+ * @param {(...args: any[]) => any} callback
2747
+ * @returns {any}
2748
+ */
2749
+ $on(event, callback) {
2750
+ this.#events[event] = this.#events[event] || [];
2751
+ const cb = (...args) => callback.call(this, ...args);
2752
+ this.#events[event].push(cb);
2753
+ return () => {
2754
+ this.#events[event] = this.#events[event].filter(
2755
+ /** @param {any} fn */
2756
+ (fn) => fn !== cb
2757
+ );
2758
+ };
2759
+ }
2760
+ $destroy() {
2761
+ this.#instance.$destroy();
2762
+ }
2763
+ }
2764
+ function asClassComponent(component) {
2765
+ const component_constructor = asClassComponent$1(component);
2766
+ const _render = (props, { context, csp, transformError } = {}) => {
2767
+ const result = render(component, { props, context, csp, transformError });
2768
+ const munged = Object.defineProperties(
2769
+ /** @type {LegacyRenderResult & PromiseLike<LegacyRenderResult>} */
2770
+ {},
2771
+ {
2772
+ css: {
2773
+ value: { code: "", map: null }
2774
+ },
2775
+ head: {
2776
+ get: () => result.head
2777
+ },
2778
+ html: {
2779
+ get: () => result.body
2780
+ },
2781
+ then: {
2782
+ /**
2783
+ * this is not type-safe, but honestly it's the best I can do right now, and it's a straightforward function.
2784
+ *
2785
+ * @template TResult1
2786
+ * @template [TResult2=never]
2787
+ * @param { (value: LegacyRenderResult) => TResult1 } onfulfilled
2788
+ * @param { (reason: unknown) => TResult2 } onrejected
2789
+ */
2790
+ value: (onfulfilled, onrejected) => {
2791
+ {
2792
+ const user_result = onfulfilled({
2793
+ css: munged.css,
2794
+ head: munged.head,
2795
+ html: munged.html
2796
+ });
2797
+ return Promise.resolve(user_result);
2798
+ }
2799
+ }
2800
+ }
2801
+ }
2802
+ );
2803
+ return munged;
2804
+ };
2805
+ component_constructor.render = _render;
2806
+ return component_constructor;
2807
+ }
2808
+ function Root($$renderer, $$props) {
2809
+ $$renderer.component(($$renderer2) => {
2810
+ let {
2811
+ stores,
2812
+ page,
2813
+ constructors,
2814
+ components = [],
2815
+ form,
2816
+ data_0 = null,
2817
+ data_1 = null,
2818
+ data_2 = null
2819
+ } = $$props;
2820
+ {
2821
+ setContext("__svelte__", stores);
2822
+ }
2823
+ {
2824
+ stores.page.set(page);
2825
+ }
2826
+ const Pyramid_2 = derived(() => constructors[2]);
2827
+ if (constructors[1]) {
2828
+ $$renderer2.push("<!--[-->");
2829
+ const Pyramid_0 = constructors[0];
2830
+ if (Pyramid_0) {
2831
+ $$renderer2.push("<!--[-->");
2832
+ Pyramid_0($$renderer2, {
2833
+ data: data_0,
2834
+ form,
2835
+ params: page.params,
2836
+ children: ($$renderer3) => {
2837
+ if (constructors[2]) {
2838
+ $$renderer3.push("<!--[-->");
2839
+ const Pyramid_1 = constructors[1];
2840
+ if (Pyramid_1) {
2841
+ $$renderer3.push("<!--[-->");
2842
+ Pyramid_1($$renderer3, {
2843
+ data: data_1,
2844
+ form,
2845
+ params: page.params,
2846
+ children: ($$renderer4) => {
2847
+ if (Pyramid_2()) {
2848
+ $$renderer4.push("<!--[-->");
2849
+ Pyramid_2()($$renderer4, { data: data_2, form, params: page.params });
2850
+ $$renderer4.push("<!--]-->");
2851
+ } else {
2852
+ $$renderer4.push("<!--[!-->");
2853
+ $$renderer4.push("<!--]-->");
2854
+ }
2855
+ },
2856
+ $$slots: { default: true }
2857
+ });
2858
+ $$renderer3.push("<!--]-->");
2859
+ } else {
2860
+ $$renderer3.push("<!--[!-->");
2861
+ $$renderer3.push("<!--]-->");
2862
+ }
2863
+ } else {
2864
+ $$renderer3.push("<!--[!-->");
2865
+ const Pyramid_1 = constructors[1];
2866
+ if (Pyramid_1) {
2867
+ $$renderer3.push("<!--[-->");
2868
+ Pyramid_1($$renderer3, { data: data_1, form, params: page.params });
2869
+ $$renderer3.push("<!--]-->");
2870
+ } else {
2871
+ $$renderer3.push("<!--[!-->");
2872
+ $$renderer3.push("<!--]-->");
2873
+ }
2874
+ }
2875
+ $$renderer3.push(`<!--]-->`);
2876
+ },
2877
+ $$slots: { default: true }
2878
+ });
2879
+ $$renderer2.push("<!--]-->");
2880
+ } else {
2881
+ $$renderer2.push("<!--[!-->");
2882
+ $$renderer2.push("<!--]-->");
2883
+ }
2884
+ } else {
2885
+ $$renderer2.push("<!--[!-->");
2886
+ const Pyramid_0 = constructors[0];
2887
+ if (Pyramid_0) {
2888
+ $$renderer2.push("<!--[-->");
2889
+ Pyramid_0($$renderer2, { data: data_0, form, params: page.params });
2890
+ $$renderer2.push("<!--]-->");
2891
+ } else {
2892
+ $$renderer2.push("<!--[!-->");
2893
+ $$renderer2.push("<!--]-->");
2894
+ }
2895
+ }
2896
+ $$renderer2.push(`<!--]--> `);
2897
+ {
2898
+ $$renderer2.push("<!--[!-->");
2899
+ }
2900
+ $$renderer2.push(`<!--]-->`);
2901
+ });
2902
+ }
2903
+ const root = asClassComponent(Root);
2904
+
2905
+ export { DEV as D, base64_encode as a, base64_decode as b, disable_search as c, decode_pathname as d, decode_params as e, text_encoder as f, get_request_store as g, resolve as h, get_relative_path as i, make_trackable as m, normalize_path as n, root as r, safe_not_equal as s, text_decoder as t, with_request_store as w };
2906
+ //# sourceMappingURL=root-C5lyo0VT.js.map