@absolutejs/absolute 0.19.0-beta.807 → 0.19.0-beta.809

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 (260) hide show
  1. package/dist/angular/browser.js +9801 -57
  2. package/dist/angular/browser.js.map +246 -4
  3. package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
  4. package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
  5. package/dist/angular/index.js +14877 -60
  6. package/dist/angular/index.js.map +281 -4
  7. package/dist/angular/server.js +5610 -45
  8. package/dist/angular/server.js.map +51 -3
  9. package/dist/build.js +18092 -45
  10. package/dist/build.js.map +99 -3
  11. package/dist/cli/index.js +317 -86
  12. package/dist/client/index.js +1091 -70
  13. package/dist/client/index.js.map +24 -4
  14. package/dist/core/streamingSlotRegistrar.js +108 -11
  15. package/dist/core/streamingSlotRegistrar.js.map +4 -3
  16. package/dist/core/streamingSlotRegistry.js +169 -7
  17. package/dist/core/streamingSlotRegistry.js.map +5 -3
  18. package/dist/index.js +19957 -547
  19. package/dist/index.js.map +116 -3
  20. package/dist/islands/browser.js +228 -9
  21. package/dist/islands/browser.js.map +9 -4
  22. package/dist/islands/index.js +1908 -17
  23. package/dist/islands/index.js.map +27 -3
  24. package/dist/react/browser.js +328 -12
  25. package/dist/react/browser.js.map +12 -4
  26. package/dist/react/components/index.js +167 -16
  27. package/dist/react/components/index.js.map +6 -3
  28. package/dist/react/hooks/index.js +183 -8
  29. package/dist/react/hooks/index.js.map +7 -3
  30. package/dist/react/index.js +3627 -36
  31. package/dist/react/index.js.map +45 -4
  32. package/dist/react/jsxDevRuntimeCompat.js +61 -2
  33. package/dist/react/jsxDevRuntimeCompat.js.map +2 -2
  34. package/dist/react/server.js +1789 -18
  35. package/dist/react/server.js.map +21 -3
  36. package/dist/src/angular/injectorPatch.d.ts +1 -0
  37. package/dist/src/angular/islands.d.ts +1 -0
  38. package/dist/src/client/hydrators/react.d.ts +3 -0
  39. package/dist/src/client/hydrators/svelte.d.ts +2 -0
  40. package/dist/src/client/hydrators/vue.d.ts +2 -0
  41. package/dist/src/index.d.ts +1 -0
  42. package/dist/svelte/browser.js +247 -12
  43. package/dist/svelte/browser.js.map +10 -3
  44. package/dist/svelte/index.js +3732 -37
  45. package/dist/svelte/index.js.map +47 -4
  46. package/dist/svelte/server.js +2794 -21
  47. package/dist/svelte/server.js.map +27 -3
  48. package/dist/vue/browser.js +348 -12
  49. package/dist/vue/browser.js.map +12 -4
  50. package/dist/vue/components/Image.js +240 -7
  51. package/dist/vue/components/Image.js.map +6 -3
  52. package/dist/vue/components/index.js +544 -11
  53. package/dist/vue/components/index.js.map +9 -3
  54. package/dist/vue/index.js +4212 -52
  55. package/dist/vue/index.js.map +50 -4
  56. package/dist/vue/server.js +1849 -18
  57. package/dist/vue/server.js.map +21 -3
  58. package/package.json +1 -1
  59. package/dist/chunk-0867j0r0.js +0 -136
  60. package/dist/chunk-0867j0r0.js.map +0 -10
  61. package/dist/chunk-102fp7xe.js +0 -63
  62. package/dist/chunk-102fp7xe.js.map +0 -10
  63. package/dist/chunk-11zpfqz6.js +0 -19
  64. package/dist/chunk-11zpfqz6.js.map +0 -10
  65. package/dist/chunk-1rfh7hw9.js +0 -319
  66. package/dist/chunk-1rfh7hw9.js.map +0 -11
  67. package/dist/chunk-1x4fxm57.js +0 -51
  68. package/dist/chunk-1x4fxm57.js.map +0 -9
  69. package/dist/chunk-25v9t56f.js +0 -29
  70. package/dist/chunk-25v9t56f.js.map +0 -11
  71. package/dist/chunk-2f21eenc.js +0 -21
  72. package/dist/chunk-2f21eenc.js.map +0 -10
  73. package/dist/chunk-2ga2znex.js +0 -13
  74. package/dist/chunk-2ga2znex.js.map +0 -9
  75. package/dist/chunk-30yrw0f6.js +0 -33
  76. package/dist/chunk-30yrw0f6.js.map +0 -10
  77. package/dist/chunk-3g91wb4f.js +0 -358
  78. package/dist/chunk-3g91wb4f.js.map +0 -10
  79. package/dist/chunk-3rea1gam.js +0 -4403
  80. package/dist/chunk-3rea1gam.js.map +0 -28
  81. package/dist/chunk-3yjzpcne.js +0 -34
  82. package/dist/chunk-3yjzpcne.js.map +0 -10
  83. package/dist/chunk-41bf6aqt.js +0 -17
  84. package/dist/chunk-41bf6aqt.js.map +0 -9
  85. package/dist/chunk-4d39r92n.js +0 -81
  86. package/dist/chunk-4d39r92n.js.map +0 -10
  87. package/dist/chunk-5003emhv.js +0 -17
  88. package/dist/chunk-5003emhv.js.map +0 -10
  89. package/dist/chunk-5f67rsed.js +0 -466
  90. package/dist/chunk-5f67rsed.js.map +0 -10
  91. package/dist/chunk-5fhp1jap.js +0 -9169
  92. package/dist/chunk-5fhp1jap.js.map +0 -236
  93. package/dist/chunk-629x0yh4.js +0 -20
  94. package/dist/chunk-629x0yh4.js.map +0 -9
  95. package/dist/chunk-6pdj08z3.js +0 -73
  96. package/dist/chunk-6pdj08z3.js.map +0 -12
  97. package/dist/chunk-6qjbrt0k.js +0 -13
  98. package/dist/chunk-6qjbrt0k.js.map +0 -9
  99. package/dist/chunk-6sccb4jr.js +0 -14
  100. package/dist/chunk-6sccb4jr.js.map +0 -9
  101. package/dist/chunk-798spvzv.js +0 -50
  102. package/dist/chunk-798spvzv.js.map +0 -10
  103. package/dist/chunk-7fw6x3js.js +0 -131
  104. package/dist/chunk-7fw6x3js.js.map +0 -11
  105. package/dist/chunk-7kjj42xm.js +0 -11
  106. package/dist/chunk-7kjj42xm.js.map +0 -10
  107. package/dist/chunk-7mtstdqn.js +0 -90
  108. package/dist/chunk-7mtstdqn.js.map +0 -10
  109. package/dist/chunk-851whwc7.js +0 -17
  110. package/dist/chunk-851whwc7.js.map +0 -10
  111. package/dist/chunk-85n68sy6.js +0 -103
  112. package/dist/chunk-85n68sy6.js.map +0 -10
  113. package/dist/chunk-8kcfffry.js +0 -35
  114. package/dist/chunk-8kcfffry.js.map +0 -10
  115. package/dist/chunk-92fsjfpp.js +0 -1731
  116. package/dist/chunk-92fsjfpp.js.map +0 -11
  117. package/dist/chunk-93sqk7be.js +0 -139
  118. package/dist/chunk-93sqk7be.js.map +0 -12
  119. package/dist/chunk-9c5tj4k3.js +0 -130
  120. package/dist/chunk-9c5tj4k3.js.map +0 -10
  121. package/dist/chunk-9j59emg3.js +0 -184
  122. package/dist/chunk-9j59emg3.js.map +0 -11
  123. package/dist/chunk-9ve9jq72.js +0 -203
  124. package/dist/chunk-9ve9jq72.js.map +0 -10
  125. package/dist/chunk-9xrsjeem.js +0 -12
  126. package/dist/chunk-9xrsjeem.js.map +0 -9
  127. package/dist/chunk-a9mvyp04.js +0 -87
  128. package/dist/chunk-a9mvyp04.js.map +0 -10
  129. package/dist/chunk-b3gbnrwe.js +0 -21
  130. package/dist/chunk-b3gbnrwe.js.map +0 -10
  131. package/dist/chunk-bgb8k1qs.js +0 -672
  132. package/dist/chunk-bgb8k1qs.js.map +0 -15
  133. package/dist/chunk-bmgqm774.js +0 -65
  134. package/dist/chunk-bmgqm774.js.map +0 -9
  135. package/dist/chunk-bxfghpma.js +0 -69
  136. package/dist/chunk-bxfghpma.js.map +0 -10
  137. package/dist/chunk-c1jfjnka.js +0 -74
  138. package/dist/chunk-c1jfjnka.js.map +0 -10
  139. package/dist/chunk-cbkrwmvh.js +0 -80
  140. package/dist/chunk-cbkrwmvh.js.map +0 -10
  141. package/dist/chunk-cdxd7sy2.js +0 -71
  142. package/dist/chunk-cdxd7sy2.js.map +0 -10
  143. package/dist/chunk-cg95827x.js +0 -21
  144. package/dist/chunk-cg95827x.js.map +0 -10
  145. package/dist/chunk-cm0g4q6w.js +0 -149
  146. package/dist/chunk-cm0g4q6w.js.map +0 -10
  147. package/dist/chunk-d7mwkzry.js +0 -261
  148. package/dist/chunk-d7mwkzry.js.map +0 -10
  149. package/dist/chunk-d9c0am65.js +0 -12
  150. package/dist/chunk-d9c0am65.js.map +0 -10
  151. package/dist/chunk-daqghmg8.js +0 -12
  152. package/dist/chunk-daqghmg8.js.map +0 -9
  153. package/dist/chunk-e3r9fxaa.js +0 -149
  154. package/dist/chunk-e3r9fxaa.js.map +0 -10
  155. package/dist/chunk-e8eecyrq.js +0 -244
  156. package/dist/chunk-e8eecyrq.js.map +0 -10
  157. package/dist/chunk-ex2hxe0v.js +0 -160
  158. package/dist/chunk-ex2hxe0v.js.map +0 -11
  159. package/dist/chunk-fak944et.js +0 -91
  160. package/dist/chunk-fak944et.js.map +0 -10
  161. package/dist/chunk-fygx2ymm.js +0 -118
  162. package/dist/chunk-fygx2ymm.js.map +0 -12
  163. package/dist/chunk-g15qj669.js +0 -271
  164. package/dist/chunk-g15qj669.js.map +0 -11
  165. package/dist/chunk-gd6wmknh.js +0 -121
  166. package/dist/chunk-gd6wmknh.js.map +0 -11
  167. package/dist/chunk-gf0ygptk.js +0 -85
  168. package/dist/chunk-gf0ygptk.js.map +0 -11
  169. package/dist/chunk-gytkmthr.js +0 -220
  170. package/dist/chunk-gytkmthr.js.map +0 -10
  171. package/dist/chunk-h5bbfn3n.js +0 -28
  172. package/dist/chunk-h5bbfn3n.js.map +0 -11
  173. package/dist/chunk-h6mye9r3.js +0 -93
  174. package/dist/chunk-h6mye9r3.js.map +0 -10
  175. package/dist/chunk-hcsmxw1v.js +0 -85
  176. package/dist/chunk-hcsmxw1v.js.map +0 -10
  177. package/dist/chunk-hyjs4bqs.js +0 -8
  178. package/dist/chunk-hyjs4bqs.js.map +0 -10
  179. package/dist/chunk-jn91vzkh.js +0 -66
  180. package/dist/chunk-jn91vzkh.js.map +0 -10
  181. package/dist/chunk-jpkjdgsk.js +0 -167
  182. package/dist/chunk-jpkjdgsk.js.map +0 -11
  183. package/dist/chunk-jwxt8gnp.js +0 -13
  184. package/dist/chunk-jwxt8gnp.js.map +0 -9
  185. package/dist/chunk-kk8w9rh5.js +0 -195
  186. package/dist/chunk-kk8w9rh5.js.map +0 -10
  187. package/dist/chunk-kwgh8rmg.js +0 -426
  188. package/dist/chunk-kwgh8rmg.js.map +0 -14
  189. package/dist/chunk-m97ze5hz.js +0 -46
  190. package/dist/chunk-m97ze5hz.js.map +0 -10
  191. package/dist/chunk-mbazhahf.js +0 -60
  192. package/dist/chunk-mbazhahf.js.map +0 -10
  193. package/dist/chunk-mgfwq18r.js +0 -15
  194. package/dist/chunk-mgfwq18r.js.map +0 -9
  195. package/dist/chunk-mtgf69xn.js +0 -88
  196. package/dist/chunk-mtgf69xn.js.map +0 -10
  197. package/dist/chunk-mtxzyxpg.js +0 -102
  198. package/dist/chunk-mtxzyxpg.js.map +0 -10
  199. package/dist/chunk-nehhtthw.js +0 -225
  200. package/dist/chunk-nehhtthw.js.map +0 -10
  201. package/dist/chunk-p5504p14.js +0 -16
  202. package/dist/chunk-p5504p14.js.map +0 -10
  203. package/dist/chunk-p5zgj77m.js +0 -184
  204. package/dist/chunk-p5zgj77m.js.map +0 -10
  205. package/dist/chunk-pnscgw95.js +0 -90
  206. package/dist/chunk-pnscgw95.js.map +0 -10
  207. package/dist/chunk-pvpp4pvs.js +0 -17
  208. package/dist/chunk-pvpp4pvs.js.map +0 -10
  209. package/dist/chunk-qh75agse.js +0 -95
  210. package/dist/chunk-qh75agse.js.map +0 -10
  211. package/dist/chunk-qxq2zcty.js +0 -52
  212. package/dist/chunk-qxq2zcty.js.map +0 -10
  213. package/dist/chunk-r6e8pytx.js +0 -22
  214. package/dist/chunk-r6e8pytx.js.map +0 -9
  215. package/dist/chunk-r7jmgqnw.js +0 -114
  216. package/dist/chunk-r7jmgqnw.js.map +0 -10
  217. package/dist/chunk-s6defjk2.js +0 -116
  218. package/dist/chunk-s6defjk2.js.map +0 -10
  219. package/dist/chunk-sd39p726.js +0 -619
  220. package/dist/chunk-sd39p726.js.map +0 -10
  221. package/dist/chunk-swrnzs4c.js +0 -63
  222. package/dist/chunk-swrnzs4c.js.map +0 -10
  223. package/dist/chunk-tfe3sb44.js +0 -33
  224. package/dist/chunk-tfe3sb44.js.map +0 -10
  225. package/dist/chunk-tjr0kcev.js +0 -41
  226. package/dist/chunk-tjr0kcev.js.map +0 -9
  227. package/dist/chunk-tx9edm1x.js +0 -34
  228. package/dist/chunk-tx9edm1x.js.map +0 -10
  229. package/dist/chunk-txhm2vb5.js +0 -18
  230. package/dist/chunk-txhm2vb5.js.map +0 -9
  231. package/dist/chunk-v5vmsxmy.js +0 -526
  232. package/dist/chunk-v5vmsxmy.js.map +0 -12
  233. package/dist/chunk-vjhxm8n2.js +0 -29
  234. package/dist/chunk-vjhxm8n2.js.map +0 -9
  235. package/dist/chunk-vkrpm7kc.js +0 -247
  236. package/dist/chunk-vkrpm7kc.js.map +0 -12
  237. package/dist/chunk-w3m4m5we.js +0 -4925
  238. package/dist/chunk-w3m4m5we.js.map +0 -12
  239. package/dist/chunk-wrxtn9ve.js +0 -18
  240. package/dist/chunk-wrxtn9ve.js.map +0 -10
  241. package/dist/chunk-x09cskqd.js +0 -377
  242. package/dist/chunk-x09cskqd.js.map +0 -10
  243. package/dist/chunk-xnt8c6h2.js +0 -576
  244. package/dist/chunk-xnt8c6h2.js.map +0 -10
  245. package/dist/chunk-xw0tx842.js +0 -13
  246. package/dist/chunk-xw0tx842.js.map +0 -9
  247. package/dist/chunk-xx5b6b9m.js +0 -69
  248. package/dist/chunk-xx5b6b9m.js.map +0 -10
  249. package/dist/chunk-xz1kdswj.js +0 -21
  250. package/dist/chunk-xz1kdswj.js.map +0 -9
  251. package/dist/chunk-y84qnsd3.js +0 -32
  252. package/dist/chunk-y84qnsd3.js.map +0 -10
  253. package/dist/chunk-ywjn0rad.js +0 -14
  254. package/dist/chunk-ywjn0rad.js.map +0 -9
  255. package/dist/chunk-z9nvhm6r.js +0 -13
  256. package/dist/chunk-z9nvhm6r.js.map +0 -9
  257. package/dist/chunk-zhmvdpk6.js +0 -15
  258. package/dist/chunk-zhmvdpk6.js.map +0 -9
  259. package/dist/chunk-zrg9d4zw.js +0 -784
  260. package/dist/chunk-zrg9d4zw.js.map +0 -10
@@ -1,11 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/plugins/hmr.ts", "../src/react/bridgeInternals.ts"],
4
- "sourcesContent": [
5
- "import Elysia from 'elysia';\nimport { UNFOUND_INDEX } from '../constants';\nimport type { HMRState } from '../dev/clientManager';\nimport { getMimeType, lookupAsset } from '../dev/assetStore';\nimport { bridgeReactInternals } from '../react/bridgeInternals';\nimport {\n\thandleClientConnect,\n\thandleClientDisconnect,\n\thandleHMRMessage\n} from '../dev/webSocket';\n\nconst STORE_KEY = '__elysiaStore';\n\n/* Preserve Elysia store across bun --hot reloads.\n globalThis survives re-evaluation, so we save the store reference\n before each reload and restore values into the fresh instance. */\nconst getGlobalValue = (key: string) => Reflect.get(globalThis, key);\n\nconst restoreStore = (store: unknown) => {\n\tconst saved = getGlobalValue(STORE_KEY);\n\n\tif (saved && typeof saved === 'object') {\n\t\trestoreSavedStoreValues(store, saved);\n\t}\n\n\tif (store && typeof store === 'object') {\n\t\tReflect.set(globalThis, STORE_KEY, store);\n\t}\n};\n\nconst restoreSavedStoreValues = (store: unknown, saved: object) => {\n\tif (!store || typeof store !== 'object') {\n\t\treturn;\n\t}\n\n\tObject.entries(saved).forEach(([key, value]) => {\n\t\tReflect.set(store, key, value);\n\t});\n};\n\nconst resolveModuleResponse = (\n\tmoduleResponse: Response,\n\tifNoneMatch: string | null\n) => {\n\tconst etag = moduleResponse.headers.get('ETag');\n\n\tif (etag && ifNoneMatch === etag) {\n\t\treturn new Response(null, { headers: { ETag: etag }, status: 304 });\n\t}\n\n\treturn moduleResponse;\n};\n\nconst resolveRequestPathname = (request: Request) => {\n\tconst rawUrl = request.url;\n\tconst qIdx = rawUrl.indexOf('?');\n\tconst pathEnd = qIdx === UNFOUND_INDEX ? rawUrl.length : qIdx;\n\tconst pathStart = rawUrl.indexOf('/', rawUrl.indexOf('//') + 2);\n\n\treturn rawUrl.slice(pathStart, pathEnd);\n};\n\nconst resolveDevAssetResponse = async (\n\trequest: Request,\n\thmrState: HMRState,\n\tmoduleServerHandler?: (\n\t\tpathname: string\n\t) => Promise<Response | undefined> | Response | undefined\n) => {\n\tconst pathname = resolveRequestPathname(request);\n\n\tif (moduleServerHandler) {\n\t\tconst moduleResponse = await moduleServerHandler(pathname);\n\n\t\tif (moduleResponse) {\n\t\t\treturn resolveModuleResponse(\n\t\t\t\tmoduleResponse,\n\t\t\t\trequest.headers.get('If-None-Match')\n\t\t\t);\n\t\t}\n\t\t// Fall through: moduleServerHandler only handles /@src/, /@stub/,\n\t\t// /@hmr/ prefixes. Other paths (like /generated/indexes/<hash>.js\n\t\t// emitted by HMR rebuilds) need to be served from the asset store —\n\t\t// the upstream `staticPlugin({ alwaysStatic: true })` only registers\n\t\t// files that existed at server start, so HMR-emitted chunks aren't\n\t\t// in those routes.\n\t}\n\n\tconst bytes = lookupAsset(hmrState.assetStore, pathname);\n\tif (bytes) {\n\t\treturn new Response(new Uint8Array(bytes).buffer, {\n\t\t\theaders: {\n\t\t\t\t'Cache-Control': 'no-cache',\n\t\t\t\t'Content-Type': getMimeType(pathname)\n\t\t\t}\n\t\t});\n\t}\n\n\t// Fallback for hashless asset URLs like `/indexes/less-page` (no `.css`,\n\t// no hash). These can show up briefly when an HMR client tracks a\n\t// stylesheet by base name and the hash rotated between when the link\n\t// was rendered and when the request was issued. Redirect to the current\n\t// hashed path so the browser still gets the right CSS instead of a 404.\n\tconst aliasedTarget = resolveHashlessAlias(hmrState, pathname);\n\tif (aliasedTarget) {\n\t\treturn new Response(null, {\n\t\t\theaders: {\n\t\t\t\t'Cache-Control': 'no-cache',\n\t\t\t\tLocation: aliasedTarget\n\t\t\t},\n\t\t\tstatus: 302\n\t\t});\n\t}\n\n\treturn undefined;\n};\n\nconst HASHLESS_INDEX_PATH_PATTERN = /^(\\/[^/]+)?\\/indexes\\/([^/.]+)\\/?$/;\n\n/* If the pathname looks like `/indexes/<base>` (or `/<framework>/indexes/<base>`)\n with no extension, look for an asset whose path prefix matches and return\n that path. Returns null if there's no match — caller falls back to 404. */\nconst resolveHashlessAlias = (hmrState: HMRState, pathname: string) => {\n\tconst match = pathname.match(HASHLESS_INDEX_PATH_PATTERN);\n\tif (!match) return null;\n\tconst prefix = `${match[1] ?? ''}/indexes/${match[2]}.`;\n\tfor (const candidate of hmrState.assetStore.keys()) {\n\t\tif (candidate.startsWith(prefix)) return candidate;\n\t}\n\n\treturn null;\n};\n\n/* HMR plugin for Elysia\n Adds WebSocket endpoint and status endpoint.\n HMR client code is baked into framework index files (React/Svelte/Vue)\n and injected into HTML/HTMX files at build time.\n Also preserves Elysia store state across hot reloads. */\nexport const hmr = (\n\thmrState: HMRState,\n\tmanifest: Record<string, string>,\n\tmoduleServerHandler?: (\n\t\tpathname: string\n\t) => Promise<Response | undefined> | Response | undefined\n) =>\n\tnew Elysia({ name: 'absolutejs-hmr' })\n\t\t.onStart(({ store }) => {\n\t\t\trestoreStore(store);\n\t\t})\n\t\t// In HTTP/2 mode, WebSocket is handled by the http2Bridge\n\t\t// so we skip Elysia's .ws() registration\n\t\t// `onRequest` (not `onBeforeHandle`) is required: HMR-emitted chunks\n\t\t// like /generated/indexes/<hash>.js have no matching Elysia route\n\t\t// (the upstream `staticPlugin({ alwaysStatic })` only registers\n\t\t// files that existed at server start, so anything emitted by HMR\n\t\t// later is unrouted). `onBeforeHandle` only fires when a route\n\t\t// matches, so it would never see those requests; `onRequest` fires\n\t\t// before routing and lets us serve them from the asset store.\n\t\t.onRequest(async ({ request }) => {\n\t\t\t// Bridge React internals if bun install created a duplicate instance.\n\t\t\t// Runs before any route handler so page handlers stay clean.\n\t\t\tif (globalThis.__reactModuleRef) {\n\t\t\t\tawait bridgeReactInternals();\n\t\t\t}\n\n\t\t\t/* Fast path: only parse URL for requests that could be assets.\n\t\t\t\t Asset paths always start with / and contain a dot (extension).\n\t\t\t\t Skip API routes, WebSocket upgrades, and page navigations. */\n\t\t\treturn resolveDevAssetResponse(\n\t\t\t\trequest,\n\t\t\t\thmrState,\n\t\t\t\tmoduleServerHandler\n\t\t\t);\n\t\t})\n\t\t.get('/@src/*', ({ request }) =>\n\t\t\tresolveDevAssetResponse(request, hmrState, moduleServerHandler)\n\t\t)\n\t\t.get('/@stub/*', ({ request }) =>\n\t\t\tresolveDevAssetResponse(request, hmrState, moduleServerHandler)\n\t\t)\n\t\t.get('/@hmr/*', ({ request }) =>\n\t\t\tresolveDevAssetResponse(request, hmrState, moduleServerHandler)\n\t\t)\n\t\t// Always register WebSocket for HMR. When HTTP/2 bridge is\n\t\t// fully implemented it can take over, but Elysia's native\n\t\t// WebSocket works fine over both HTTP and HTTPS.\n\t\t.ws('/hmr', {\n\t\t\tclose: (ws) => handleClientDisconnect(hmrState, ws),\n\t\t\tmessage: (ws, msg) => handleHMRMessage(hmrState, ws, msg),\n\t\t\topen: (ws) => handleClientConnect(hmrState, ws, manifest)\n\t\t})\n\t\t.get('/hmr-status', () => ({\n\t\t\tconnectedClients: hmrState.connectedClients.size,\n\t\t\tisRebuilding: hmrState.isRebuilding,\n\t\t\tmanifestKeys: Object.keys(manifest),\n\t\t\trebuildCount: hmrState.rebuildCount,\n\t\t\trebuildQueue: Array.from(hmrState.rebuildQueue),\n\t\t\ttimestamp: Date.now()\n\t\t}));\n",
6
- "/**\n * After `bun install` adds new packages, Bun's module cache can resolve\n * `react` to a new instance while `react-dom/server` still holds the original.\n * The two copies have separate shared-internals objects, so the hook dispatcher\n * set by react-dom is invisible to hooks in user components — \"Invalid hook call\".\n *\n * This bridges the new React's internals to the pinned (original) instance via\n * property descriptors so both share one dispatcher.\n *\n * React 19 renamed the internals key from\n * `__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED` to\n * `__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE`.\n * We try both so the fix works across versions.\n */\nconst INTERNALS_KEYS = [\n\t'__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE',\n\t'__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED'\n] as const;\n\nconst isRecord = (val: unknown): val is Record<string, unknown> =>\n\ttypeof val === 'object' && val !== null;\n\nconst findInternals = (mod: Record<string, unknown>) => {\n\tfor (const key of INTERNALS_KEYS) {\n\t\tconst val = mod[key];\n\t\tif (isRecord(val)) return val;\n\t}\n\n\treturn undefined;\n};\n\nexport const bridgeReactInternals = async () => {\n\tconst pinnedRef = globalThis.__reactModuleRef;\n\tif (!isRecord(pinnedRef)) return;\n\n\tconst react: Record<string, unknown> = await import('react');\n\tif (pinnedRef === react) return;\n\n\tconst pinnedInternals = findInternals(pinnedRef);\n\tconst currentInternals = findInternals(react);\n\n\tif (\n\t\t!pinnedInternals ||\n\t\t!currentInternals ||\n\t\tpinnedInternals === currentInternals\n\t)\n\t\treturn;\n\n\tfor (const prop of Object.keys(pinnedInternals)) {\n\t\tObject.defineProperty(currentInternals, prop, {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: true,\n\t\t\tget() {\n\t\t\t\treturn pinnedInternals[prop];\n\t\t\t},\n\t\t\tset(value: unknown) {\n\t\t\t\tpinnedInternals[prop] = value;\n\t\t\t}\n\t\t});\n\t}\n};\n"
7
- ],
8
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;;;ACcA,IAAM,iBAAiB;AAAA,EACtB;AAAA,EACA;AACD;AAEA,IAAM,WAAW,CAAC,QACjB,OAAO,QAAQ,YAAY,QAAQ;AAEpC,IAAM,gBAAgB,CAAC,QAAiC;AAAA,EACvD,WAAW,OAAO,gBAAgB;AAAA,IACjC,MAAM,MAAM,IAAI;AAAA,IAChB,IAAI,SAAS,GAAG;AAAA,MAAG,OAAO;AAAA,EAC3B;AAAA,EAEA;AAAA;AAGM,IAAM,uBAAuB,YAAY;AAAA,EAC/C,MAAM,YAAY,WAAW;AAAA,EAC7B,IAAI,CAAC,SAAS,SAAS;AAAA,IAAG;AAAA,EAE1B,MAAM,QAAiC,MAAa;AAAA,EACpD,IAAI,cAAc;AAAA,IAAO;AAAA,EAEzB,MAAM,kBAAkB,cAAc,SAAS;AAAA,EAC/C,MAAM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AW,aAAa,SAAS,WAAW,KAAK,GAAG;AAAA,IACnD,IAAI,UAAU,WAAW,MAAM;AAAA,MAAG,OAAO;AAAA,EAC1C;AAAA,EAEA,OAAO;AAAA;AAQD,IAAM,MAAM,CAClB,UACA,UACA,wBAIA,IAAI,OAAO,EAAE,MAAM,iBAAiB,CAAC,EACnC,QAAQ,GAAG,YAAY;AAAA,EACvB,aAAa,KAAK;AAAA,CAClB,EAUA,UAAU,SAAS,cAAc;AAAA,EAGjC,IAAI,WAAW,kBAAkB;AAAA,IAChC,MAAM,qBAAqB;AAAA,EAC5B;AAAA,EAKA,OAAO,wBACN,SACA,UACA,mBACD;AAAA,CACA,EACA,IAAI,WAAW,GAAG,cAClB,wBAAwB,SAAS,UAAU,mBAAmB,CAC/D,EACC,IAAI,YAAY,GAAG,cACnB,wBAAwB,SAAS,UAAU,mBAAmB,CAC/D,EACC,IAAI,WAAW,GAAG,cAClB,wBAAwB,SAAS,UAAU,mBAAmB,CAC/D,EAIC,GAAG,QAAQ;AAAA,EACX,OAAO,CAAC,OAAO,uBAAuB,UAAU,EAAE;AAAA,EAClD,SAAS,CAAC,IAAI,QAAQ,iBAAiB,UAAU,IAAI,GAAG;AAAA,EACxD,MAAM,CAAC,OAAO,oBAAoB,UAAU,IAAI,QAAQ;AACzD,CAAC,EACA,IAAI,eAAe,OAAO;AAAA,EAC1B,kBAAkB,SAAS,iBAAiB;AAAA,EAC5C,cAAc,SAAS;AAAA,EACvB,cAAc,OAAO,KAAK,QAAQ;AAAA,EAClC,cAAc,SAAS;AAAA,EACvB,cAAc,MAAM,KAAK,SAAS,YAAY;AAAA,EAC9C,WAAW,KAAK,IAAI;AACrB,EAAE;",
9
- "debugId": "4B480B1E52FA111664756E2164756E21",
10
- "names": []
11
- }
@@ -1,91 +0,0 @@
1
- // @bun
2
- import {
3
- getIslandMarkerAttributes
4
- } from "./chunk-2f21eenc.js";
5
-
6
- // src/client/preserveIslandMarkup.ts
7
- var getClaimMap = () => {
8
- if (typeof window === "undefined") {
9
- return null;
10
- }
11
- window.__ABS_CLAIMED_ISLAND_MARKUP__ ??= new Map;
12
- return window.__ABS_CLAIMED_ISLAND_MARKUP__;
13
- };
14
- var getSnapshotMap = () => {
15
- if (typeof window === "undefined") {
16
- return null;
17
- }
18
- window.__ABS_SERVER_ISLAND_HTML__ ??= new Map;
19
- return window.__ABS_SERVER_ISLAND_HTML__;
20
- };
21
- var getIslandSignature = (props) => {
22
- const attributes = getIslandMarkerAttributes(props);
23
- return [
24
- attributes["data-component"],
25
- attributes["data-framework"],
26
- attributes["data-hydrate"],
27
- attributes["data-props"]
28
- ].join("::");
29
- };
30
- var isMatchingIslandElement = (element, props) => {
31
- if (!(element instanceof HTMLElement)) {
32
- return false;
33
- }
34
- const attributes = getIslandMarkerAttributes(props);
35
- return element.dataset.island === "true" && element.dataset.component === attributes["data-component"] && element.dataset.framework === attributes["data-framework"] && (element.dataset.hydrate ?? "load") === attributes["data-hydrate"] && (element.dataset.props ?? "{}") === attributes["data-props"];
36
- };
37
- var snapshotIslandElement = (element, snapshotMap) => {
38
- const signature = [
39
- element.dataset.component,
40
- element.dataset.framework,
41
- element.dataset.hydrate ?? "load",
42
- element.dataset.props ?? "{}"
43
- ].join("::");
44
- const existing = snapshotMap.get(signature) ?? [];
45
- const attributes = Object.fromEntries(element.getAttributeNames().map((name) => [name, element.getAttribute(name) ?? ""]));
46
- existing.push({
47
- attributes,
48
- innerHTML: element.innerHTML
49
- });
50
- snapshotMap.set(signature, existing);
51
- };
52
- var initializeIslandMarkupSnapshot = () => {
53
- if (typeof document === "undefined") {
54
- return;
55
- }
56
- const snapshotMap = getSnapshotMap();
57
- if (!snapshotMap || snapshotMap.size > 0) {
58
- return;
59
- }
60
- const elements = Array.from(document.querySelectorAll('[data-island="true"]'));
61
- for (const element of elements) {
62
- snapshotIslandElement(element, snapshotMap);
63
- }
64
- };
65
- var preserveIslandMarkup = (props) => {
66
- if (typeof document === "undefined") {
67
- return {
68
- attributes: getIslandMarkerAttributes(props),
69
- innerHTML: ""
70
- };
71
- }
72
- const claimMap = getClaimMap();
73
- const snapshotMap = getSnapshotMap();
74
- const signature = getIslandSignature(props);
75
- const claimedCount = claimMap?.get(signature) ?? 0;
76
- const snapshotCandidate = snapshotMap?.get(signature)?.[claimedCount];
77
- const candidates = Array.from(document.querySelectorAll('[data-island="true"]')).filter((element) => isMatchingIslandElement(element, props));
78
- const candidate = candidates[claimedCount];
79
- if (claimMap) {
80
- claimMap.set(signature, claimedCount + 1);
81
- }
82
- return {
83
- attributes: snapshotCandidate?.attributes ?? getIslandMarkerAttributes(props),
84
- innerHTML: snapshotCandidate?.innerHTML ?? candidate?.innerHTML ?? ""
85
- };
86
- };
87
-
88
- export { initializeIslandMarkupSnapshot, preserveIslandMarkup };
89
-
90
- //# debugId=73AD256A75D98ACE64756E2164756E21
91
- //# sourceMappingURL=chunk-fak944et.js.map
@@ -1,10 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/client/preserveIslandMarkup.ts"],
4
- "sourcesContent": [
5
- "import type { RuntimeIslandRenderProps } from '../../types/island';\nimport { getIslandMarkerAttributes } from '../core/islandMarkupAttributes';\n\ntype PreservedIslandMarkup = {\n\tattributes: Record<string, string>;\n\tinnerHTML: string;\n};\n\ntype IslandMarkerElement = HTMLElement & {\n\tdataset: DOMStringMap & {\n\t\tcomponent?: string;\n\t\tframework?: string;\n\t\thydrate?: string;\n\t\tisland?: string;\n\t\tislandId?: string;\n\t\tprops?: string;\n\t};\n};\n\nconst getClaimMap = () => {\n\tif (typeof window === 'undefined') {\n\t\treturn null;\n\t}\n\n\twindow.__ABS_CLAIMED_ISLAND_MARKUP__ ??= new Map<string, number>();\n\n\treturn window.__ABS_CLAIMED_ISLAND_MARKUP__;\n};\n\nconst getSnapshotMap = () => {\n\tif (typeof window === 'undefined') {\n\t\treturn null;\n\t}\n\n\twindow.__ABS_SERVER_ISLAND_HTML__ ??= new Map<\n\t\tstring,\n\t\tPreservedIslandMarkup[]\n\t>();\n\n\treturn window.__ABS_SERVER_ISLAND_HTML__;\n};\n\nconst getIslandSignature = (props: RuntimeIslandRenderProps) => {\n\tconst attributes = getIslandMarkerAttributes(props);\n\n\treturn [\n\t\tattributes['data-component'],\n\t\tattributes['data-framework'],\n\t\tattributes['data-hydrate'],\n\t\tattributes['data-props']\n\t].join('::');\n};\n\nconst isMatchingIslandElement = (\n\telement: Element,\n\tprops: RuntimeIslandRenderProps\n): element is IslandMarkerElement => {\n\tif (!(element instanceof HTMLElement)) {\n\t\treturn false;\n\t}\n\n\tconst attributes = getIslandMarkerAttributes(props);\n\n\treturn (\n\t\telement.dataset.island === 'true' &&\n\t\telement.dataset.component === attributes['data-component'] &&\n\t\telement.dataset.framework === attributes['data-framework'] &&\n\t\t(element.dataset.hydrate ?? 'load') === attributes['data-hydrate'] &&\n\t\t(element.dataset.props ?? '{}') === attributes['data-props']\n\t);\n};\n\nconst snapshotIslandElement = (\n\telement: HTMLElement,\n\tsnapshotMap: Map<string, PreservedIslandMarkup[]>\n) => {\n\tconst signature = [\n\t\telement.dataset.component,\n\t\telement.dataset.framework,\n\t\telement.dataset.hydrate ?? 'load',\n\t\telement.dataset.props ?? '{}'\n\t].join('::');\n\tconst existing = snapshotMap.get(signature) ?? [];\n\tconst attributes = Object.fromEntries(\n\t\telement\n\t\t\t.getAttributeNames()\n\t\t\t.map((name) => [name, element.getAttribute(name) ?? ''])\n\t);\n\texisting.push({\n\t\tattributes,\n\t\tinnerHTML: element.innerHTML\n\t});\n\tsnapshotMap.set(signature, existing);\n};\n\nexport const initializeIslandMarkupSnapshot = () => {\n\tif (typeof document === 'undefined') {\n\t\treturn;\n\t}\n\n\tconst snapshotMap = getSnapshotMap();\n\tif (!snapshotMap || snapshotMap.size > 0) {\n\t\treturn;\n\t}\n\n\tconst elements = Array.from(\n\t\tdocument.querySelectorAll<HTMLElement>('[data-island=\"true\"]')\n\t);\n\tfor (const element of elements) {\n\t\tsnapshotIslandElement(element, snapshotMap);\n\t}\n};\n\nexport const preserveIslandMarkup = (props: RuntimeIslandRenderProps) => {\n\tif (typeof document === 'undefined') {\n\t\treturn {\n\t\t\tattributes: getIslandMarkerAttributes(props),\n\t\t\tinnerHTML: ''\n\t\t};\n\t}\n\n\tconst claimMap = getClaimMap();\n\tconst snapshotMap = getSnapshotMap();\n\tconst signature = getIslandSignature(props);\n\tconst claimedCount = claimMap?.get(signature) ?? 0;\n\tconst snapshotCandidate = snapshotMap?.get(signature)?.[claimedCount];\n\tconst candidates = Array.from(\n\t\tdocument.querySelectorAll('[data-island=\"true\"]')\n\t).filter((element) => isMatchingIslandElement(element, props));\n\tconst candidate = candidates[claimedCount];\n\tif (claimMap) {\n\t\tclaimMap.set(signature, claimedCount + 1);\n\t}\n\n\treturn {\n\t\tattributes:\n\t\t\tsnapshotCandidate?.attributes ?? getIslandMarkerAttributes(props),\n\t\tinnerHTML: snapshotCandidate?.innerHTML ?? candidate?.innerHTML ?? ''\n\t};\n};\n"
6
- ],
7
- "mappings": ";;;;;;AAmBA,IAAM,cAAc,MAAM;AAAA,EACzB,IAAI,OAAO,WAAW,aAAa;AAAA,IAClC,OAAO;AAAA,EACR;AAAA,EAEA,OAAO,kCAAkC,IAAI;AAAA,EAE7C,OAAO,OAAO;AAAA;AAGf,IAAM,iBAAiB,MAAM;AAAA,EAC5B,IAAI,OAAO,WAAW,aAAa;AAAA,IAClC,OAAO;AAAA,EACR;AAAA,EAEA,OAAO,+BAA+B,IAAI;AAAA,EAK1C,OAAO,OAAO;AAAA;AAGf,IAAM,qBAAqB,CAAC,UAAoC;AAAA,EAC/D,MAAM,aAAa,0BAA0B,KAAK;AAAA,EAElD,OAAO;AAAA,IACN,WAAW;AAAA,IACX,WAAW;AAAA,IACX,WAAW;AAAA,IACX,WAAW;AAAA,EACZ,EAAE,KAAK,IAAI;AAAA;AAGZ,IAAM,0BAA0B,CAC/B,SACA,UACoC;AAAA,EACpC,IAAI,EAAE,mBAAmB,cAAc;AAAA,IACtC,OAAO;AA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ACZ;AAAA,EACD;AAAA,EAEA,MAAM,WAAW,YAAY;AAAA,EAC7B,MAAM,cAAc,eAAe;AAAA,EACnC,MAAM,YAAY,mBAAmB,KAAK;AAAA,EAC1C,MAAM,eAAe,UAAU,IAAI,SAAS,KAAK;AAAA,EACjD,MAAM,oBAAoB,aAAa,IAAI,SAAS,IAAI;AAAA,EACxD,MAAM,aAAa,MAAM,KACxB,SAAS,iBAAiB,sBAAsB,CACjD,EAAE,OAAO,CAAC,YAAY,wBAAwB,SAAS,KAAK,CAAC;AAAA,EAC7D,MAAM,YAAY,WAAW;AAAA,EAC7B,IAAI,UAAU;AAAA,IACb,SAAS,IAAI,WAAW,eAAe,CAAC;AAAA,EACzC;AAAA,EAEA,OAAO;AAAA,IACN,YACC,mBAAmB,cAAc,0BAA0B,KAAK;AAAA,IACjE,WAAW,mBAAmB,aAAa,WAAW,aAAa;AAAA,EACpE;AAAA;",
8
- "debugId": "73AD256A75D98ACE64756E2164756E21",
9
- "names": []
10
- }
@@ -1,118 +0,0 @@
1
- // @bun
2
- // node_modules/zustand/esm/vanilla.mjs
3
- var createStoreImpl = (createState) => {
4
- let state;
5
- const listeners = /* @__PURE__ */ new Set;
6
- const setState = (partial, replace) => {
7
- const nextState = typeof partial === "function" ? partial(state) : partial;
8
- if (!Object.is(nextState, state)) {
9
- const previousState = state;
10
- state = (replace != null ? replace : typeof nextState !== "object" || nextState === null) ? nextState : Object.assign({}, state, nextState);
11
- listeners.forEach((listener) => listener(state, previousState));
12
- }
13
- };
14
- const getState = () => state;
15
- const getInitialState = () => initialState;
16
- const subscribe = (listener) => {
17
- listeners.add(listener);
18
- return () => listeners.delete(listener);
19
- };
20
- const api = { setState, getState, getInitialState, subscribe };
21
- const initialState = state = createState(setState, getState, api);
22
- return api;
23
- };
24
- var createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;
25
-
26
- // node_modules/zustand/esm/middleware.mjs
27
- function combine(initialState, create) {
28
- return (...args) => Object.assign({}, initialState, create(...args));
29
- }
30
-
31
- // src/client/islandStore.ts
32
- var getIslandStoreSnapshot = () => {
33
- globalThis.__ABS_ISLAND_STATE__ ??= {};
34
- return globalThis.__ABS_ISLAND_STATE__;
35
- };
36
- var getIslandStores = () => {
37
- globalThis.__ABS_ISLAND_STORES__ ??= new Map;
38
- return globalThis.__ABS_ISLAND_STORES__;
39
- };
40
- var isSerializableValue = (value) => typeof value !== "function" && value !== undefined;
41
- var toSerializableState = (state) => Object.fromEntries(Object.entries(state).filter(([, value]) => isSerializableValue(value)));
42
- var applySnapshot = (store, snapshot) => {
43
- if (!snapshot) {
44
- return;
45
- }
46
- store.setState({
47
- ...store.getState(),
48
- ...snapshot
49
- });
50
- };
51
- var getPeerStores = (storeInstances, ownerStore) => [...storeInstances].filter((peer) => peer.store !== ownerStore);
52
- var syncIslandSnapshot = (storeId, state, storeInstances, ownerStore) => {
53
- const nextSnapshot = toSerializableState(state);
54
- getIslandStoreSnapshot()[storeId] = nextSnapshot;
55
- for (const peerStore of getPeerStores(storeInstances, ownerStore)) {
56
- peerStore.applyExternalSnapshot(nextSnapshot);
57
- }
58
- };
59
- var createIslandStore = (storeId, initialState, createState) => {
60
- const store = createStore(combine(initialState, createState));
61
- const stores = getIslandStores();
62
- const storeInstances = stores.get(storeId) ?? new Set;
63
- const initialSnapshot = getIslandStoreSnapshot()[storeId];
64
- applySnapshot(store, initialSnapshot);
65
- let isApplyingExternalSnapshot = false;
66
- const applyExternalSnapshot = (snapshot) => {
67
- isApplyingExternalSnapshot = true;
68
- applySnapshot(store, snapshot);
69
- };
70
- storeInstances.add({
71
- applyExternalSnapshot,
72
- store
73
- });
74
- stores.set(storeId, storeInstances);
75
- syncIslandSnapshot(storeId, store.getState(), storeInstances, store);
76
- store.subscribe((state) => {
77
- if (isApplyingExternalSnapshot) {
78
- isApplyingExternalSnapshot = false;
79
- return;
80
- }
81
- syncIslandSnapshot(storeId, state, storeInstances, store);
82
- });
83
- return store;
84
- };
85
- var getIslandStoreServerSnapshot = (store, selector) => selector(store.getInitialState());
86
- var applySnapshotToStoreInstances = (storeId, instances, snapshot) => {
87
- for (const instance of instances) {
88
- instance.applyExternalSnapshot(snapshot[storeId] ?? {});
89
- }
90
- };
91
- var initializeIslandStores = (state) => {
92
- const currentSnapshot = getIslandStoreSnapshot();
93
- const nextSnapshot = {
94
- ...state,
95
- ...currentSnapshot
96
- };
97
- globalThis.__ABS_ISLAND_STATE__ = nextSnapshot;
98
- for (const [storeId, store] of getIslandStores()) {
99
- applySnapshotToStoreInstances(storeId, store, nextSnapshot);
100
- }
101
- };
102
- var readIslandStore = (store, selector) => selector(store.getState());
103
- var subscribeIslandStore = (store, selector, listener) => {
104
- let currentSelection = selector(store.getState());
105
- return store.subscribe((state) => {
106
- const nextSelection = selector(state);
107
- if (Object.is(nextSelection, currentSelection)) {
108
- return;
109
- }
110
- currentSelection = nextSelection;
111
- listener(nextSelection);
112
- });
113
- };
114
-
115
- export { createIslandStore, getIslandStoreServerSnapshot, initializeIslandStores, readIslandStore, subscribeIslandStore };
116
-
117
- //# debugId=BAB6679FFC15F26F64756E2164756E21
118
- //# sourceMappingURL=chunk-fygx2ymm.js.map
@@ -1,12 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../node_modules/zustand/esm/vanilla.mjs", "../node_modules/zustand/esm/middleware.mjs", "../src/client/islandStore.ts"],
4
- "sourcesContent": [
5
- "const createStoreImpl = (createState) => {\n let state;\n const listeners = /* @__PURE__ */ new Set();\n const setState = (partial, replace) => {\n const nextState = typeof partial === \"function\" ? partial(state) : partial;\n if (!Object.is(nextState, state)) {\n const previousState = state;\n state = (replace != null ? replace : typeof nextState !== \"object\" || nextState === null) ? nextState : Object.assign({}, state, nextState);\n listeners.forEach((listener) => listener(state, previousState));\n }\n };\n const getState = () => state;\n const getInitialState = () => initialState;\n const subscribe = (listener) => {\n listeners.add(listener);\n return () => listeners.delete(listener);\n };\n const api = { setState, getState, getInitialState, subscribe };\n const initialState = state = createState(setState, getState, api);\n return api;\n};\nconst createStore = ((createState) => createState ? createStoreImpl(createState) : createStoreImpl);\n\nexport { createStore };\n",
6
- "const reduxImpl = (reducer, initial) => (set, _get, api) => {\n api.dispatch = (action) => {\n set((state) => reducer(state, action), false, action);\n return action;\n };\n api.dispatchFromDevtools = true;\n return { dispatch: (...args) => api.dispatch(...args), ...initial };\n};\nconst redux = reduxImpl;\n\nconst shouldDispatchFromDevtools = (api) => !!api.dispatchFromDevtools && typeof api.dispatch === \"function\";\nconst trackedConnections = /* @__PURE__ */ new Map();\nconst getTrackedConnectionState = (name) => {\n const api = trackedConnections.get(name);\n if (!api) return {};\n return Object.fromEntries(\n Object.entries(api.stores).map(([key, api2]) => [key, api2.getState()])\n );\n};\nconst extractConnectionInformation = (store, extensionConnector, options) => {\n if (store === void 0) {\n return {\n type: \"untracked\",\n connection: extensionConnector.connect(options)\n };\n }\n const existingConnection = trackedConnections.get(options.name);\n if (existingConnection) {\n return { type: \"tracked\", store, ...existingConnection };\n }\n const newConnection = {\n connection: extensionConnector.connect(options),\n stores: {}\n };\n trackedConnections.set(options.name, newConnection);\n return { type: \"tracked\", store, ...newConnection };\n};\nconst removeStoreFromTrackedConnections = (name, store) => {\n if (store === void 0) return;\n const connectionInfo = trackedConnections.get(name);\n if (!connectionInfo) return;\n delete connectionInfo.stores[store];\n if (Object.keys(connectionInfo.stores).length === 0) {\n trackedConnections.delete(name);\n }\n};\nconst findCallerName = (stack) => {\n var _a, _b;\n if (!stack) return void 0;\n const traceLines = stack.split(\"\\n\");\n const apiSetStateLineIndex = traceLines.findIndex(\n (traceLine) => traceLine.includes(\"api.setState\")\n );\n if (apiSetStateLineIndex < 0) return void 0;\n const callerLine = ((_a = traceLines[apiSetStateLineIndex + 1]) == null ? void 0 : _a.trim()) || \"\";\n return (_b = /.+ (.+) .+/.exec(callerLine)) == null ? void 0 : _b[1];\n};\nconst devtoolsImpl = (fn, devtoolsOptions = {}) => (set, get, api) => {\n const { enabled, anonymousActionType, store, ...options } = devtoolsOptions;\n let extensionConnector;\n try {\n extensionConnector = (enabled != null ? enabled : (import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") && window.__REDUX_DEVTOOLS_EXTENSION__;\n } catch (e) {\n }\n if (!extensionConnector) {\n return fn(set, get, api);\n }\n const { connection, ...connectionInformation } = extractConnectionInformation(store, extensionConnector, options);\n let isRecording = true;\n api.setState = ((state, replace, nameOrAction) => {\n const r = set(state, replace);\n if (!isRecording) return r;\n const action = nameOrAction === void 0 ? {\n type: anonymousActionType || findCallerName(new Error().stack) || \"anonymous\"\n } : typeof nameOrAction === \"string\" ? { type: nameOrAction } : nameOrAction;\n if (store === void 0) {\n connection == null ? void 0 : connection.send(action, get());\n return r;\n }\n connection == null ? void 0 : connection.send(\n {\n ...action,\n type: `${store}/${action.type}`\n },\n {\n ...getTrackedConnectionState(options.name),\n [store]: api.getState()\n }\n );\n return r;\n });\n api.devtools = {\n cleanup: () => {\n if (connection && typeof connection.unsubscribe === \"function\") {\n connection.unsubscribe();\n }\n removeStoreFromTrackedConnections(options.name, store);\n }\n };\n const setStateFromDevtools = (...a) => {\n const originalIsRecording = isRecording;\n isRecording = false;\n set(...a);\n isRecording = originalIsRecording;\n };\n const initialState = fn(api.setState, get, api);\n if (connectionInformation.type === \"untracked\") {\n connection == null ? void 0 : connection.init(initialState);\n } else {\n connectionInformation.stores[connectionInformation.store] = api;\n connection == null ? void 0 : connection.init(\n Object.fromEntries(\n Object.entries(connectionInformation.stores).map(([key, store2]) => [\n key,\n key === connectionInformation.store ? initialState : store2.getState()\n ])\n )\n );\n }\n if (shouldDispatchFromDevtools(api)) {\n let didWarnAboutReservedActionType = false;\n const originalDispatch = api.dispatch;\n api.dispatch = (...args) => {\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\" && args[0].type === \"__setState\" && !didWarnAboutReservedActionType) {\n console.warn(\n '[zustand devtools middleware] \"__setState\" action type is reserved to set state from the devtools. Avoid using it.'\n );\n didWarnAboutReservedActionType = true;\n }\n originalDispatch(...args);\n };\n }\n connection.subscribe((message) => {\n var _a;\n switch (message.type) {\n case \"ACTION\":\n if (typeof message.payload !== \"string\") {\n console.error(\n \"[zustand devtools middleware] Unsupported action format\"\n );\n return;\n }\n return parseJsonThen(\n message.payload,\n (action) => {\n if (action.type === \"__setState\") {\n if (store === void 0) {\n setStateFromDevtools(action.state);\n return;\n }\n if (Object.keys(action.state).length !== 1) {\n console.error(\n `\n [zustand devtools middleware] Unsupported __setState action format.\n When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),\n and value of this only key should be a state object. Example: { \"type\": \"__setState\", \"state\": { \"abc123Store\": { \"foo\": \"bar\" } } }\n `\n );\n }\n const stateFromDevtools = action.state[store];\n if (stateFromDevtools === void 0 || stateFromDevtools === null) {\n return;\n }\n if (JSON.stringify(api.getState()) !== JSON.stringify(stateFromDevtools)) {\n setStateFromDevtools(stateFromDevtools);\n }\n return;\n }\n if (shouldDispatchFromDevtools(api)) {\n api.dispatch(action);\n }\n }\n );\n case \"DISPATCH\":\n switch (message.payload.type) {\n case \"RESET\":\n setStateFromDevtools(initialState);\n if (store === void 0) {\n return connection == null ? void 0 : connection.init(api.getState());\n }\n return connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));\n case \"COMMIT\":\n if (store === void 0) {\n connection == null ? void 0 : connection.init(api.getState());\n return;\n }\n return connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));\n case \"ROLLBACK\":\n return parseJsonThen(message.state, (state) => {\n if (store === void 0) {\n setStateFromDevtools(state);\n connection == null ? void 0 : connection.init(api.getState());\n return;\n }\n setStateFromDevtools(state[store]);\n connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));\n });\n case \"JUMP_TO_STATE\":\n case \"JUMP_TO_ACTION\":\n return parseJsonThen(message.state, (state) => {\n if (store === void 0) {\n setStateFromDevtools(state);\n return;\n }\n if (JSON.stringify(api.getState()) !== JSON.stringify(state[store])) {\n setStateFromDevtools(state[store]);\n }\n });\n case \"IMPORT_STATE\": {\n const { nextLiftedState } = message.payload;\n const lastComputedState = (_a = nextLiftedState.computedStates.slice(-1)[0]) == null ? void 0 : _a.state;\n if (!lastComputedState) return;\n if (store === void 0) {\n setStateFromDevtools(lastComputedState);\n } else {\n setStateFromDevtools(lastComputedState[store]);\n }\n connection == null ? void 0 : connection.send(\n null,\n // FIXME no-any\n nextLiftedState\n );\n return;\n }\n case \"PAUSE_RECORDING\":\n return isRecording = !isRecording;\n }\n return;\n }\n });\n return initialState;\n};\nconst devtools = devtoolsImpl;\nconst parseJsonThen = (stringified, fn) => {\n let parsed;\n try {\n parsed = JSON.parse(stringified);\n } catch (e) {\n console.error(\n \"[zustand devtools middleware] Could not parse the received json\",\n e\n );\n }\n if (parsed !== void 0) fn(parsed);\n};\n\nconst subscribeWithSelectorImpl = (fn) => (set, get, api) => {\n const origSubscribe = api.subscribe;\n api.subscribe = ((selector, optListener, options) => {\n let listener = selector;\n if (optListener) {\n const equalityFn = (options == null ? void 0 : options.equalityFn) || Object.is;\n let currentSlice = selector(api.getState());\n listener = (state) => {\n const nextSlice = selector(state);\n if (!equalityFn(currentSlice, nextSlice)) {\n const previousSlice = currentSlice;\n optListener(currentSlice = nextSlice, previousSlice);\n }\n };\n if (options == null ? void 0 : options.fireImmediately) {\n optListener(currentSlice, currentSlice);\n }\n }\n return origSubscribe(listener);\n });\n const initialState = fn(set, get, api);\n return initialState;\n};\nconst subscribeWithSelector = subscribeWithSelectorImpl;\n\nfunction combine(initialState, create) {\n return (...args) => Object.assign({}, initialState, create(...args));\n}\n\nfunction createJSONStorage(getStorage, options) {\n let storage;\n try {\n storage = getStorage();\n } catch (e) {\n return;\n }\n const persistStorage = {\n getItem: (name) => {\n var _a;\n const parse = (str2) => {\n if (str2 === null) {\n return null;\n }\n return JSON.parse(str2, options == null ? void 0 : options.reviver);\n };\n const str = (_a = storage.getItem(name)) != null ? _a : null;\n if (str instanceof Promise) {\n return str.then(parse);\n }\n return parse(str);\n },\n setItem: (name, newValue) => storage.setItem(name, JSON.stringify(newValue, options == null ? void 0 : options.replacer)),\n removeItem: (name) => storage.removeItem(name)\n };\n return persistStorage;\n}\nconst toThenable = (fn) => (input) => {\n try {\n const result = fn(input);\n if (result instanceof Promise) {\n return result;\n }\n return {\n then(onFulfilled) {\n return toThenable(onFulfilled)(result);\n },\n catch(_onRejected) {\n return this;\n }\n };\n } catch (e) {\n return {\n then(_onFulfilled) {\n return this;\n },\n catch(onRejected) {\n return toThenable(onRejected)(e);\n }\n };\n }\n};\nconst persistImpl = (config, baseOptions) => (set, get, api) => {\n let options = {\n storage: createJSONStorage(() => window.localStorage),\n partialize: (state) => state,\n version: 0,\n merge: (persistedState, currentState) => ({\n ...currentState,\n ...persistedState\n }),\n ...baseOptions\n };\n let hasHydrated = false;\n let hydrationVersion = 0;\n const hydrationListeners = /* @__PURE__ */ new Set();\n const finishHydrationListeners = /* @__PURE__ */ new Set();\n let storage = options.storage;\n if (!storage) {\n return config(\n (...args) => {\n console.warn(\n `[zustand persist middleware] Unable to update item '${options.name}', the given storage is currently unavailable.`\n );\n set(...args);\n },\n get,\n api\n );\n }\n const setItem = () => {\n const state = options.partialize({ ...get() });\n return storage.setItem(options.name, {\n state,\n version: options.version\n });\n };\n const savedSetState = api.setState;\n api.setState = (state, replace) => {\n savedSetState(state, replace);\n return setItem();\n };\n const configResult = config(\n (...args) => {\n set(...args);\n return setItem();\n },\n get,\n api\n );\n api.getInitialState = () => configResult;\n let stateFromStorage;\n const hydrate = () => {\n var _a, _b;\n if (!storage) return;\n const currentVersion = ++hydrationVersion;\n hasHydrated = false;\n hydrationListeners.forEach((cb) => {\n var _a2;\n return cb((_a2 = get()) != null ? _a2 : configResult);\n });\n const postRehydrationCallback = ((_b = options.onRehydrateStorage) == null ? void 0 : _b.call(options, (_a = get()) != null ? _a : configResult)) || void 0;\n return toThenable(storage.getItem.bind(storage))(options.name).then((deserializedStorageValue) => {\n if (deserializedStorageValue) {\n if (typeof deserializedStorageValue.version === \"number\" && deserializedStorageValue.version !== options.version) {\n if (options.migrate) {\n const migration = options.migrate(\n deserializedStorageValue.state,\n deserializedStorageValue.version\n );\n if (migration instanceof Promise) {\n return migration.then((result) => [true, result]);\n }\n return [true, migration];\n }\n console.error(\n `State loaded from storage couldn't be migrated since no migrate function was provided`\n );\n } else {\n return [false, deserializedStorageValue.state];\n }\n }\n return [false, void 0];\n }).then((migrationResult) => {\n var _a2;\n if (currentVersion !== hydrationVersion) {\n return;\n }\n const [migrated, migratedState] = migrationResult;\n stateFromStorage = options.merge(\n migratedState,\n (_a2 = get()) != null ? _a2 : configResult\n );\n set(stateFromStorage, true);\n if (migrated) {\n return setItem();\n }\n }).then(() => {\n if (currentVersion !== hydrationVersion) {\n return;\n }\n postRehydrationCallback == null ? void 0 : postRehydrationCallback(get(), void 0);\n stateFromStorage = get();\n hasHydrated = true;\n finishHydrationListeners.forEach((cb) => cb(stateFromStorage));\n }).catch((e) => {\n if (currentVersion !== hydrationVersion) {\n return;\n }\n postRehydrationCallback == null ? void 0 : postRehydrationCallback(void 0, e);\n });\n };\n api.persist = {\n setOptions: (newOptions) => {\n options = {\n ...options,\n ...newOptions\n };\n if (newOptions.storage) {\n storage = newOptions.storage;\n }\n },\n clearStorage: () => {\n storage == null ? void 0 : storage.removeItem(options.name);\n },\n getOptions: () => options,\n rehydrate: () => hydrate(),\n hasHydrated: () => hasHydrated,\n onHydrate: (cb) => {\n hydrationListeners.add(cb);\n return () => {\n hydrationListeners.delete(cb);\n };\n },\n onFinishHydration: (cb) => {\n finishHydrationListeners.add(cb);\n return () => {\n finishHydrationListeners.delete(cb);\n };\n }\n };\n if (!options.skipHydration) {\n hydrate();\n }\n return stateFromStorage || configResult;\n};\nconst persist = persistImpl;\n\nfunction ssrSafe(config, isSSR = typeof window === \"undefined\") {\n return (set, get, api) => {\n if (!isSSR) {\n return config(set, get, api);\n }\n const ssrSet = () => {\n throw new Error(\"Cannot set state of Zustand store in SSR\");\n };\n api.setState = ssrSet;\n return config(ssrSet, get, api);\n };\n}\n\nexport { combine, createJSONStorage, devtools, persist, redux, subscribeWithSelector, ssrSafe as unstable_ssrSafe };\n",
7
- "import { createStore, type StateCreator, type StoreApi } from 'zustand/vanilla';\nimport { combine } from 'zustand/middleware';\n\nexport type IslandStoreState = object;\ntype IslandStoreSnapshot = Record<string, unknown>;\ntype IslandStoreShape<\n\tTState extends IslandStoreState,\n\tTActions extends object\n> = Omit<TState, keyof TActions> & TActions;\nexport type IslandStateSnapshot = Record<string, IslandStoreSnapshot>;\ntype AnyIslandStore = StoreApi<object>;\ntype IslandStoreInstance = {\n\tapplyExternalSnapshot: (snapshot: IslandStoreSnapshot) => void;\n\tstore: AnyIslandStore;\n};\n\nconst ABSOLUTE_ISLAND_STATE = '__ABS_ISLAND_STATE__';\nconst ABSOLUTE_ISLAND_STORES = '__ABS_ISLAND_STORES__';\n\ndeclare global {\n\tvar __ABS_ISLAND_STATE__: IslandStateSnapshot | undefined;\n\tvar __ABS_ISLAND_STORES__:\n\t\t| Map<string, Set<IslandStoreInstance>>\n\t\t| undefined;\n}\n\nconst getIslandStoreSnapshot = () => {\n\tglobalThis.__ABS_ISLAND_STATE__ ??= {};\n\n\treturn globalThis.__ABS_ISLAND_STATE__;\n};\n\nconst getIslandStores = () => {\n\tglobalThis.__ABS_ISLAND_STORES__ ??= new Map();\n\n\treturn globalThis.__ABS_ISLAND_STORES__;\n};\n\nconst isSerializableValue = (value: unknown) =>\n\ttypeof value !== 'function' && value !== undefined;\n\nconst toSerializableState = <T extends object>(state: T) =>\n\tObject.fromEntries(\n\t\tObject.entries(state).filter(([, value]) => isSerializableValue(value))\n\t);\n\nconst applySnapshot = <T extends object>(\n\tstore: StoreApi<T>,\n\tsnapshot: IslandStoreSnapshot | undefined\n) => {\n\tif (!snapshot) {\n\t\treturn;\n\t}\n\n\tstore.setState({\n\t\t...store.getState(),\n\t\t...snapshot\n\t});\n};\n\nconst getPeerStores = (\n\tstoreInstances: Set<IslandStoreInstance>,\n\townerStore: AnyIslandStore\n) => [...storeInstances].filter((peer) => peer.store !== ownerStore);\n\nconst syncIslandSnapshot = <\n\tTState extends IslandStoreState,\n\tTActions extends object\n>(\n\tstoreId: string,\n\tstate: IslandStoreShape<TState, TActions>,\n\tstoreInstances: Set<IslandStoreInstance>,\n\townerStore: AnyIslandStore\n) => {\n\tconst nextSnapshot = toSerializableState(state);\n\tgetIslandStoreSnapshot()[storeId] = nextSnapshot;\n\n\tfor (const peerStore of getPeerStores(storeInstances, ownerStore)) {\n\t\tpeerStore.applyExternalSnapshot(nextSnapshot);\n\t}\n};\n\nexport const createIslandStore = <\n\tTState extends IslandStoreState,\n\tTActions extends object\n>(\n\tstoreId: string,\n\tinitialState: TState,\n\tcreateState: StateCreator<TState, [], [], TActions>\n) => {\n\tconst store = createStore(combine(initialState, createState));\n\tconst stores = getIslandStores();\n\tconst storeInstances =\n\t\tstores.get(storeId) ?? new Set<IslandStoreInstance>();\n\tconst initialSnapshot = getIslandStoreSnapshot()[storeId];\n\tapplySnapshot(store, initialSnapshot);\n\tlet isApplyingExternalSnapshot = false;\n\n\tconst applyExternalSnapshot = (snapshot: IslandStoreSnapshot) => {\n\t\tisApplyingExternalSnapshot = true;\n\t\tapplySnapshot(store, snapshot);\n\t};\n\n\tstoreInstances.add({\n\t\tapplyExternalSnapshot,\n\t\tstore\n\t});\n\tstores.set(storeId, storeInstances);\n\n\tsyncIslandSnapshot(storeId, store.getState(), storeInstances, store);\n\tstore.subscribe((state) => {\n\t\tif (isApplyingExternalSnapshot) {\n\t\t\tisApplyingExternalSnapshot = false;\n\n\t\t\treturn;\n\t\t}\n\n\t\tsyncIslandSnapshot(storeId, state, storeInstances, store);\n\t});\n\n\treturn store;\n};\nexport const getIslandStoreServerSnapshot = <\n\tTState extends IslandStoreState,\n\tTSelected\n>(\n\tstore: StoreApi<TState>,\n\tselector: (state: TState) => TSelected\n) => selector(store.getInitialState());\nconst applySnapshotToStoreInstances = (\n\tstoreId: string,\n\tinstances: Set<IslandStoreInstance>,\n\tsnapshot: IslandStateSnapshot\n) => {\n\tfor (const instance of instances) {\n\t\tinstance.applyExternalSnapshot(snapshot[storeId] ?? {});\n\t}\n};\n\nexport const initializeIslandStores = (state: IslandStateSnapshot) => {\n\tconst currentSnapshot = getIslandStoreSnapshot();\n\tconst nextSnapshot: IslandStateSnapshot = {\n\t\t...state,\n\t\t...currentSnapshot\n\t};\n\n\tglobalThis.__ABS_ISLAND_STATE__ = nextSnapshot;\n\n\tfor (const [storeId, store] of getIslandStores()) {\n\t\tapplySnapshotToStoreInstances(storeId, store, nextSnapshot);\n\t}\n};\nexport const readIslandStore = <TState extends IslandStoreState, TSelected>(\n\tstore: StoreApi<TState>,\n\tselector: (state: TState) => TSelected\n) => selector(store.getState());\nexport const resetIslandStoreForTesting = () => {\n\tdelete globalThis.__ABS_ISLAND_STATE__;\n\tdelete globalThis.__ABS_ISLAND_STORES__;\n};\nexport const subscribeIslandStore = <\n\tTState extends IslandStoreState,\n\tTSelected\n>(\n\tstore: StoreApi<TState>,\n\tselector: (state: TState) => TSelected,\n\tlistener: (value: TSelected) => void\n) => {\n\tlet currentSelection = selector(store.getState());\n\n\treturn store.subscribe((state) => {\n\t\tconst nextSelection = selector(state);\n\t\tif (Object.is(nextSelection, currentSelection)) {\n\t\t\treturn;\n\t\t}\n\n\t\tcurrentSelection = nextSelection;\n\t\tlistener(nextSelection);\n\t});\n};\n\nexport { ABSOLUTE_ISLAND_STATE, ABSOLUTE_ISLAND_STORES };\n"
8
- ],
9
- "mappings": ";;AAAA,IAAM,kBAAkB,CAAC,gBAAgB;AAAA,EACvC,IAAI;AAAA,EACJ,MAAM,4BAA4B,IAAI;AAAA,EACtC,MAAM,WAAW,CAAC,SAAS,YAAY;AAAA,IACrC,MAAM,YAAY,OAAO,YAAY,aAAa,QAAQ,KAAK,IAAI;AAAA,IACnE,IAAI,CAAC,OAAO,GAAG,WAAW,KAAK,GAAG;AAAA,MAChC,MAAM,gBAAgB;AAAA,MACtB,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AA,EACvD;AAAA;AAGM,IAAM,yBAAyB,CAAC,UAA+B;AAAA,EACrE,MAAM,kBAAkB,uBAAuB;AAAA,EAC/C,MAAM,eAAoC;AAAA,OACtC;AAAA,OACA;AAAA,EACJ;AAAA,EAEA,WAAW,uBAAuB;AAAA,EAElC,YAAY,SAAS,UAAU,gBAAgB,GAAG;AAAA,IACjD,8BAA8B,SAAS,OAAO,YAAY;AAAA,EAC3D;AAAA;AAEM,IAAM,kBAAkB,CAC9B,OACA,aACI,SAAS,MAAM,SAAS,CAAC;AAKvB,IAAM,uBAAuB,CAInC,OACA,UACA,aACI;AAAA,EACJ,IAAI,mBAAmB,SAAS,MAAM,SAAS,CAAC;AAAA,EAEhD,OAAO,MAAM,UAAU,CAAC,UAAU;AAAA,IACjC,MAAM,gBAAgB,SAAS,KAAK;AAAA,IACpC,IAAI,OAAO,GAAG,eAAe,gBAAgB,GAAG;AAAA,MAC/C;AAAA,IACD;AAAA,IAEA,mBAAmB;AAAA,IACnB,SAAS,aAAa;AAAA,GACtB;AAAA;",
10
- "debugId": "BAB6679FFC15F26F64756E2164756E21",
11
- "names": []
12
- }
@@ -1,271 +0,0 @@
1
- // @bun
2
- import {
3
- isStreamingSlotCollectionActive,
4
- registerStreamingSlot,
5
- warnMissingStreamingSlotCollector
6
- } from "./chunk-qxq2zcty.js";
7
- import {
8
- __require
9
- } from "./chunk-bmgqm774.js";
10
- // src/vue/components/SuspenseSlot.ts
11
- import {
12
- cloneVNode,
13
- defineComponent,
14
- h,
15
- isVNode,
16
- onMounted,
17
- onBeforeUnmount,
18
- ref,
19
- useSSRContext
20
- } from "vue";
21
- var renderVueNodesToHtml = async (nodes) => {
22
- const { createSSRApp, h: createVNode } = await import("vue");
23
- const { renderToString } = await import("vue/server-renderer");
24
- const app = createSSRApp({
25
- render: () => createVNode("div", undefined, nodes ?? undefined)
26
- });
27
- const html = await renderToString(app);
28
- return html.replace(/^<div>|<\/div>$/g, "");
29
- };
30
- var hasFrameworkSlots = (defaultSlot, fallbackSlot, errorSlot, promise) => defaultSlot !== undefined || fallbackSlot !== undefined || errorSlot !== undefined || promise !== undefined;
31
- var allowMismatchOnSlotNodes = (nodes) => {
32
- if (Array.isArray(nodes)) {
33
- return nodes.map((node) => allowMismatchOnSlotNodes(node));
34
- }
35
- if (isVNode(nodes)) {
36
- return cloneVNode(nodes, {
37
- "data-allow-mismatch": ""
38
- });
39
- }
40
- return nodes;
41
- };
42
- var resolveSuspenseValue = async (resolve, promise) => {
43
- if (resolve !== undefined) {
44
- return resolve();
45
- }
46
- if (promise !== undefined) {
47
- return promise;
48
- }
49
- return;
50
- };
51
- var isObjectRecord = (value) => Boolean(value) && typeof value === "object";
52
- var isVueSuspensePayload = (payload) => {
53
- if (!isObjectRecord(payload)) {
54
- return false;
55
- }
56
- return payload.kind === "vue-suspense";
57
- };
58
- var hasEventDetailId = (event, id) => {
59
- if (!(event instanceof CustomEvent)) {
60
- return false;
61
- }
62
- const { detail } = event;
63
- if (!detail || typeof detail !== "object") {
64
- return false;
65
- }
66
- return detail.id === id;
67
- };
68
- var toLegacySuspenseSlotRegistration = (props) => {
69
- if (!props.resolve) {
70
- return null;
71
- }
72
- return {
73
- errorHtml: props.errorHtml,
74
- fallbackHtml: props.fallbackHtml,
75
- id: props.id,
76
- timeoutMs: props.timeoutMs,
77
- resolve: async () => {
78
- const resolved = await props.resolve?.();
79
- return typeof resolved === "string" ? resolved : "";
80
- }
81
- };
82
- };
83
- var registerLegacySuspenseSlot = (props) => {
84
- registerStreamingSlot({
85
- errorHtml: props.errorHtml,
86
- fallbackHtml: props.fallbackHtml,
87
- id: props.id,
88
- resolve: props.resolve,
89
- timeoutMs: props.timeoutMs
90
- });
91
- };
92
- var resolveStreamingSuspenseSlot = async (props, slots) => {
93
- try {
94
- const value = await resolveSuspenseValue(props.resolve, props.promise);
95
- const nodes = allowMismatchOnSlotNodes(slots.default?.({ value }) ?? []);
96
- const html = await renderVueNodesToHtml(nodes);
97
- return {
98
- html,
99
- kind: "vue-suspense",
100
- value
101
- };
102
- } catch (error) {
103
- const errorNodes = slots.error?.({ error });
104
- if (errorNodes !== undefined)
105
- return renderVueNodesToHtml(allowMismatchOnSlotNodes(errorNodes));
106
- if (typeof props.errorHtml === "string")
107
- return props.errorHtml;
108
- throw error;
109
- }
110
- };
111
- var registerSuspenseSlotForSsr = (props, slots, usesFrameworkSlots) => {
112
- if (!isStreamingSlotCollectionActive()) {
113
- warnMissingStreamingSlotCollector("SuspenseSlot");
114
- }
115
- const legacyRegistration = toLegacySuspenseSlotRegistration(props);
116
- if (!usesFrameworkSlots && legacyRegistration) {
117
- registerLegacySuspenseSlot(legacyRegistration);
118
- return;
119
- }
120
- registerStreamingSlot({
121
- id: props.id,
122
- timeoutMs: props.timeoutMs,
123
- resolve: () => resolveStreamingSuspenseSlot(props, slots)
124
- });
125
- };
126
- var applySuspensePayload = (payload, state) => {
127
- state.hasError.value = payload.state === "error";
128
- state.resolvedValue.value = payload.value;
129
- state.isResolved.value = payload.state !== "error";
130
- };
131
- var SuspenseSlot = defineComponent({
132
- name: "AbsoluteSuspenseSlot",
133
- props: {
134
- className: { default: undefined, type: String },
135
- errorHtml: { default: undefined, type: String },
136
- fallbackHtml: { default: "", type: String },
137
- id: { required: true, type: String },
138
- promise: {
139
- default: undefined,
140
- type: Object
141
- },
142
- resolve: {
143
- default: undefined,
144
- type: Function
145
- },
146
- timeoutMs: { default: undefined, type: Number }
147
- },
148
- setup(props, { slots }) {
149
- const readPatchedDomState = () => {
150
- if (typeof document === "undefined")
151
- return false;
152
- const slotNode = document.getElementById(props.id);
153
- if (!slotNode)
154
- return false;
155
- return slotNode.getAttribute("data-absolute-slot-state") === "resolved";
156
- };
157
- const isResolved = ref(false);
158
- const resolvedValue = ref(undefined);
159
- const hasError = ref(false);
160
- const hasPatchedDom = ref(readPatchedDomState());
161
- const usesFrameworkSlots = hasFrameworkSlots(slots.default, slots.fallback, slots.error, props.promise);
162
- const isSsrRender = useSSRContext() !== undefined;
163
- if (isSsrRender) {
164
- registerSuspenseSlotForSsr(props, slots, usesFrameworkSlots);
165
- }
166
- if (typeof window !== "undefined" && usesFrameworkSlots) {
167
- const consumers = window.__ABS_SLOT_CONSUMERS__ = window.__ABS_SLOT_CONSUMERS__ ?? {};
168
- let runtimeReady = false;
169
- consumers[props.id] = (payload) => {
170
- if (!runtimeReady)
171
- return false;
172
- if (!isVueSuspensePayload(payload)) {
173
- return false;
174
- }
175
- applySuspensePayload(payload, {
176
- hasError,
177
- isResolved,
178
- resolvedValue
179
- });
180
- return true;
181
- };
182
- const handlePatchedDom = (event) => {
183
- if (hasEventDetailId(event, props.id)) {
184
- hasPatchedDom.value = true;
185
- }
186
- };
187
- onMounted(() => {
188
- hasPatchedDom.value = readPatchedDomState();
189
- window.addEventListener("absolutejs:slot-patch", handlePatchedDom);
190
- runtimeReady = true;
191
- window.__ABS_SLOT_FLUSH__?.();
192
- });
193
- onBeforeUnmount(() => {
194
- window.removeEventListener("absolutejs:slot-patch", handlePatchedDom);
195
- delete window.__ABS_SLOT_CONSUMERS__?.[props.id];
196
- });
197
- }
198
- const resolveSlotChildren = () => {
199
- if (hasPatchedDom.value) {
200
- return;
201
- }
202
- if (hasError.value) {
203
- return allowMismatchOnSlotNodes(slots.error?.({ error: undefined }) ?? slots.fallback?.() ?? undefined) ?? undefined;
204
- }
205
- if (isResolved.value) {
206
- return allowMismatchOnSlotNodes(slots.default?.({ value: resolvedValue.value }) ?? undefined) ?? undefined;
207
- }
208
- return allowMismatchOnSlotNodes(slots.fallback?.() ?? undefined);
209
- };
210
- return () => {
211
- if (!usesFrameworkSlots) {
212
- return h("div", {
213
- class: props.className,
214
- "data-absolute-slot": "true",
215
- id: props.id,
216
- innerHTML: props.fallbackHtml
217
- });
218
- }
219
- return h("div", {
220
- class: props.className,
221
- "data-absolute-slot": "true",
222
- "data-allow-mismatch": "",
223
- id: props.id
224
- }, resolveSlotChildren() ?? undefined);
225
- };
226
- }
227
- });
228
- // src/vue/components/StreamSlot.ts
229
- import { defineComponent as defineComponent2, h as h2, useSSRContext as useSSRContext2 } from "vue";
230
- var StreamSlot = defineComponent2({
231
- name: "AbsoluteStreamSlot",
232
- props: {
233
- className: { default: undefined, type: String },
234
- errorHtml: { default: undefined, type: String },
235
- fallbackHtml: { default: "", type: String },
236
- id: { required: true, type: String },
237
- resolve: {
238
- required: true,
239
- type: Function
240
- },
241
- timeoutMs: { default: undefined, type: Number }
242
- },
243
- setup(props) {
244
- if (useSSRContext2() !== undefined) {
245
- registerStreamSlotForSsr(props);
246
- }
247
- return () => h2("div", {
248
- class: props.className,
249
- "data-absolute-slot": "true",
250
- id: props.id,
251
- innerHTML: props.fallbackHtml
252
- });
253
- }
254
- });
255
- var registerStreamSlotForSsr = (props) => {
256
- if (!isStreamingSlotCollectionActive()) {
257
- warnMissingStreamingSlotCollector("StreamSlot");
258
- return;
259
- }
260
- registerStreamingSlot({
261
- errorHtml: props.errorHtml,
262
- fallbackHtml: props.fallbackHtml,
263
- id: props.id,
264
- resolve: props.resolve,
265
- timeoutMs: props.timeoutMs
266
- });
267
- };
268
- export { SuspenseSlot, StreamSlot };
269
-
270
- //# debugId=20D4051859B2A33064756E2164756E21
271
- //# sourceMappingURL=chunk-g15qj669.js.map
@@ -1,11 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/vue/components/SuspenseSlot.ts", "../src/vue/components/StreamSlot.ts"],
4
- "sourcesContent": [
5
- "import {\n\tcloneVNode,\n\tdefineComponent,\n\th,\n\tisVNode,\n\tonMounted,\n\tonBeforeUnmount,\n\tref,\n\tuseSSRContext,\n\ttype Slot,\n\ttype VNodeChild\n} from 'vue';\nimport {\n\tisStreamingSlotCollectionActive,\n\tregisterStreamingSlot,\n\twarnMissingStreamingSlotCollector\n} from '../../core/streamingSlotRegistrar';\n\nconst renderVueNodesToHtml = async (nodes: VNodeChild) => {\n\tconst { createSSRApp, h: createVNode } = await import('vue');\n\tconst { renderToString } = await import('vue/server-renderer');\n\n\tconst app = createSSRApp({\n\t\trender: () => createVNode('div', undefined, nodes ?? undefined)\n\t});\n\tconst html = await renderToString(app);\n\n\treturn html.replace(/^<div>|<\\/div>$/g, '');\n};\n\nconst hasFrameworkSlots = (\n\tdefaultSlot: Slot | undefined,\n\tfallbackSlot: Slot | undefined,\n\terrorSlot: Slot | undefined,\n\tpromise: Promise<unknown> | undefined\n) =>\n\tdefaultSlot !== undefined ||\n\tfallbackSlot !== undefined ||\n\terrorSlot !== undefined ||\n\tpromise !== undefined;\n\nconst allowMismatchOnSlotNodes: (nodes: VNodeChild) => VNodeChild = (nodes) => {\n\tif (Array.isArray(nodes)) {\n\t\treturn nodes.map((node) => allowMismatchOnSlotNodes(node));\n\t}\n\tif (isVNode(nodes)) {\n\t\treturn cloneVNode(nodes, {\n\t\t\t'data-allow-mismatch': ''\n\t\t});\n\t}\n\n\treturn nodes;\n};\n\nconst resolveSuspenseValue = async (\n\tresolve: (() => Promise<unknown> | unknown) | undefined,\n\tpromise: Promise<unknown> | undefined\n) => {\n\tif (resolve !== undefined) {\n\t\treturn resolve();\n\t}\n\n\tif (promise !== undefined) {\n\t\treturn promise;\n\t}\n\n\treturn undefined;\n};\n\ntype LegacySuspenseSlotRegistration = {\n\terrorHtml?: string;\n\tfallbackHtml: string;\n\tid: string;\n\tresolve: () => Promise<string> | string;\n\ttimeoutMs?: number;\n};\n\ntype SuspenseSlotProps = {\n\tclassName?: string;\n\terrorHtml?: string;\n\tfallbackHtml: string;\n\tid: string;\n\tpromise?: Promise<unknown>;\n\tresolve?: () => Promise<unknown> | unknown;\n\ttimeoutMs?: number;\n};\n\ntype VueSuspensePayload = {\n\tkind: 'vue-suspense';\n\tstate?: unknown;\n\tvalue?: unknown;\n};\n\nconst isObjectRecord = (value: unknown): value is Record<string, unknown> =>\n\tBoolean(value) && typeof value === 'object';\n\nconst isVueSuspensePayload = (\n\tpayload: unknown\n): payload is VueSuspensePayload => {\n\tif (!isObjectRecord(payload)) {\n\t\treturn false;\n\t}\n\n\treturn payload.kind === 'vue-suspense';\n};\n\nconst hasEventDetailId = (event: Event, id: string) => {\n\tif (!(event instanceof CustomEvent)) {\n\t\treturn false;\n\t}\n\n\tconst { detail } = event;\n\tif (!detail || typeof detail !== 'object') {\n\t\treturn false;\n\t}\n\n\treturn detail.id === id;\n};\n\nconst toLegacySuspenseSlotRegistration = (\n\tprops: SuspenseSlotProps\n): LegacySuspenseSlotRegistration | null => {\n\tif (!props.resolve) {\n\t\treturn null;\n\t}\n\n\treturn {\n\t\terrorHtml: props.errorHtml,\n\t\tfallbackHtml: props.fallbackHtml,\n\t\tid: props.id,\n\t\ttimeoutMs: props.timeoutMs,\n\t\tresolve: async () => {\n\t\t\tconst resolved = await props.resolve?.();\n\n\t\t\treturn typeof resolved === 'string' ? resolved : '';\n\t\t}\n\t};\n};\n\nconst registerLegacySuspenseSlot = (props: LegacySuspenseSlotRegistration) => {\n\tregisterStreamingSlot({\n\t\terrorHtml: props.errorHtml,\n\t\tfallbackHtml: props.fallbackHtml,\n\t\tid: props.id,\n\t\tresolve: props.resolve,\n\t\ttimeoutMs: props.timeoutMs\n\t});\n};\n\nconst resolveStreamingSuspenseSlot = async (\n\tprops: SuspenseSlotProps,\n\tslots: Record<string, Slot | undefined>\n) => {\n\ttry {\n\t\tconst value = await resolveSuspenseValue(props.resolve, props.promise);\n\t\tconst nodes = allowMismatchOnSlotNodes(\n\t\t\tslots.default?.({ value }) ?? []\n\t\t);\n\t\tconst html = await renderVueNodesToHtml(nodes);\n\n\t\treturn {\n\t\t\thtml,\n\t\t\tkind: 'vue-suspense',\n\t\t\tvalue\n\t\t};\n\t} catch (error) {\n\t\tconst errorNodes = slots.error?.({ error });\n\t\tif (errorNodes !== undefined)\n\t\t\treturn renderVueNodesToHtml(allowMismatchOnSlotNodes(errorNodes));\n\t\tif (typeof props.errorHtml === 'string') return props.errorHtml;\n\n\t\tthrow error;\n\t}\n};\n\nconst registerSuspenseSlotForSsr = (\n\tprops: SuspenseSlotProps,\n\tslots: Record<string, Slot | undefined>,\n\tusesFrameworkSlots: boolean\n) => {\n\tif (!isStreamingSlotCollectionActive()) {\n\t\twarnMissingStreamingSlotCollector('SuspenseSlot');\n\t}\n\tconst legacyRegistration = toLegacySuspenseSlotRegistration(props);\n\tif (!usesFrameworkSlots && legacyRegistration) {\n\t\tregisterLegacySuspenseSlot(legacyRegistration);\n\n\t\treturn;\n\t}\n\n\tregisterStreamingSlot({\n\t\tid: props.id,\n\t\ttimeoutMs: props.timeoutMs,\n\t\tresolve: () => resolveStreamingSuspenseSlot(props, slots)\n\t});\n};\n\nconst applySuspensePayload = (\n\tpayload: VueSuspensePayload,\n\tstate: {\n\t\thasError: { value: boolean };\n\t\tisResolved: { value: boolean };\n\t\tresolvedValue: { value: unknown };\n\t}\n) => {\n\tstate.hasError.value = payload.state === 'error';\n\tstate.resolvedValue.value = payload.value;\n\tstate.isResolved.value = payload.state !== 'error';\n};\n\nexport const SuspenseSlot = defineComponent({\n\tname: 'AbsoluteSuspenseSlot',\n\tprops: {\n\t\tclassName: { default: undefined, type: String },\n\t\terrorHtml: { default: undefined, type: String },\n\t\tfallbackHtml: { default: '', type: String },\n\t\tid: { required: true, type: String },\n\t\tpromise: {\n\t\t\tdefault: undefined,\n\t\t\ttype: Object\n\t\t},\n\t\tresolve: {\n\t\t\tdefault: undefined,\n\t\t\ttype: Function\n\t\t},\n\t\ttimeoutMs: { default: undefined, type: Number }\n\t},\n\tsetup(props: SuspenseSlotProps, { slots }) {\n\t\tconst readPatchedDomState = () => {\n\t\t\tif (typeof document === 'undefined') return false;\n\t\t\tconst slotNode = document.getElementById(props.id);\n\t\t\tif (!slotNode) return false;\n\n\t\t\treturn (\n\t\t\t\tslotNode.getAttribute('data-absolute-slot-state') === 'resolved'\n\t\t\t);\n\t\t};\n\t\tconst isResolved = ref(false);\n\t\tconst resolvedValue = ref<unknown>(undefined);\n\t\tconst hasError = ref(false);\n\t\tconst hasPatchedDom = ref(readPatchedDomState());\n\t\tconst usesFrameworkSlots = hasFrameworkSlots(\n\t\t\tslots.default,\n\t\t\tslots.fallback,\n\t\t\tslots.error,\n\t\t\tprops.promise\n\t\t);\n\t\tconst isSsrRender = useSSRContext() !== undefined;\n\n\t\tif (isSsrRender) {\n\t\t\tregisterSuspenseSlotForSsr(props, slots, usesFrameworkSlots);\n\t\t}\n\n\t\tif (typeof window !== 'undefined' && usesFrameworkSlots) {\n\t\t\tconst consumers = (window.__ABS_SLOT_CONSUMERS__ =\n\t\t\t\twindow.__ABS_SLOT_CONSUMERS__ ?? {});\n\t\t\tlet runtimeReady = false;\n\t\t\tconsumers[props.id] = (payload) => {\n\t\t\t\tif (!runtimeReady) return false;\n\t\t\t\tif (!isVueSuspensePayload(payload)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tapplySuspensePayload(payload, {\n\t\t\t\t\thasError,\n\t\t\t\t\tisResolved,\n\t\t\t\t\tresolvedValue\n\t\t\t\t});\n\n\t\t\t\treturn true;\n\t\t\t};\n\t\t\tconst handlePatchedDom = (event: Event) => {\n\t\t\t\tif (hasEventDetailId(event, props.id)) {\n\t\t\t\t\thasPatchedDom.value = true;\n\t\t\t\t}\n\t\t\t};\n\t\t\tonMounted(() => {\n\t\t\t\thasPatchedDom.value = readPatchedDomState();\n\t\t\t\twindow.addEventListener(\n\t\t\t\t\t'absolutejs:slot-patch',\n\t\t\t\t\thandlePatchedDom\n\t\t\t\t);\n\t\t\t\truntimeReady = true;\n\t\t\t\twindow.__ABS_SLOT_FLUSH__?.();\n\t\t\t});\n\t\t\tonBeforeUnmount(() => {\n\t\t\t\twindow.removeEventListener(\n\t\t\t\t\t'absolutejs:slot-patch',\n\t\t\t\t\thandlePatchedDom\n\t\t\t\t);\n\t\t\t\tdelete window.__ABS_SLOT_CONSUMERS__?.[props.id];\n\t\t\t});\n\t\t}\n\n\t\tconst resolveSlotChildren = () => {\n\t\t\tif (hasPatchedDom.value) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tif (hasError.value) {\n\t\t\t\treturn (\n\t\t\t\t\tallowMismatchOnSlotNodes(\n\t\t\t\t\t\tslots.error?.({ error: undefined }) ??\n\t\t\t\t\t\t\tslots.fallback?.() ??\n\t\t\t\t\t\t\tundefined\n\t\t\t\t\t) ?? undefined\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (isResolved.value) {\n\t\t\t\treturn (\n\t\t\t\t\tallowMismatchOnSlotNodes(\n\t\t\t\t\t\tslots.default?.({ value: resolvedValue.value }) ??\n\t\t\t\t\t\t\tundefined\n\t\t\t\t\t) ?? undefined\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn allowMismatchOnSlotNodes(slots.fallback?.() ?? undefined);\n\t\t};\n\n\t\treturn () => {\n\t\t\tif (!usesFrameworkSlots) {\n\t\t\t\treturn h('div', {\n\t\t\t\t\tclass: props.className,\n\t\t\t\t\t'data-absolute-slot': 'true',\n\t\t\t\t\tid: props.id,\n\t\t\t\t\tinnerHTML: props.fallbackHtml\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn h(\n\t\t\t\t'div',\n\t\t\t\t{\n\t\t\t\t\tclass: props.className,\n\t\t\t\t\t'data-absolute-slot': 'true',\n\t\t\t\t\t'data-allow-mismatch': '',\n\t\t\t\t\tid: props.id\n\t\t\t\t},\n\t\t\t\tresolveSlotChildren() ?? undefined\n\t\t\t);\n\t\t};\n\t}\n});\n",
6
- "import { defineComponent, h, useSSRContext } from 'vue';\nimport {\n\tisStreamingSlotCollectionActive,\n\tregisterStreamingSlot,\n\twarnMissingStreamingSlotCollector\n} from '../../core/streamingSlotRegistrar';\n\ntype StreamSlotProps = {\n\tclassName?: string;\n\terrorHtml?: string;\n\tfallbackHtml: string;\n\tid: string;\n\tresolve: () => Promise<string> | string;\n\ttimeoutMs?: number;\n};\n\nexport const StreamSlot = defineComponent({\n\tname: 'AbsoluteStreamSlot',\n\tprops: {\n\t\tclassName: { default: undefined, type: String },\n\t\terrorHtml: { default: undefined, type: String },\n\t\tfallbackHtml: { default: '', type: String },\n\t\tid: { required: true, type: String },\n\t\tresolve: {\n\t\t\trequired: true,\n\t\t\ttype: Function\n\t\t},\n\t\ttimeoutMs: { default: undefined, type: Number }\n\t},\n\tsetup(props: StreamSlotProps) {\n\t\tif (useSSRContext() !== undefined) {\n\t\t\tregisterStreamSlotForSsr(props);\n\t\t}\n\n\t\treturn () =>\n\t\t\th('div', {\n\t\t\t\tclass: props.className,\n\t\t\t\t'data-absolute-slot': 'true',\n\t\t\t\tid: props.id,\n\t\t\t\tinnerHTML: props.fallbackHtml\n\t\t\t});\n\t}\n});\n\nconst registerStreamSlotForSsr = (props: StreamSlotProps) => {\n\tif (!isStreamingSlotCollectionActive()) {\n\t\twarnMissingStreamingSlotCollector('StreamSlot');\n\n\t\treturn;\n\t}\n\n\tregisterStreamingSlot({\n\t\terrorHtml: props.errorHtml,\n\t\tfallbackHtml: props.fallbackHtml,\n\t\tid: props.id,\n\t\tresolve: props.resolve,\n\t\ttimeoutMs: props.timeoutMs\n\t});\n};\n"
7
- ],
8
- "mappings": ";;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBA,IAAM,uBAAuB,OAAO,UAAsB;AAAA,EACzD,QAAQ,cAAc,GAAG,gBAAgB,MAAa;AAAA,EACtD,QAAQ,mBAAmB,MAAa;AAAA,EAExC,MAAM,MAAM,aAAa;AAAA,IACxB,QAAQ,MAAM,YAAY,OAAO,WAAW,SAAS,SAAS;AAAA,EAC/D,CAAC;AAAA,EACD,MAAM,OAAO,MAAM,eAAe,GAAG;AAAA,EAErC,OAAO,KAAK,QAAQ,oBAAoB,EAAE;AAAA;AAG3C,IAAM,oBAAoB,CACzB,aACA,cACA,WACA,YAEA,gBAAgB,aAChB,iBAAiB,aACjB,cAAc,aACd,YAAY;AAEb,IAAM,2BAA8D,CAAC,UAAU;AAAA,EAC9E,IAAI,MAAM,QAAQ,KAAK,GAAG;AAAA,IACzB,OAAO,MA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