@atom.io/spa 0.0.10 → 0.0.11

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 (111) hide show
  1. package/README.md +5 -5
  2. package/dist/{BrandMarkScene-CBYk-RJ2.js → BrandMarkScene-BeWazldB.js} +4 -4
  3. package/dist/{BrandMarkScene-CBYk-RJ2.js.map → BrandMarkScene-BeWazldB.js.map} +1 -1
  4. package/dist/astro-application.d.ts +1 -1
  5. package/dist/astro-application.js +1 -1
  6. package/dist/astro-client.d.ts +1 -1
  7. package/dist/astro-client.js +5 -5
  8. package/dist/{astro-context-OdlexHR4.js → astro-context-B9XKrz8c.js} +1 -1
  9. package/dist/{astro-context-OdlexHR4.js.map → astro-context-B9XKrz8c.js.map} +1 -1
  10. package/dist/astro-middleware.js +2 -2
  11. package/dist/{astro-request-DRKvDjsO.js → astro-request-C0eYQlmS.js} +2 -2
  12. package/dist/{astro-request-DRKvDjsO.js.map → astro-request-C0eYQlmS.js.map} +1 -1
  13. package/dist/astro-resumability-client.d.ts +1 -1
  14. package/dist/astro-resumability-client.js +1 -1
  15. package/dist/astro-resumability-server.js +1 -1
  16. package/dist/astro-server.js +4 -4
  17. package/dist/{astro-shared-KxK9OUSj.d.ts → astro-shared-C-iO4PVU.d.ts} +2 -2
  18. package/dist/{astro-shared-KxK9OUSj.d.ts.map → astro-shared-C-iO4PVU.d.ts.map} +1 -1
  19. package/dist/{astro-shared-DBwINQav.js → astro-shared-CwBaV3Xu.js} +2 -2
  20. package/dist/{astro-shared-DBwINQav.js.map → astro-shared-CwBaV3Xu.js.map} +1 -1
  21. package/dist/astro.d.ts +2 -2
  22. package/dist/astro.js +1 -1
  23. package/dist/brand-model.js +4 -4
  24. package/dist/brand.d.ts +1 -1
  25. package/dist/brand.js +3 -3
  26. package/dist/{capabilities-ChgSs6bp.d.ts → capabilities-BNnXgvo5.d.ts} +3 -3
  27. package/dist/{capabilities-ChgSs6bp.d.ts.map → capabilities-BNnXgvo5.d.ts.map} +1 -1
  28. package/dist/{core-DD2giR6E.js → core-N07x1OaR.js} +1 -1
  29. package/dist/{core-DD2giR6E.js.map → core-N07x1OaR.js.map} +1 -1
  30. package/dist/development/{BrandMarkScene-BDdC7K5M.js → BrandMarkScene-B282kBA3.js} +4 -4
  31. package/dist/development/{BrandMarkScene-BDdC7K5M.js.map → BrandMarkScene-B282kBA3.js.map} +1 -1
  32. package/dist/development/astro-application.js +1 -1
  33. package/dist/development/astro-client.js +5 -5
  34. package/dist/development/{astro-context-OdlexHR4.js → astro-context-B9XKrz8c.js} +1 -1
  35. package/dist/development/{astro-context-OdlexHR4.js.map → astro-context-B9XKrz8c.js.map} +1 -1
  36. package/dist/development/astro-middleware.js +2 -2
  37. package/dist/development/{astro-request-DRKvDjsO.js → astro-request-C0eYQlmS.js} +2 -2
  38. package/dist/development/{astro-request-DRKvDjsO.js.map → astro-request-C0eYQlmS.js.map} +1 -1
  39. package/dist/development/astro-resumability-client.js +1 -1
  40. package/dist/development/astro-resumability-server.js +1 -1
  41. package/dist/development/astro-server.js +4 -4
  42. package/dist/development/{astro-shared-DBwINQav.js → astro-shared-CwBaV3Xu.js} +2 -2
  43. package/dist/development/{astro-shared-DBwINQav.js.map → astro-shared-CwBaV3Xu.js.map} +1 -1
  44. package/dist/development/astro.js +1 -1
  45. package/dist/development/brand-model.js +4 -4
  46. package/dist/development/brand.js +3 -3
  47. package/dist/development/{core-DrUd8x25.js → core-D1FWUMMC.js} +1 -1
  48. package/dist/development/{core-DrUd8x25.js.map → core-D1FWUMMC.js.map} +1 -1
  49. package/dist/development/{dom-CEVtlaav.js → dom-C1cVf5Vm.js} +4 -4
  50. package/dist/development/{dom-CEVtlaav.js.map → dom-C1cVf5Vm.js.map} +1 -1
  51. package/dist/development/floating.js +1 -1
  52. package/dist/development/hot.js +1 -1
  53. package/dist/{identity-ByJswZtF.js → development/identity-DWHH6jbd.js} +2 -2
  54. package/dist/development/{identity-B8wTFkyW.js.map → identity-DWHH6jbd.js.map} +1 -1
  55. package/dist/development/index.js +4 -4
  56. package/dist/development/{jsx-runtime-BGDPK50B.js → jsx-runtime-B2XxfA3E.js} +1 -1
  57. package/dist/development/{jsx-runtime-BGDPK50B.js.map → jsx-runtime-B2XxfA3E.js.map} +1 -1
  58. package/dist/development/jsx-runtime.js +1 -1
  59. package/dist/development/konva.js +4 -4
  60. package/dist/development/motion.js +1 -1
  61. package/dist/development/renderer.js +3 -3
  62. package/dist/development/{server-renderer-zAqEL1g1.js → server-renderer-B-L5tNg7.js} +4 -4
  63. package/dist/development/{server-renderer-zAqEL1g1.js.map → server-renderer-B-L5tNg7.js.map} +1 -1
  64. package/dist/development/server.js +1 -1
  65. package/dist/development/{src-CB7ruwRs.js → src-By4JY4qf.js} +2 -2
  66. package/dist/development/{src-CB7ruwRs.js.map → src-By4JY4qf.js.map} +1 -1
  67. package/dist/development/{three-CsZ6Od1C.js → three-F5D1OnE9.js} +4 -4
  68. package/dist/development/{three-CsZ6Od1C.js.map → three-F5D1OnE9.js.map} +1 -1
  69. package/dist/development/three.js +1 -1
  70. package/dist/{vite-WUiz1ju6.js → development/vite-BKxEE-ZO.js} +1 -1
  71. package/dist/development/{vite-WUiz1ju6.js.map → vite-BKxEE-ZO.js.map} +1 -1
  72. package/dist/development/vite.js +1 -1
  73. package/dist/{dom-DUpa3Sj2.js → dom-BbfEAPpR.js} +4 -4
  74. package/dist/{dom-DUpa3Sj2.js.map → dom-BbfEAPpR.js.map} +1 -1
  75. package/dist/floating.d.ts +1 -1
  76. package/dist/floating.js +1 -1
  77. package/dist/hot.d.ts +1 -1
  78. package/dist/hot.js +1 -1
  79. package/dist/{development/identity-B8wTFkyW.js → identity-wPtz6EJM.js} +2 -2
  80. package/dist/{identity-ByJswZtF.js.map → identity-wPtz6EJM.js.map} +1 -1
  81. package/dist/{index-DdA39aMv.d.ts → index-2AKIR8up.d.ts} +4 -4
  82. package/dist/{index-DdA39aMv.d.ts.map → index-2AKIR8up.d.ts.map} +1 -1
  83. package/dist/index.d.ts +3 -3
  84. package/dist/index.js +4 -4
  85. package/dist/{jsx-runtime-BGDPK50B.js → jsx-runtime-B2XxfA3E.js} +1 -1
  86. package/dist/{jsx-runtime-BGDPK50B.js.map → jsx-runtime-B2XxfA3E.js.map} +1 -1
  87. package/dist/{jsx-runtime-CCvcEosg.d.ts → jsx-runtime-CjiJSx5m.d.ts} +2 -2
  88. package/dist/{jsx-runtime-CCvcEosg.d.ts.map → jsx-runtime-CjiJSx5m.d.ts.map} +1 -1
  89. package/dist/jsx-runtime.d.ts +1 -1
  90. package/dist/jsx-runtime.js +1 -1
  91. package/dist/konva.d.ts +3 -3
  92. package/dist/konva.js +4 -4
  93. package/dist/motion.d.ts +1 -1
  94. package/dist/motion.js +1 -1
  95. package/dist/renderer.d.ts +1 -1
  96. package/dist/renderer.js +3 -3
  97. package/dist/{server-renderer-D7CdyOMo.js → server-renderer-CjTOgG1b.js} +4 -4
  98. package/dist/{server-renderer-D7CdyOMo.js.map → server-renderer-CjTOgG1b.js.map} +1 -1
  99. package/dist/server.d.ts +1 -1
  100. package/dist/server.js +1 -1
  101. package/dist/size.json +9 -9
  102. package/dist/{src-B2W_TA_X.js → src-BQlLP70K.js} +2 -2
  103. package/dist/{src-B2W_TA_X.js.map → src-BQlLP70K.js.map} +1 -1
  104. package/dist/{three-DcYxRXPW.js → three-DGOOlFXk.js} +4 -4
  105. package/dist/{three-DcYxRXPW.js.map → three-DGOOlFXk.js.map} +1 -1
  106. package/dist/three.d.ts +3 -3
  107. package/dist/three.js +1 -1
  108. package/dist/{development/vite-WUiz1ju6.js → vite-BKxEE-ZO.js} +1 -1
  109. package/dist/{vite-WUiz1ju6.js.map → vite-BKxEE-ZO.js.map} +1 -1
  110. package/dist/vite.js +1 -1
  111. package/package.json +8 -8
@@ -1,10 +1,10 @@
1
+ import { IMPLICIT, createRegularAtomFamily, disposeFromStore, findInStore, getFromStore, setIntoStore } from "atom.io/internal";
1
2
  import { browserApplication } from "./astro-application.js";
2
- import { n as failPreparation, r as storeContext } from "./astro-context-OdlexHR4.js";
3
- import { n as islandStore, t as island } from "./astro-shared-DBwINQav.js";
4
- import { b as useGetter } from "./core-DrUd8x25.js";
5
- import { n as render, t as hydrate } from "./dom-CEVtlaav.js";
3
+ import { n as failPreparation, r as storeContext } from "./astro-context-B9XKrz8c.js";
4
+ import { n as islandStore, t as island } from "./astro-shared-CwBaV3Xu.js";
5
+ import { b as useGetter } from "./core-D1FWUMMC.js";
6
+ import { n as render, t as hydrate } from "./dom-C1cVf5Vm.js";
6
7
  import { onRootDispose } from "./hot.js";
7
- import { IMPLICIT, createRegularAtomFamily, disposeFromStore, findInStore, getFromStore, setIntoStore } from "atom.io/internal";
8
8
  // src/astro-client.ts
9
9
  const roots = /* @__PURE__ */ new WeakMap();
10
10
  const states = /* @__PURE__ */ new WeakMap();
@@ -76,4 +76,4 @@ function failPreparation(error, dispose) {
76
76
  }
77
77
  export { failPreparation as n, storeContext as r, applicationContext as t };
78
78
 
79
- //# sourceMappingURL=astro-context-OdlexHR4.js.map
79
+ //# sourceMappingURL=astro-context-B9XKrz8c.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"astro-context-OdlexHR4.js","names":[],"sources":["../../src/astro-context.ts"],"sourcesContent":["import type {\n\tAstroApplicationContext,\n\tAstroStoreContext,\n} from \"./astro-shared.ts\"\n\ntype Lifetime = {\n\tsignal: AbortSignal\n\tonCleanup(cleanup: () => void): () => void\n\tdispose(): void\n\tcancelled: Promise<undefined>\n}\n\nfunction lifetime(): Lifetime {\n\tconst controller = new AbortController()\n\tconst cleanups = new Set<() => void>()\n\tlet cancel!: () => void\n\tconst cancelled = new Promise<undefined>((resolve) => {\n\t\tcancel = () => {\n\t\t\tresolve(undefined)\n\t\t}\n\t})\n\treturn {\n\t\tsignal: controller.signal,\n\t\tonCleanup(cleanup) {\n\t\t\tif (controller.signal.aborted) cleanup()\n\t\t\telse cleanups.add(cleanup)\n\t\t\treturn () => {\n\t\t\t\tcleanups.delete(cleanup)\n\t\t\t}\n\t\t},\n\t\tcancelled,\n\t\tdispose() {\n\t\t\tif (controller.signal.aborted) return\n\t\t\tcontroller.abort()\n\t\t\tcancel()\n\t\t\tconst errors: unknown[] = []\n\t\t\tfor (const cleanup of [...cleanups].reverse()) {\n\t\t\t\ttry {\n\t\t\t\t\tcleanup()\n\t\t\t\t} catch (error) {\n\t\t\t\t\terrors.push(error)\n\t\t\t\t}\n\t\t\t}\n\t\t\tcleanups.clear()\n\t\t\tif (errors.length)\n\t\t\t\tthrow new AggregateError(errors, `spa: Astro store cleanup failed`)\n\t\t},\n\t}\n}\n\nexport type Application = Lifetime &\n\tAstroApplicationContext & { canResume: boolean }\nexport function applicationContext(): Application {\n\tconst life = lifetime()\n\tconst resources = new Map<unknown, unknown>()\n\tlife.onCleanup(() => {\n\t\tresources.clear()\n\t})\n\treturn {\n\t\t...life,\n\t\tcanResume: true,\n\t\tget<T>(key: unknown, initialize: () => T): T {\n\t\t\tlife.signal.throwIfAborted()\n\t\t\tif (!resources.has(key)) resources.set(key, initialize())\n\t\t\treturn resources.get(key) as T\n\t\t},\n\t}\n}\n\n/** Island resources and shared application resources have distinct owners. */\nexport function storeContext(\n\telement?: HTMLElement,\n\tshared?: ReturnType<typeof applicationContext>,\n): {\n\tcontext: AstroStoreContext\n\tdispose(): void\n\tcancelled: Promise<undefined>\n} {\n\tconst life = lifetime()\n\tconst application = shared ?? applicationContext()\n\tif (shared) life.onCleanup(shared.onCleanup(life.dispose))\n\telse life.onCleanup(application.dispose)\n\treturn {\n\t\tcontext: {\n\t\t\telement,\n\t\t\tsignal: life.signal,\n\t\t\tonCleanup: life.onCleanup,\n\t\t\tapplication,\n\t\t},\n\t\tdispose: life.dispose,\n\t\tcancelled: life.cancelled,\n\t}\n}\n\nexport function failPreparation(error: unknown, dispose: () => void): never {\n\ttry {\n\t\tdispose()\n\t} catch (cleanup) {\n\t\tthrow new AggregateError([error, cleanup])\n\t}\n\tthrow error\n}\n"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WAAW,KAAK;GAChB;EACD;EACA,SAAS,KAAK;EACd,WAAW,KAAK;CACjB;AACD;AAEA,SAAgB,gBAAgB,OAAgB,SAA4B;CAC3E,IAAI;EACH,QAAQ;CACT,SAAS,SAAS;EACjB,MAAM,IAAI,eAAe,CAAC,OAAO,OAAO,CAAC;CAC1C;CACA,MAAM;AACP"}
1
+ {"version":3,"file":"astro-context-B9XKrz8c.js","names":[],"sources":["../../src/astro-context.ts"],"sourcesContent":["import type {\n\tAstroApplicationContext,\n\tAstroStoreContext,\n} from \"./astro-shared.ts\"\n\ntype Lifetime = {\n\tsignal: AbortSignal\n\tonCleanup(cleanup: () => void): () => void\n\tdispose(): void\n\tcancelled: Promise<undefined>\n}\n\nfunction lifetime(): Lifetime {\n\tconst controller = new AbortController()\n\tconst cleanups = new Set<() => void>()\n\tlet cancel!: () => void\n\tconst cancelled = new Promise<undefined>((resolve) => {\n\t\tcancel = () => {\n\t\t\tresolve(undefined)\n\t\t}\n\t})\n\treturn {\n\t\tsignal: controller.signal,\n\t\tonCleanup(cleanup) {\n\t\t\tif (controller.signal.aborted) cleanup()\n\t\t\telse cleanups.add(cleanup)\n\t\t\treturn () => {\n\t\t\t\tcleanups.delete(cleanup)\n\t\t\t}\n\t\t},\n\t\tcancelled,\n\t\tdispose() {\n\t\t\tif (controller.signal.aborted) return\n\t\t\tcontroller.abort()\n\t\t\tcancel()\n\t\t\tconst errors: unknown[] = []\n\t\t\tfor (const cleanup of [...cleanups].reverse()) {\n\t\t\t\ttry {\n\t\t\t\t\tcleanup()\n\t\t\t\t} catch (error) {\n\t\t\t\t\terrors.push(error)\n\t\t\t\t}\n\t\t\t}\n\t\t\tcleanups.clear()\n\t\t\tif (errors.length)\n\t\t\t\tthrow new AggregateError(errors, `spa: Astro store cleanup failed`)\n\t\t},\n\t}\n}\n\nexport type Application = Lifetime &\n\tAstroApplicationContext & { canResume: boolean }\nexport function applicationContext(): Application {\n\tconst life = lifetime()\n\tconst resources = new Map<unknown, unknown>()\n\tlife.onCleanup(() => {\n\t\tresources.clear()\n\t})\n\treturn {\n\t\t...life,\n\t\tcanResume: true,\n\t\tget<T>(key: unknown, initialize: () => T): T {\n\t\t\tlife.signal.throwIfAborted()\n\t\t\tif (!resources.has(key)) resources.set(key, initialize())\n\t\t\treturn resources.get(key) as T\n\t\t},\n\t}\n}\n\n/** Island resources and shared application resources have distinct owners. */\nexport function storeContext(\n\telement?: HTMLElement,\n\tshared?: ReturnType<typeof applicationContext>,\n): {\n\tcontext: AstroStoreContext\n\tdispose(): void\n\tcancelled: Promise<undefined>\n} {\n\tconst life = lifetime()\n\tconst application = shared ?? applicationContext()\n\tif (shared) life.onCleanup(shared.onCleanup(life.dispose))\n\telse life.onCleanup(application.dispose)\n\treturn {\n\t\tcontext: {\n\t\t\telement,\n\t\t\tsignal: life.signal,\n\t\t\tonCleanup: life.onCleanup,\n\t\t\tapplication,\n\t\t},\n\t\tdispose: life.dispose,\n\t\tcancelled: life.cancelled,\n\t}\n}\n\nexport function failPreparation(error: unknown, dispose: () => void): never {\n\ttry {\n\t\tdispose()\n\t} catch (cleanup) {\n\t\tthrow new AggregateError([error, cleanup])\n\t}\n\tthrow error\n}\n"],"mappings":";AAYA,SAAS,WAAqB;CAC7B,MAAM,aAAa,IAAI,gBAAgB;CACvC,MAAM,2BAAW,IAAI,IAAgB;CACrC,IAAI;CACJ,MAAM,YAAY,IAAI,SAAoB,YAAY;EACrD,eAAe;GACd,QAAQ,KAAA,CAAS;EAClB;CACD,CAAC;CACD,OAAO;EACN,QAAQ,WAAW;EACnB,UAAU,SAAS;GAClB,IAAI,WAAW,OAAO,SAAS,QAAQ;QAClC,SAAS,IAAI,OAAO;GACzB,aAAa;IACZ,SAAS,OAAO,OAAO;GACxB;EACD;EACA;EACA,UAAU;GACT,IAAI,WAAW,OAAO,SAAS;GAC/B,WAAW,MAAM;GACjB,OAAO;GACP,MAAM,SAAoB,CAAC;GAC3B,KAAK,MAAM,WAAW,CAAC,GAAG,QAAQ,CAAC,CAAC,QAAQ,GAC3C,IAAI;IACH,QAAQ;GACT,SAAS,OAAO;IACf,OAAO,KAAK,KAAK;GAClB;GAED,SAAS,MAAM;GACf,IAAI,OAAO,QACV,MAAM,IAAI,eAAe,QAAQ,iCAAiC;EACpE;CACD;AACD;AAIA,SAAgB,qBAAkC;CACjD,MAAM,OAAO,SAAS;CACtB,MAAM,4BAAY,IAAI,IAAsB;CAC5C,KAAK,gBAAgB;EACpB,UAAU,MAAM;CACjB,CAAC;CACD,OAAO;EACN,GAAG;EACH,WAAW;EACX,IAAO,KAAc,YAAwB;GAC5C,KAAK,OAAO,eAAe;GAC3B,IAAI,CAAC,UAAU,IAAI,GAAG,GAAG,UAAU,IAAI,KAAK,WAAW,CAAC;GACxD,OAAO,UAAU,IAAI,GAAG;EACzB;CACD;AACD;;AAGA,SAAgB,aACf,SACA,QAKC;CACD,MAAM,OAAO,SAAS;CACtB,MAAM,cAAc,UAAU,mBAAmB;CACjD,IAAI,QAAQ,KAAK,UAAU,OAAO,UAAU,KAAK,OAAO,CAAC;MACpD,KAAK,UAAU,YAAY,OAAO;CACvC,OAAO;EACN,SAAS;GACR;GACA,QAAQ,KAAK;GACb,WAAW,KAAK;GAChB;EACD;EACA,SAAS,KAAK;EACd,WAAW,KAAK;CACjB;AACD;AAEA,SAAgB,gBAAgB,OAAgB,SAA4B;CAC3E,IAAI;EACH,QAAQ;CACT,SAAS,SAAS;EACjB,MAAM,IAAI,eAAe,CAAC,OAAO,OAAO,CAAC;CAC1C;CACA,MAAM;AACP"}
@@ -1,5 +1,5 @@
1
- import { n as failPreparation } from "./astro-context-OdlexHR4.js";
2
- import { t as requestApplication } from "./astro-request-DRKvDjsO.js";
1
+ import { n as failPreparation } from "./astro-context-B9XKrz8c.js";
2
+ import { t as requestApplication } from "./astro-request-C0eYQlmS.js";
3
3
  // src/astro-middleware.ts
4
4
  /** Keep request resources alive until the streamed response is finished. */
5
5
  const onRequest = async ({ request }, next) => {
@@ -1,5 +1,5 @@
1
- import { t as applicationContext } from "./astro-context-OdlexHR4.js";
2
1
  import { IMPLICIT, Store } from "atom.io/internal";
2
+ import { t as applicationContext } from "./astro-context-B9XKrz8c.js";
3
3
  // src/astro-request.ts
4
4
  const requests = /* @__PURE__ */ new WeakMap();
5
5
  function createRequest() {
@@ -67,4 +67,4 @@ function syncDefinitions(store) {
67
67
  }
68
68
  export { requestApplication as t };
69
69
 
70
- //# sourceMappingURL=astro-request-DRKvDjsO.js.map
70
+ //# sourceMappingURL=astro-request-C0eYQlmS.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"astro-request-DRKvDjsO.js","names":[],"sources":["../../src/astro-request.ts"],"sourcesContent":["import type { RootStore } from \"atom.io/internal\"\nimport { IMPLICIT, Store } from \"atom.io/internal\"\n\nimport { applicationContext } from \"./astro-context.ts\"\n\nconst requests = new WeakMap<Request, ReturnType<typeof createRequest>>()\nfunction createRequest() {\n\tconst application = applicationContext()\n\tlet store: RootStore | undefined\n\treturn {\n\t\tapplication,\n\t\tget store(): RootStore {\n\t\t\tapplication.signal.throwIfAborted()\n\t\t\tif (!store) {\n\t\t\t\tstore = new Store(\n\t\t\t\t\t{ name: `spa-request`, lifespan: `ephemeral`, isProduction: true },\n\t\t\t\t\tIMPLICIT.STORE,\n\t\t\t\t) as RootStore\n\t\t\t\tconst selected = store\n\t\t\t\tapplication.onCleanup(() => {\n\t\t\t\t\tconst errors: unknown[] = []\n\t\t\t\t\tfor (const state of selected.atoms.values()) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tstate.cleanup?.()\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\terrors.push(error)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfor (const resource of selected.miscResources.values()) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresource[Symbol.dispose]()\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\terrors.push(error)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (errors.length)\n\t\t\t\t\t\tthrow new AggregateError(errors, `spa: request cleanup failed`)\n\t\t\t\t})\n\t\t\t}\n\t\t\tsyncDefinitions(store)\n\t\t\treturn store\n\t\t},\n\t}\n}\nexport function requestApplication(\n\trequest: Request,\n): ReturnType<typeof createRequest> {\n\tlet app = requests.get(request)\n\tif (!app) {\n\t\tapp = createRequest()\n\t\trequests.set(request, app)\n\t\tconst dispose = () => {\n\t\t\tapp!.application.dispose()\n\t\t}\n\t\trequest.signal.addEventListener(`abort`, dispose, { once: true })\n\t\tapp.application.onCleanup(() => {\n\t\t\trequest.signal.removeEventListener(`abort`, dispose)\n\t\t})\n\t\tif (request.signal.aborted) dispose()\n\t}\n\treturn app\n}\n/** Install definitions imported after an earlier island started this request. */\nfunction syncDefinitions(store: RootStore): void {\n\tconst source = IMPLICIT.STORE\n\tfor (const field of [\n\t\t`families`,\n\t\t`atoms`,\n\t\t`readonlySelectors`,\n\t\t`writableSelectors`,\n\t\t`transactions`,\n\t\t`timelineFamilies`,\n\t\t`timelines`,\n\t] as const) {\n\t\tfor (const [key, resource] of source[field]) {\n\t\t\tif (!store[field].has(key)) resource.install(store)\n\t\t}\n\t}\n}\n"],"mappings":";;;AAKA,MAAM,2BAAW,IAAI,QAAmD;AACxE,SAAS,gBAAgB;CACxB,MAAM,cAAc,mBAAmB;CACvC,IAAI;CACJ,OAAO;EACN;EACA,IAAI,QAAmB;GACtB,YAAY,OAAO,eAAe;GAClC,IAAI,CAAC,OAAO;IACX,QAAQ,IAAI,MACX;KAAE,MAAM;KAAe,UAAU;KAAa,cAAc;IAAK,GACjE,SAAS,KACV;IACA,MAAM,WAAW;IACjB,YAAY,gBAAgB;KAC3B,MAAM,SAAoB,CAAC;KAC3B,KAAK,MAAM,SAAS,SAAS,MAAM,OAAO,GACzC,IAAI;MACH,MAAM,UAAU;KACjB,SAAS,OAAO;MACf,OAAO,KAAK,KAAK;KAClB;KAED,KAAK,MAAM,YAAY,SAAS,cAAc,OAAO,GACpD,IAAI;MACH,SAAS,OAAO,QAAQ,CAAC;KAC1B,SAAS,OAAO;MACf,OAAO,KAAK,KAAK;KAClB;KAED,IAAI,OAAO,QACV,MAAM,IAAI,eAAe,QAAQ,6BAA6B;IAChE,CAAC;GACF;GACA,gBAAgB,KAAK;GACrB,OAAO;EACR;CACD;AACD;AACA,SAAgB,mBACf,SACmC;CACnC,IAAI,MAAM,SAAS,IAAI,OAAO;CAC9B,IAAI,CAAC,KAAK;EACT,MAAM,cAAc;EACpB,SAAS,IAAI,SAAS,GAAG;EACzB,MAAM,gBAAgB;GACrB,IAAK,YAAY,QAAQ;EAC1B;EACA,QAAQ,OAAO,iBAAiB,SAAS,SAAS,EAAE,MAAM,KAAK,CAAC;EAChE,IAAI,YAAY,gBAAgB;GAC/B,QAAQ,OAAO,oBAAoB,SAAS,OAAO;EACpD,CAAC;EACD,IAAI,QAAQ,OAAO,SAAS,QAAQ;CACrC;CACA,OAAO;AACR;;AAEA,SAAS,gBAAgB,OAAwB;CAChD,MAAM,SAAS,SAAS;CACxB,KAAK,MAAM,SAAS;EACnB;EACA;EACA;EACA;EACA;EACA;EACA;CACD,GACC,KAAK,MAAM,CAAC,KAAK,aAAa,OAAO,QACpC,IAAI,CAAC,MAAM,MAAM,CAAC,IAAI,GAAG,GAAG,SAAS,QAAQ,KAAK;AAGrD"}
1
+ {"version":3,"file":"astro-request-C0eYQlmS.js","names":[],"sources":["../../src/astro-request.ts"],"sourcesContent":["import type { RootStore } from \"atom.io/internal\"\nimport { IMPLICIT, Store } from \"atom.io/internal\"\n\nimport { applicationContext } from \"./astro-context.ts\"\n\nconst requests = new WeakMap<Request, ReturnType<typeof createRequest>>()\nfunction createRequest() {\n\tconst application = applicationContext()\n\tlet store: RootStore | undefined\n\treturn {\n\t\tapplication,\n\t\tget store(): RootStore {\n\t\t\tapplication.signal.throwIfAborted()\n\t\t\tif (!store) {\n\t\t\t\tstore = new Store(\n\t\t\t\t\t{ name: `spa-request`, lifespan: `ephemeral`, isProduction: true },\n\t\t\t\t\tIMPLICIT.STORE,\n\t\t\t\t) as RootStore\n\t\t\t\tconst selected = store\n\t\t\t\tapplication.onCleanup(() => {\n\t\t\t\t\tconst errors: unknown[] = []\n\t\t\t\t\tfor (const state of selected.atoms.values()) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tstate.cleanup?.()\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\terrors.push(error)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfor (const resource of selected.miscResources.values()) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresource[Symbol.dispose]()\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\terrors.push(error)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (errors.length)\n\t\t\t\t\t\tthrow new AggregateError(errors, `spa: request cleanup failed`)\n\t\t\t\t})\n\t\t\t}\n\t\t\tsyncDefinitions(store)\n\t\t\treturn store\n\t\t},\n\t}\n}\nexport function requestApplication(\n\trequest: Request,\n): ReturnType<typeof createRequest> {\n\tlet app = requests.get(request)\n\tif (!app) {\n\t\tapp = createRequest()\n\t\trequests.set(request, app)\n\t\tconst dispose = () => {\n\t\t\tapp!.application.dispose()\n\t\t}\n\t\trequest.signal.addEventListener(`abort`, dispose, { once: true })\n\t\tapp.application.onCleanup(() => {\n\t\t\trequest.signal.removeEventListener(`abort`, dispose)\n\t\t})\n\t\tif (request.signal.aborted) dispose()\n\t}\n\treturn app\n}\n/** Install definitions imported after an earlier island started this request. */\nfunction syncDefinitions(store: RootStore): void {\n\tconst source = IMPLICIT.STORE\n\tfor (const field of [\n\t\t`families`,\n\t\t`atoms`,\n\t\t`readonlySelectors`,\n\t\t`writableSelectors`,\n\t\t`transactions`,\n\t\t`timelineFamilies`,\n\t\t`timelines`,\n\t] as const) {\n\t\tfor (const [key, resource] of source[field]) {\n\t\t\tif (!store[field].has(key)) resource.install(store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AK,MAAM,CAAC,KAAK,aAAa,OAAO,QACpC,IAAI,CAAC,MAAM,MAAM,CAAC,IAAI,GAAG,GAAG,SAAS,QAAQ,KAAK;AAGrD"}
@@ -1,6 +1,6 @@
1
+ import { browserResumption, captureElement, createResumption } from "resumability/astro-client";
1
2
  import { browserApplication } from "./astro-application.js";
2
3
  import { createHydrator } from "./astro-client.js";
3
- import { browserResumption, captureElement, createResumption } from "resumability/astro-client";
4
4
  // src/astro-resumability-client.ts
5
5
  var astro_resumability_client_default = createHydrator((store, _props, { element, application }) => {
6
6
  const scopes = application.get(createResumption, () => /* @__PURE__ */ new WeakMap());
@@ -1,5 +1,5 @@
1
- import { createRenderer } from "./astro-server.js";
2
1
  import { resumableRenderer } from "resumability/astro-server";
2
+ import { createRenderer } from "./astro-server.js";
3
3
  // src/astro-resumability-server.ts
4
4
  var astro_resumability_server_default = resumableRenderer(createRenderer(true), { isolate: (component) => Boolean(component.createStore ?? component.isolate) });
5
5
  export { astro_resumability_server_default as default };
@@ -1,7 +1,7 @@
1
- import { n as failPreparation, r as storeContext } from "./astro-context-OdlexHR4.js";
2
- import { t as requestApplication } from "./astro-request-DRKvDjsO.js";
3
- import { n as islandStore, t as island } from "./astro-shared-DBwINQav.js";
4
- import { t as renderToStringWithReads } from "./server-renderer-zAqEL1g1.js";
1
+ import { n as failPreparation, r as storeContext } from "./astro-context-B9XKrz8c.js";
2
+ import { t as requestApplication } from "./astro-request-C0eYQlmS.js";
3
+ import { n as islandStore, t as island } from "./astro-shared-CwBaV3Xu.js";
4
+ import { t as renderToStringWithReads } from "./server-renderer-B-L5tNg7.js";
5
5
  // src/astro-server.ts
6
6
  const createRenderer = (awaitState = false) => ({
7
7
  name: `spa`,
@@ -1,5 +1,5 @@
1
- import { n as jsx } from "./jsx-runtime-BGDPK50B.js";
2
1
  import { IMPLICIT, Store } from "atom.io/internal";
2
+ import { n as jsx } from "./jsx-runtime-B2XxfA3E.js";
3
3
  // src/astro-shared.ts
4
4
  async function islandStore(component, props, context, shared, prepare) {
5
5
  const store = await (component.createStore?.(props, context) ?? shared ?? new Store({
@@ -28,4 +28,4 @@ function island(component, props, slots) {
28
28
  }
29
29
  export { islandStore as n, island as t };
30
30
 
31
- //# sourceMappingURL=astro-shared-DBwINQav.js.map
31
+ //# sourceMappingURL=astro-shared-CwBaV3Xu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"astro-shared-DBwINQav.js","names":[],"sources":["../../src/astro-shared.ts"],"sourcesContent":["import type { RootStore } from \"atom.io/internal\"\nimport { IMPLICIT, Store } from \"atom.io/internal\"\n\nimport type { Capability } from \"./capabilities.ts\"\nimport type { Component, SpaElement } from \"./core.ts\"\nimport { jsx } from \"./jsx-runtime.ts\"\n\nexport interface AstroApplicationContext {\n\t/** Whether the application still represents its initial server snapshot. */\n\treadonly canResume: boolean\n\treadonly signal: AbortSignal\n\tonCleanup(cleanup: () => void): void\n\t/** Initialize a resource once for this application lifetime. */\n\tget<T>(key: unknown, initialize: () => T): T\n}\nexport interface AstroStoreContext {\n\t/** Shared across default islands; private for explicitly isolated islands. */\n\tapplication: AstroApplicationContext\n\t/** The browser island host; undefined during server rendering. */\n\telement: HTMLElement | undefined\n\t/** Aborted when preparation is cancelled or the island is released. */\n\tsignal: AbortSignal\n\t/** Release resources even if preparation or rendering fails. */\n\tonCleanup(cleanup: () => void): void\n}\nexport type AstroStoreFactory<P = Record<string, any>> = (\n\tprops: P,\n\tcontext: AstroStoreContext,\n) => RootStore | Promise<RootStore>\nexport type AstroStorePreparation<P = Record<string, any>> = (\n\tstore: RootStore,\n\tprops: P,\n\tcontext: AstroStoreContext,\n) => void | Promise<void>\nexport type Island<P = any> = Component<P> & {\n\tspa?: boolean\n\t/** Capabilities are scoped to this island root on the server and client. */\n\tcapabilities?: readonly Capability[]\n\t/** Opt into a private island store instead of the shared application store. */\n\tisolate?: boolean\n\tcreateStore?: AstroStoreFactory<P>\n\tprepareStore?: AstroStorePreparation<P>\n}\nexport async function islandStore(\n\tcomponent: Island,\n\tprops: Record<string, any>,\n\tcontext: AstroStoreContext,\n\tshared?: RootStore,\n\tprepare?: AstroStorePreparation,\n): Promise<RootStore> {\n\tconst store = await (component.createStore?.(props, context) ??\n\t\tshared ??\n\t\t(new Store(\n\t\t\t{ name: `spa-island`, lifespan: `ephemeral`, isProduction: true },\n\t\t\tIMPLICIT.STORE,\n\t\t) as RootStore))\n\tcontext.signal.throwIfAborted()\n\tawait prepare?.(store, props, context)\n\tcontext.signal.throwIfAborted()\n\tawait component.prepareStore?.(store, props, context)\n\tcontext.signal.throwIfAborted()\n\treturn store\n}\nexport function island(\n\tcomponent: Island,\n\tprops: Record<string, any>,\n\tslots: Record<string, string>,\n): SpaElement {\n\tconst children = Object.fromEntries(\n\t\tObject.entries(slots).map(([name, html]) => [\n\t\t\tname,\n\t\t\tjsx(`astro-slot`, {\n\t\t\t\tkey: html,\n\t\t\t\tname: name === `default` ? undefined : name,\n\t\t\t\tinnerHTML: html,\n\t\t\t}),\n\t\t]),\n\t)\n\treturn jsx(component, {\n\t\t...props,\n\t\tslots: children,\n\t\tchildren: children[`default`],\n\t})\n}\n"],"mappings":";;;AA2CA,eAAsB,YACrB,WACA,OACA,SACA,QACA,SACqB;CACrB,MAAM,QAAQ,OAAO,UAAU,cAAc,OAAO,OAAO,KAC1D,UACC,IAAI,MACJ;EAAE,MAAM;EAAc,UAAU;EAAa,cAAc;CAAK,GAChE,SAAS,KACV;CACD,QAAQ,OAAO,eAAe;CAC9B,MAAM,UAAU,OAAO,OAAO,OAAO;CACrC,QAAQ,OAAO,eAAe;CAC9B,MAAM,UAAU,eAAe,OAAO,OAAO,OAAO;CACpD,QAAQ,OAAO,eAAe;CAC9B,OAAO;AACR;AACA,SAAgB,OACf,WACA,OACA,OACa;CACb,MAAM,WAAW,OAAO,YACvB,OAAO,QAAQ,KAAK,CAAC,CAAC,KAAK,CAAC,MAAM,UAAU,CAC3C,MACA,IAAI,cAAc;EACjB,KAAK;EACL,MAAM,SAAS,YAAY,KAAA,IAAY;EACvC,WAAW;CACZ,CAAC,CACF,CAAC,CACF;CACA,OAAO,IAAI,WAAW;EACrB,GAAG;EACH,OAAO;EACP,UAAU,SAAS;CACpB,CAAC;AACF"}
1
+ {"version":3,"file":"astro-shared-CwBaV3Xu.js","names":[],"sources":["../../src/astro-shared.ts"],"sourcesContent":["import type { RootStore } from \"atom.io/internal\"\nimport { IMPLICIT, Store } from \"atom.io/internal\"\n\nimport type { Capability } from \"./capabilities.ts\"\nimport type { Component, SpaElement } from \"./core.ts\"\nimport { jsx } from \"./jsx-runtime.ts\"\n\nexport interface AstroApplicationContext {\n\t/** Whether the application still represents its initial server snapshot. */\n\treadonly canResume: boolean\n\treadonly signal: AbortSignal\n\tonCleanup(cleanup: () => void): void\n\t/** Initialize a resource once for this application lifetime. */\n\tget<T>(key: unknown, initialize: () => T): T\n}\nexport interface AstroStoreContext {\n\t/** Shared across default islands; private for explicitly isolated islands. */\n\tapplication: AstroApplicationContext\n\t/** The browser island host; undefined during server rendering. */\n\telement: HTMLElement | undefined\n\t/** Aborted when preparation is cancelled or the island is released. */\n\tsignal: AbortSignal\n\t/** Release resources even if preparation or rendering fails. */\n\tonCleanup(cleanup: () => void): void\n}\nexport type AstroStoreFactory<P = Record<string, any>> = (\n\tprops: P,\n\tcontext: AstroStoreContext,\n) => RootStore | Promise<RootStore>\nexport type AstroStorePreparation<P = Record<string, any>> = (\n\tstore: RootStore,\n\tprops: P,\n\tcontext: AstroStoreContext,\n) => void | Promise<void>\nexport type Island<P = any> = Component<P> & {\n\tspa?: boolean\n\t/** Capabilities are scoped to this island root on the server and client. */\n\tcapabilities?: readonly Capability[]\n\t/** Opt into a private island store instead of the shared application store. */\n\tisolate?: boolean\n\tcreateStore?: AstroStoreFactory<P>\n\tprepareStore?: AstroStorePreparation<P>\n}\nexport async function islandStore(\n\tcomponent: Island,\n\tprops: Record<string, any>,\n\tcontext: AstroStoreContext,\n\tshared?: RootStore,\n\tprepare?: AstroStorePreparation,\n): Promise<RootStore> {\n\tconst store = await (component.createStore?.(props, context) ??\n\t\tshared ??\n\t\t(new Store(\n\t\t\t{ name: `spa-island`, lifespan: `ephemeral`, isProduction: true },\n\t\t\tIMPLICIT.STORE,\n\t\t) as RootStore))\n\tcontext.signal.throwIfAborted()\n\tawait prepare?.(store, props, context)\n\tcontext.signal.throwIfAborted()\n\tawait component.prepareStore?.(store, props, context)\n\tcontext.signal.throwIfAborted()\n\treturn store\n}\nexport function island(\n\tcomponent: Island,\n\tprops: Record<string, any>,\n\tslots: Record<string, string>,\n): SpaElement {\n\tconst children = Object.fromEntries(\n\t\tObject.entries(slots).map(([name, html]) => [\n\t\t\tname,\n\t\t\tjsx(`astro-slot`, {\n\t\t\t\tkey: html,\n\t\t\t\tname: name === `default` ? undefined : name,\n\t\t\t\tinnerHTML: html,\n\t\t\t}),\n\t\t]),\n\t)\n\treturn jsx(component, {\n\t\t...props,\n\t\tslots: children,\n\t\tchildren: children[`default`],\n\t})\n}\n"],"mappings":";;;AA2CA,eAAsB,YACrB,WACA,OACA,SACA,QACA,SACqB;CACrB,MAAM,QAAQ,OAAO,UAAU,cAAc,OAAO,OAAO,KAC1D,UACC,IAAI,MACJ;EAAE,MAAM;EAAc,UAAU;EAAa,cAAc;CAAK,GAChE,SAAS,KACV;CACD,QAAQ,OAAO,eAAe;CAC9B,MAAM,UAAU,OAAO,OAAO,OAAO;CACrC,QAAQ,OAAO,eAAe;CAC9B,MAAM,UAAU,eAAe,OAAO,OAAO,OAAO;CACpD,QAAQ,OAAO,eAAe;CAC9B,OAAO;AACR;AACA,SAAgB,OACf,WACA,OACA,OACa;CACb,MAAM,WAAW,OAAO,YACvB,OAAO,QAAQ,KAAK,CAAC,CAAC,KAAK,CAAC,MAAM,UAAU,CAC3C,MACA,IAAI,cAAc;EACjB,KAAK;EACL,MAAM,SAAS,YAAY,KAAA,IAAY;EACvC,WAAW;CACZ,CAAC,CACF,CAAC,CACF;CACA,OAAO,IAAI,WAAW;EACrB,GAAG;EACH,OAAO;EACP,UAAU,SAAS;CACpB,CAAC;AACF"}
@@ -1,4 +1,4 @@
1
- import { t as spa } from "./vite-WUiz1ju6.js";
1
+ import { t as spa } from "./vite-BKxEE-ZO.js";
2
2
  // src/astro.ts
3
3
  function integration(options = {}) {
4
4
  return {
@@ -23,7 +23,7 @@ const DZ2_ORBITAL_CAMERA = {
23
23
  /** @internal Used by contributor tools or implementation tests. */
24
24
  const DZ2_ORBITAL_LIGHTS = {
25
25
  core: {
26
- color: 16777215,
26
+ color: 0xffffff,
27
27
  intensity: 28,
28
28
  distance: 9,
29
29
  position: [
@@ -33,7 +33,7 @@ const DZ2_ORBITAL_LIGHTS = {
33
33
  ]
34
34
  },
35
35
  ambient: {
36
- color: 10475263,
36
+ color: 0x9fd6ff,
37
37
  intensity: 1.4
38
38
  }
39
39
  };
@@ -76,8 +76,8 @@ function createDz2OrbitalModel() {
76
76
  const orbital = new THREE.Group();
77
77
  setDz2OrbitalRotation(orbital);
78
78
  const lobeMaterial = new THREE.MeshToonMaterial({
79
- color: 16724838,
80
- emissive: 16724838,
79
+ color: 0xff3366,
80
+ emissive: 0xff3366,
81
81
  emissiveIntensity: .22,
82
82
  opacity: .82,
83
83
  side: THREE.DoubleSide
@@ -1,6 +1,6 @@
1
- import { f as onMount, p as owner, s as invalidate, u as onCleanup } from "./core-DrUd8x25.js";
2
- import { n as jsx$1 } from "./jsx-runtime-BGDPK50B.js";
3
1
  import { jsx } from "@atom.io/spa/jsx-runtime";
2
+ import { f as onMount, p as owner, s as invalidate, u as onCleanup } from "./core-D1FWUMMC.js";
3
+ import { n as jsx$1 } from "./jsx-runtime-B2XxfA3E.js";
4
4
  // src/BrandMark.module.css
5
5
  var BrandMark_module_default = { "class": "atom-io-spa-BrandMark-module-class" };
6
6
  // src/BrandMark.tsx
@@ -35,7 +35,7 @@ function BrandMark(props) {
35
35
  observer.disconnect();
36
36
  view.removeEventListener(`resize`, resize);
37
37
  });
38
- import("./BrandMarkScene-BDdC7K5M.js").then(({ BrandMarkScene: component }) => {
38
+ import("./BrandMarkScene-B282kBA3.js").then(({ BrandMarkScene: component }) => {
39
39
  if (active) {
40
40
  Scene = component;
41
41
  invalidate(scope);
@@ -462,4 +462,4 @@ function isPresent(scope) {
462
462
  }
463
463
  export { useSetter as C, within as D, useTransaction as E, useRef as S, useTimeline as T, scopeCapabilities as _, enqueue as a, useGetter as b, isPresent as c, onCommit as d, onMount as f, resolveStateToken as g, reportScopeError as h, dispose as i, observe as l, plain as m, createRoot as n, fail as o, owner as p, createScope as r, invalidate as s, RootBoundary as t, onCleanup as u, untrack as v, useStore as w, useId as x, useDisposal as y };
464
464
 
465
- //# sourceMappingURL=core-DrUd8x25.js.map
465
+ //# sourceMappingURL=core-D1FWUMMC.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"core-DrUd8x25.js","names":[],"sources":["../../src/core.ts"],"sourcesContent":["import type {\n\tdisposeState,\n\tReadableFamilyToken,\n\tReadableToken,\n\tRegularAtomFamilyToken,\n\tRegularAtomToken,\n\tSetter,\n\tTimelineFamilyToken,\n\tTimelineManageable,\n\tTimelineToken,\n\tTransactionToken,\n\tViewOf,\n\tWritableFamilyToken,\n\tWritableToken,\n} from \"atom.io\"\nimport type { Canonical } from \"atom.io/foundations/canonical\"\nimport type { RootStore } from \"atom.io/internal\"\nimport {\n\tactUponStore,\n\tclearTimelineInStore,\n\tdisposeFromStore,\n\tfindInStore,\n\tfindTimelineInStore,\n\tgetFromStore,\n\tgetTimelineTransactionAtHead,\n\tIMPLICIT,\n\tsetIntoStore,\n\tsubscribeToState,\n\tsubscribeToTimeline,\n\ttimeTravel,\n\ttimeTravelTransactionGroupInStore,\n\twithdraw,\n} from \"atom.io/internal\"\n\nimport type { Capability } from \"./capabilities.ts\"\nimport type {\n\tExitParticipant,\n\tPresenceCoordinator,\n\tPresenceTarget,\n} from \"./presence.ts\"\n\nexport type Cleanup = () => void\n// A callable interface permits the recursive Children union. A type alias does not.\n/* oxlint-disable typescript/prefer-function-type -- A callable interface is required for recursive Children. */\nexport interface Accessor<T> {\n\t(): T\n}\n/* oxlint-enable typescript/prefer-function-type */\nexport type Component<P = any> = (props: P) => Children\n/** A JSX descriptor for an intrinsic tag, component, or fragment. */\nexport interface SpaElement {\n\ttype: string | Component | null\n\tprops: Record<string, any>\n}\n/** Renderable content, including nested groups and reactive accessors. */\nexport type Children =\n\t| SpaElement\n\t| string\n\t| number\n\t| bigint\n\t| boolean\n\t| null\n\t| undefined\n\t| readonly Children[]\n\t| Accessor<Children>\nexport interface RootOptions {\n\tcapabilities?: readonly Capability[]\n\tstore?: RootStore\n\tidPrefix?: string\n\tonError?: (error: unknown) => void\n}\ninterface BoundaryOptions extends Omit<RootOptions, `capabilities`> {\n\t_capabilities?: Map<string, Capability>\n}\nexport interface Scope {\n\t_exiting?: boolean\n\t_exits?: Set<ExitParticipant>\n\t_targets?: Set<PresenceTarget>\n\t_root: Root\n\t_parent?: Scope | undefined\n\t_options?: BoundaryOptions | undefined\n\t_setupOrder: number\n\t_cleanups: Set<Cleanup | Scope>\n\t_updates: Cleanup[]\n\t_dead: boolean\n}\nexport interface Root extends Scope {\n\t_onRead?:\n\t\t| ((value: unknown, token: ReadableToken<unknown>, store: RootStore) => void)\n\t\t| undefined\n\t_presence?: PresenceCoordinator\n\t_presenceFactory?: Capability[`presence`]\n\t_capabilities: Map<string, Capability>\n\t_boundaryCapabilities?: Map<Capability, number>\n\t_prepareCapability?: ((capability: Capability) => void) | undefined\n\t_failure?: { error: unknown; report: Root[`error`] } | undefined\n\t_store: RootStore\n\t_prefix: string\n\t_id: number\n\t_queue: Set<Cleanup>\n\t_enqueueCount?: number\n\t_mounts: Cleanup[] | undefined\n\t_commits?: Set<CommitJob>\n\t_flushing?: boolean\n\t_forms?: Set<() => boolean>\n\t_host?: Element\n\tflush: Cleanup\n\terror: (error: unknown) => void\n}\n\ninterface CommitJob {\n\tscope: Scope\n\torder: number\n\trun: Cleanup\n\tloopError: Error | undefined\n}\ninterface CommitGroup {\n\torder: number\n\tchildren: CommitGroup[]\n\tjobs: CommitJob[]\n}\n\nexport let owner: Scope | undefined\ntype Subscribe = (notify: Cleanup) => Cleanup\nlet tracking: ((subscribe: Subscribe) => void) | undefined\nlet serial = 0\nlet setupOrder = 0\n\nfunction scopedErrorHandler(\n\tscope: Scope,\n\terror: unknown,\n): Root[`error`] | undefined {\n\tconst failure = scope._root._failure\n\treturn failure && Object.is(failure.error, error)\n\t\t? failure.report\n\t\t: scope._options?.onError\n}\nfunction throwScopedError(\n\tscope: Scope,\n\terror: unknown,\n\treport = scopedErrorHandler(scope, error),\n): never {\n\tif (report) scope._root._failure = { error, report }\n\tthrow error\n}\nexport function within<T>(scope: Scope, run: () => T): T {\n\tconst previous = owner\n\towner = scope\n\ttry {\n\t\treturn run()\n\t} catch (error) {\n\t\tthrowScopedError(scope, error)\n\t} finally {\n\t\towner = previous\n\t}\n}\nexport function untrack<T>(run: () => T): T {\n\tconst previous = tracking\n\ttracking = undefined\n\ttry {\n\t\treturn run()\n\t} finally {\n\t\ttracking = previous\n\t}\n}\nexport function createScope(parent?: Scope): Scope {\n\tconst child: Scope = {\n\t\t_root: parent?._root as Root,\n\t\t_parent: parent,\n\t\t_options: parent?._options,\n\t\t_setupOrder: setupOrder++,\n\t\t_cleanups: new Set(),\n\t\t_updates: [],\n\t\t_dead: false,\n\t}\n\tparent?._cleanups.add(child)\n\treturn child\n}\nexport function fail(scope: Scope, error: unknown): never {\n\tconst report = scopedErrorHandler(scope, error)\n\ttry {\n\t\tdispose(scope)\n\t} catch (cleanup) {\n\t\tthrowScopedError(scope, new AggregateError([error, cleanup]), report)\n\t}\n\tthrow error\n}\nexport function dispose(scope: Scope): void {\n\tif (scope._dead) return\n\tscope._dead = true\n\tconst errors: unknown[] = []\n\tlet report: Root[`error`] | undefined\n\tconst record = (error: unknown) => {\n\t\terrors.push(error)\n\t\t// Keep the first boundary handler as nested disposal wraps its errors.\n\t\treport ??= scopedErrorHandler(scope, error)\n\t}\n\ttry {\n\t\tscope._root._presence?.forget(scope)\n\t} catch (error) {\n\t\trecord(error)\n\t}\n\tfor (const cleanup of [...scope._cleanups].reverse()) {\n\t\ttry {\n\t\t\ttypeof cleanup === `function` ? cleanup() : dispose(cleanup)\n\t\t} catch (error) {\n\t\t\trecord(error)\n\t\t}\n\t}\n\tscope._parent?._cleanups.delete(scope)\n\tscope._cleanups.clear()\n\tscope._targets?.clear()\n\tscope._updates.length = 0\n\tif (errors.length) throwScopedError(scope, new AggregateError(errors), report)\n}\nexport function invalidate(scope: Scope): void {\n\tfor (const run of scope._updates) enqueue(scope, run)\n\tfor (const child of scope._cleanups)\n\t\tif (typeof child !== `function`) invalidate(child)\n}\nexport function enqueue(scope: Scope, run: Cleanup): void {\n\tif (!isPresent(scope)) return\n\tconst root = scope._root\n\tif (!root._queue.size && !root._flushing)\n\t\tqueueMicrotask(() => {\n\t\t\ttry {\n\t\t\t\troot.flush()\n\t\t\t} catch (error) {\n\t\t\t\tconst report = scopedErrorHandler(root, error) ?? root.error\n\t\t\t\troot._failure = undefined\n\t\t\t\treport(error)\n\t\t\t}\n\t\t})\n\t// A write can invalidate an observer that is already pending.\n\tif (import.meta.env.DEV) root._enqueueCount = (root._enqueueCount ?? 0) + 1\n\troot._queue.add(run)\n}\n\nfunction runCommits(root: Root, pending: Set<CommitJob>): CommitJob | undefined {\n\tconst top: CommitGroup = { order: root._setupOrder, children: [], jobs: [] }\n\tconst groups = new Map<Scope, CommitGroup>([[root, top]])\n\t// Keep only branches with pending work. Visit siblings in setup order.\n\tconst groupFor = (scope: Scope): CommitGroup => {\n\t\tlet group = groups.get(scope)\n\t\tif (!group) {\n\t\t\tgroup = { order: scope._setupOrder, children: [], jobs: [] }\n\t\t\tgroups.set(scope, group)\n\t\t\tgroupFor(scope._parent!).children.push(group)\n\t\t}\n\t\treturn group\n\t}\n\tfor (const job of [...pending].sort((a, b) => a.order - b.order))\n\t\tgroupFor(job.scope).jobs.push(job)\n\tlet last: CommitJob | undefined\n\tconst visit = (group: CommitGroup) => {\n\t\tfor (const child of group.children.sort((a, b) => a.order - b.order))\n\t\t\tvisit(child)\n\t\tfor (const job of group.jobs) {\n\t\t\tif (pending.delete(job) && isPresent(job.scope)) {\n\t\t\t\tconst enqueueCount = import.meta.env.DEV ? root._enqueueCount : undefined\n\t\t\t\tjob.run()\n\t\t\t\tif (import.meta.env.DEV && root._enqueueCount !== enqueueCount)\n\t\t\t\t\tlast = job\n\t\t\t}\n\t\t}\n\t}\n\tvisit(top)\n\treturn last\n}\n\nfunction capabilityMap(list: readonly Capability[] | undefined) {\n\tconst capabilities = new Map<string, Capability>()\n\tfor (const capability of list ?? []) {\n\t\tif (capabilities.has(capability.namespace))\n\t\t\tthrow new Error(`spa: duplicate capability ${capability.namespace}`)\n\t\tcapabilities.set(capability.namespace, capability)\n\t}\n\treturn capabilities\n}\nfunction registerPresence(\n\troot: Root,\n\tcapability: Capability,\n\tshared = false,\n): void {\n\tconst create = capability.presence\n\tif (!create) return\n\tif (root._presence) {\n\t\tif (!shared || root._presenceFactory !== create)\n\t\t\tthrow new Error(`spa: multiple presence coordinators`)\n\t} else {\n\t\troot._presence = create(root)\n\t\troot._presenceFactory = create\n\t}\n}\nexport function scopeCapabilities(scope: Scope): Map<string, Capability> {\n\treturn scope._options?._capabilities ?? scope._root._capabilities\n}\nexport function reportScopeError(scope: Scope, error: unknown): void {\n\tconst report = scopedErrorHandler(scope, error) ?? scope._root.error\n\ttry {\n\t\tfail(scope._root, error)\n\t} catch (failure) {\n\t\tscope._root._failure = undefined\n\t\treport(failure)\n\t}\n}\n\n/** Override root options for these children while sharing their parent's ownership. */\nexport function RootBoundary(\n\tprops: RootOptions & { children?: Children },\n): Children {\n\tconst scope = owner!\n\tconst { store, idPrefix, onError, capabilities } = props\n\tconst options = { ...scope._options }\n\tif (store !== undefined) options.store = store\n\tif (idPrefix !== undefined) options.idPrefix = idPrefix\n\tif (onError !== undefined) options.onError = onError\n\tif (capabilities !== undefined) {\n\t\toptions._capabilities = capabilityMap(capabilities)\n\t\tconst root = scope._root\n\t\tconst active = (root._boundaryCapabilities ??= new Map())\n\t\tfor (const capability of options._capabilities.values()) {\n\t\t\tregisterPresence(root, capability, true)\n\t\t\tactive.set(capability, (active.get(capability) ?? 0) + 1)\n\t\t\tscope._cleanups.add(() => {\n\t\t\t\tconst remaining = active.get(capability)! - 1\n\t\t\t\tif (remaining) active.set(capability, remaining)\n\t\t\t\telse active.delete(capability)\n\t\t\t})\n\t\t\troot._prepareCapability?.(capability)\n\t\t}\n\t}\n\tscope._options = options\n\treturn () => props.children\n}\n\nexport function createRoot(options: RootOptions = {}, server = false): Root {\n\tconst capabilities = capabilityMap(options.capabilities)\n\tconst root = {\n\t\t_capabilities: capabilities,\n\t\t_store: options.store ?? IMPLICIT.STORE,\n\t\t_prefix: options.idPrefix ?? `w${serial++}`,\n\t\t_id: 0,\n\t\t...createScope(),\n\t\t_queue: new Set(),\n\t\t_mounts: server ? undefined : [],\n\t} as unknown as Root\n\troot._root = root\n\troot.error =\n\t\toptions.onError ??\n\t\t((error) => {\n\t\t\tthrow error\n\t\t})\n\tfor (const capability of capabilities.values())\n\t\tregisterPresence(root, capability)\n\tconst hasWrites = () => root._queue.size || root._mounts!.length\n\tconst hasWork = () => hasWrites() || root._commits?.size\n\tlet flushPendingWrites: Cleanup | undefined\n\troot.flush = () => {\n\t\tconst nested = root._flushing\n\t\tif (!(nested ? hasWrites() : hasWork()) && !root._forms?.size) return\n\t\troot._flushing = true\n\t\ttry {\n\t\t\tif (nested) {\n\t\t\t\t// The outer flush owns commit dispatch. Mount callbacks can drain writes.\n\t\t\t\tflushPendingWrites?.()\n\t\t\t\treturn\n\t\t\t}\n\t\t\troot._failure = undefined\n\t\t\tlet passes = 0\n\t\t\tlet lastCommit: CommitJob | undefined\n\t\t\tconst checkLoop = () => {\n\t\t\t\tif (import.meta.env.DEV && ++passes > 100)\n\t\t\t\t\tthrow lastCommit?.loopError ?? new Error(`spa: update loop`)\n\t\t\t}\n\t\t\tconst runWriteBatch = () => {\n\t\t\t\tconst commits = new Map<Capability, Cleanup | undefined>()\n\t\t\t\tconst prepare = (capability: Capability) => {\n\t\t\t\t\tif (!commits.has(capability))\n\t\t\t\t\t\tcommits.set(capability, capability.beforeUpdate?.(root))\n\t\t\t\t}\n\t\t\t\tconst previous = root._prepareCapability\n\t\t\t\troot._prepareCapability = prepare\n\t\t\t\tlet formsReady = true\n\t\t\t\ttry {\n\t\t\t\t\tfor (const capability of capabilities.values()) prepare(capability)\n\t\t\t\t\tfor (const capability of root._boundaryCapabilities?.keys() ?? [])\n\t\t\t\t\t\tprepare(capability)\n\t\t\t\t\twhile (hasWrites()) {\n\t\t\t\t\t\tcheckLoop()\n\t\t\t\t\t\tfor (const run of [...root._queue])\n\t\t\t\t\t\t\tif (root._queue.delete(run)) run()\n\t\t\t\t\t\tfor (const run of root._mounts!.splice(0)) run()\n\t\t\t\t\t}\n\t\t\t\t\tfor (const restore of root._forms ?? [])\n\t\t\t\t\t\tif (!untrack(restore)) formsReady = false\n\t\t\t\t} finally {\n\t\t\t\t\troot._prepareCapability = previous\n\t\t\t\t\tfor (const commit of commits.values()) commit?.()\n\t\t\t\t}\n\t\t\t\treturn formsReady\n\t\t\t}\n\t\t\tdo {\n\t\t\t\tflushPendingWrites = runWriteBatch\n\t\t\t\tconst formsReady = runWriteBatch()\n\t\t\t\tflushPendingWrites = undefined\n\t\t\t\tif (!hasWrites()) {\n\t\t\t\t\t// Form event completion schedules a flush to restore the controls.\n\t\t\t\t\tif (!formsReady || !root._commits?.size) break\n\t\t\t\t\tcheckLoop()\n\t\t\t\t\tlastCommit = runCommits(root, root._commits) ?? lastCommit\n\t\t\t\t}\n\t\t\t} while (hasWork())\n\t\t\troot._failure = undefined\n\t\t} catch (error) {\n\t\t\tflushPendingWrites = undefined\n\t\t\tfail(root, error)\n\t\t} finally {\n\t\t\tif (!nested) root._flushing = false\n\t\t}\n\t}\n\treturn root\n}\n/** Return the atom.io store selected by the current owner. */\nexport function useStore(): RootStore {\n\treturn owner!._options?.store ?? owner!._root._store\n}\n/** Return atom.io disposal bound to the current root's store. */\nexport function useDisposal(): typeof disposeState {\n\treturn disposeFromStore.bind(null, useStore()) as typeof disposeState\n}\nexport function onCleanup(cleanup: Cleanup): void {\n\towner!._cleanups.add(cleanup)\n}\nexport function onMount(run: Cleanup): void {\n\tconst scope = owner!\n\tscope._root._mounts?.push(() => {\n\t\tif (!scope._dead)\n\t\t\twithin(scope, () => {\n\t\t\t\tuntrack(run)\n\t\t\t})\n\t})\n}\n/** Observe state during setup and apply changes after the root's writes. */\nexport function onCommit<T>(\n\tread: Accessor<T>,\n\tapply: (value: T, previous: T | undefined) => void | Cleanup,\n): void {\n\tconst scope = owner!\n\tconst root = scope._root\n\tif (!root._mounts) return\n\tconst pending = (root._commits ??= new Set())\n\tlet ran = false\n\tlet next: T\n\tlet previous: T | undefined\n\tlet cleanup: Cleanup | void\n\tconst clear = () => {\n\t\tconst release = cleanup\n\t\tcleanup = undefined\n\t\tif (release) untrack(release)\n\t}\n\tconst job: CommitJob = {\n\t\tscope,\n\t\torder: setupOrder++,\n\t\t// The registration stack identifies the component in a feedback loop.\n\t\tloopError: import.meta.env.DEV\n\t\t\t? new Error(`spa: onCommit update loop`)\n\t\t\t: undefined,\n\t\trun() {\n\t\t\twithin(scope, () => {\n\t\t\t\tuntrack(() => {\n\t\t\t\t\tclear()\n\t\t\t\t\tif (!isPresent(scope)) return\n\t\t\t\t\tconst old = previous\n\t\t\t\t\tprevious = next\n\t\t\t\t\tran = true\n\t\t\t\t\tcleanup = apply(next, old)\n\t\t\t\t\tif (scope._dead) clear()\n\t\t\t\t})\n\t\t\t})\n\t\t},\n\t}\n\tscope._cleanups.add(() => {\n\t\tpending.delete(job)\n\t\tclear()\n\t})\n\tobserve(scope, read, (value) => {\n\t\tnext = value\n\t\tif (!ran || !Object.is(value, previous)) pending.add(job)\n\t\telse pending.delete(job)\n\t})\n}\nexport function useId(): string {\n\tconst root = owner!._root\n\treturn `${owner!._options?.idPrefix ?? root._prefix}-${root._id++}`\n}\n\nexport function observe<T>(\n\tscope: Scope,\n\tread: Accessor<T>,\n\tapply: (value: T) => void,\n): void {\n\tconst subscriptions = new Map<Subscribe, Cleanup>()\n\tconst run = () => {\n\t\tif (!isPresent(scope)) return\n\t\tconst used = new Set<Subscribe>()\n\t\tconst previous = tracking\n\t\ttracking = (subscribe) => {\n\t\t\tused.add(subscribe)\n\t\t\tif (!subscriptions.has(subscribe))\n\t\t\t\tsubscriptions.set(\n\t\t\t\t\tsubscribe,\n\t\t\t\t\tsubscribe(() => {\n\t\t\t\t\t\tenqueue(scope, run)\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t}\n\t\tlet value: T\n\t\ttry {\n\t\t\tvalue = within(scope, read)\n\t\t} finally {\n\t\t\ttracking = previous\n\t\t\tfor (const [subscribe, unsubscribe] of subscriptions)\n\t\t\t\tif (!used.has(subscribe)) {\n\t\t\t\t\tunsubscribe()\n\t\t\t\t\tsubscriptions.delete(subscribe)\n\t\t\t\t}\n\t\t}\n\t\twithin(scope, () => {\n\t\t\tuntrack(() => {\n\t\t\t\tapply(value)\n\t\t\t})\n\t\t})\n\t}\n\tscope._updates.push(run)\n\tscope._cleanups.add(() => {\n\t\tscope._root._queue.delete(run)\n\t\tfor (const unsubscribe of subscriptions.values()) unsubscribe()\n\t})\n\trun()\n}\n\n/** Resolve a fixed family key in the current owner's store. */\nexport function resolveStateToken(token: any, key?: Canonical): any {\n\tconst store = useStore()\n\treturn token.type.endsWith(`_family`) ? findInStore(store, token, key!) : token\n}\n\n/** Capture a token for this instance. Change the component key to change its token. */\nexport function useGetter<T, E = never>(\n\ttoken: ReadableToken<T, any, E>,\n): Accessor<ViewOf<T | E>>\nexport function useGetter<T, K extends Canonical, E = never>(\n\tfamily: ReadableFamilyToken<T, K, E>,\n\tkey: NoInfer<K>,\n): Accessor<ViewOf<T | E>>\nexport function useGetter(token: any, key?: Canonical): Accessor<any> {\n\ttoken = resolveStateToken(token, key)\n\tconst root = owner!._root\n\tconst store = useStore()\n\tconst subscribe: Subscribe = (notify) =>\n\t\tsubscribeToState(store, token, `spa:${serial++}`, notify)\n\treturn () => {\n\t\tconst value = getFromStore(store, token)\n\t\troot._onRead?.(value, token, store)\n\t\ttracking?.(subscribe)\n\t\treturn value\n\t}\n}\nexport function useSetter<T>(\n\ttoken: WritableToken<T, any, any>,\n): (value: T | Setter<T>) => void\nexport function useSetter<T, K extends Canonical>(\n\tfamily: WritableFamilyToken<T, K, any>,\n\tkey: NoInfer<K>,\n): (value: T | Setter<T>) => void\nexport function useSetter(token: any, key?: Canonical): (value: any) => void {\n\ttoken = resolveStateToken(token, key)\n\tconst store = useStore()\n\treturn (value) => {\n\t\tsetIntoStore(store, token, value)\n\t}\n}\nexport function useTransaction<F extends (...args: any[]) => any>(\n\ttoken: TransactionToken<F>,\n): (...args: Parameters<F>) => ReturnType<F> {\n\treturn actUponStore(useStore(), token, `spa:${serial++}`)\n}\n\nconst refs = new WeakMap<RootStore, Map<string, object>>()\nexport function useRef<E extends Element>(\n\ttoken: RegularAtomToken<E | null>,\n): (element: E | null) => void\nexport function useRef<E extends Element, K extends Canonical>(\n\tfamily: RegularAtomFamilyToken<E | null, K>,\n\tkey: NoInfer<K>,\n): (element: E | null) => void\nexport function useRef<E extends Element>(\n\ttoken: any,\n\tkey?: Canonical,\n): (element: E | null) => void {\n\ttoken = resolveStateToken(token, key)\n\tconst store = useStore()\n\tconst owners = refs.get(store) ?? new Map<string, object>()\n\trefs.set(store, owners)\n\tconst identity = {}\n\tlet held: E | null = null\n\treturn (element) => {\n\t\tif (element) {\n\t\t\theld = element\n\t\t\towners.set(token.key, identity)\n\t\t\tsetIntoStore(store, token, element)\n\t\t} else if (owners.get(token.key) === identity) {\n\t\t\towners.delete(token.key)\n\t\t\tif (getFromStore(store, token) === held) setIntoStore(store, token, null)\n\t\t\theld = null\n\t\t}\n\t}\n}\nexport interface TimelineControls {\n\tgetCursor(): number\n\tgetLength(): number\n\tundo(): void\n\tredo(): void\n\tclear(): void\n\tgetTransaction(): { undo?: Cleanup; redo?: Cleanup }\n}\nexport function useTimeline<M extends TimelineManageable>(\n\ttoken: TimelineToken<M>,\n): TimelineControls\nexport function useTimeline<K extends Canonical, M extends TimelineManageable>(\n\tfamily: TimelineFamilyToken<K, M>,\n\tkey: NoInfer<K>,\n): TimelineControls\nexport function useTimeline(token: any, key?: Canonical): TimelineControls {\n\tconst store = useStore()\n\tconst selected: TimelineToken<any> =\n\t\ttoken.type === `timeline_family`\n\t\t\t? findTimelineInStore(store, token, key!)\n\t\t\t: token\n\tconst subscribe: Subscribe = (notify) =>\n\t\tsubscribeToTimeline(store, selected, `spa:${serial++}`, notify)\n\tconst read = () => {\n\t\tconst timeline = withdraw(store, selected)\n\t\ttracking?.(subscribe)\n\t\treturn timeline\n\t}\n\treturn {\n\t\tgetCursor: () => read().at,\n\t\tgetLength: () => read().history.length,\n\t\tundo: () => {\n\t\t\ttimeTravel(store, `undo`, selected)\n\t\t},\n\t\tredo: () => {\n\t\t\ttimeTravel(store, `redo`, selected)\n\t\t},\n\t\tclear: () => {\n\t\t\tclearTimelineInStore(store, selected)\n\t\t},\n\t\tgetTransaction: () => {\n\t\t\tconst timeline = read()\n\t\t\tconst controls: ReturnType<TimelineControls[`getTransaction`]> = {}\n\t\t\tfor (const direction of [`undo`, `redo`] as const) {\n\t\t\t\tconst group = getTimelineTransactionAtHead(timeline, direction)\n\t\t\t\tif (group)\n\t\t\t\t\tcontrols[direction] = () => {\n\t\t\t\t\t\ttimeTravelTransactionGroupInStore(store, direction, group)\n\t\t\t\t\t}\n\t\t\t}\n\t\t\treturn controls\n\t\t},\n\t}\n}\n\nexport function plain(value: Children): string {\n\tif (typeof value === `function`) return plain(value())\n\tif (Array.isArray(value)) return value.map(plain).join(``)\n\tif (value == null || typeof value === `boolean`) return ``\n\tif (import.meta.env.DEV && typeof value === `object`)\n\t\tthrow new Error(`spa: text required`)\n\t// oxlint-disable-next-line typescript/no-base-to-string -- Valid text children are primitives here; development rejects malformed object children.\n\treturn String(value)\n}\n\nexport function isPresent(scope: Scope): boolean {\n\tfor (let at: Scope | undefined = scope; at; at = at._parent)\n\t\tif (at._dead || at._exiting) return false\n\treturn true\n}\n"],"mappings":";;AA0HA,IAAW;AAEX,IAAI;AACJ,IAAI,SAAS;AACb,IAAI,aAAa;AAEjB,SAAS,mBACR,OACA,OAC4B;CAC5B,MAAM,UAAU,MAAM,MAAM;CAC5B,OAAO,WAAW,OAAO,GAAG,QAAQ,OAAO,KAAK,IAC7C,QAAQ,SACR,MAAM,UAAU;AACpB;AACA,SAAS,iBACR,OACA,OACA,SAAS,mBAAmB,OAAO,KAAK,GAChC;CACR,IAAI,QAAQ,MAAM,MAAM,WAAW;EAAE;EAAO;CAAO;CACnD,MAAM;AACP;AACA,SAAgB,OAAU,OAAc,KAAiB;CACxD,MAAM,WAAW;CACjB,QAAQ;CACR,IAAI;EACH,OAAO,IAAI;CACZ,SAAS,OAAO;EACf,iBAAiB,OAAO,KAAK;CAC9B,UAAU;EACT,QAAQ;CACT;AACD;AACA,SAAgB,QAAW,KAAiB;CAC3C,MAAM,WAAW;CACjB,WAAW,KAAA;CACX,IAAI;EACH,OAAO,IAAI;CACZ,UAAU;EACT,WAAW;CACZ;AACD;AACA,SAAgB,YAAY,QAAuB;CAClD,MAAM,QAAe;EACpB,OAAO,QAAQ;EACf,SAAS;EACT,UAAU,QAAQ;EAClB,aAAa;EACb,2BAAW,IAAI,IAAI;EACnB,UAAU,CAAC;EACX,OAAO;CACR;CACA,QAAQ,UAAU,IAAI,KAAK;CAC3B,OAAO;AACR;AACA,SAAgB,KAAK,OAAc,OAAuB;CACzD,MAAM,SAAS,mBAAmB,OAAO,KAAK;CAC9C,IAAI;EACH,QAAQ,KAAK;CACd,SAAS,SAAS;EACjB,iBAAiB,OAAO,IAAI,eAAe,CAAC,OAAO,OAAO,CAAC,GAAG,MAAM;CACrE;CACA,MAAM;AACP;A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KAAK,GAAG,OAAO,MAAM,IAAI,KAAK,CAAC,CAAC,KAAK,EAAE;CACzD,IAAI,SAAS,QAAQ,OAAO,UAAU,WAAW,OAAO;CACxD,IAA2B,OAAO,UAAU,UAC3C,MAAM,IAAI,MAAM,oBAAoB;CAErC,OAAO,OAAO,KAAK;AACpB;AAEA,SAAgB,UAAU,OAAuB;CAChD,KAAK,IAAI,KAAwB,OAAO,IAAI,KAAK,GAAG,SACnD,IAAI,GAAG,SAAS,GAAG,UAAU,OAAO;CACrC,OAAO;AACR"}
1
+ {"version":3,"file":"core-D1FWUMMC.js","names":[],"sources":["../../src/core.ts"],"sourcesContent":["import type {\n\tdisposeState,\n\tReadableFamilyToken,\n\tReadableToken,\n\tRegularAtomFamilyToken,\n\tRegularAtomToken,\n\tSetter,\n\tTimelineFamilyToken,\n\tTimelineManageable,\n\tTimelineToken,\n\tTransactionToken,\n\tViewOf,\n\tWritableFamilyToken,\n\tWritableToken,\n} from \"atom.io\"\nimport type { Canonical } from \"atom.io/foundations/canonical\"\nimport type { RootStore } from \"atom.io/internal\"\nimport {\n\tactUponStore,\n\tclearTimelineInStore,\n\tdisposeFromStore,\n\tfindInStore,\n\tfindTimelineInStore,\n\tgetFromStore,\n\tgetTimelineTransactionAtHead,\n\tIMPLICIT,\n\tsetIntoStore,\n\tsubscribeToState,\n\tsubscribeToTimeline,\n\ttimeTravel,\n\ttimeTravelTransactionGroupInStore,\n\twithdraw,\n} from \"atom.io/internal\"\n\nimport type { Capability } from \"./capabilities.ts\"\nimport type {\n\tExitParticipant,\n\tPresenceCoordinator,\n\tPresenceTarget,\n} from \"./presence.ts\"\n\nexport type Cleanup = () => void\n// A callable interface permits the recursive Children union. A type alias does not.\n/* oxlint-disable typescript/prefer-function-type -- A callable interface is required for recursive Children. */\nexport interface Accessor<T> {\n\t(): T\n}\n/* oxlint-enable typescript/prefer-function-type */\nexport type Component<P = any> = (props: P) => Children\n/** A JSX descriptor for an intrinsic tag, component, or fragment. */\nexport interface SpaElement {\n\ttype: string | Component | null\n\tprops: Record<string, any>\n}\n/** Renderable content, including nested groups and reactive accessors. */\nexport type Children =\n\t| SpaElement\n\t| string\n\t| number\n\t| bigint\n\t| boolean\n\t| null\n\t| undefined\n\t| readonly Children[]\n\t| Accessor<Children>\nexport interface RootOptions {\n\tcapabilities?: readonly Capability[]\n\tstore?: RootStore\n\tidPrefix?: string\n\tonError?: (error: unknown) => void\n}\ninterface BoundaryOptions extends Omit<RootOptions, `capabilities`> {\n\t_capabilities?: Map<string, Capability>\n}\nexport interface Scope {\n\t_exiting?: boolean\n\t_exits?: Set<ExitParticipant>\n\t_targets?: Set<PresenceTarget>\n\t_root: Root\n\t_parent?: Scope | undefined\n\t_options?: BoundaryOptions | undefined\n\t_setupOrder: number\n\t_cleanups: Set<Cleanup | Scope>\n\t_updates: Cleanup[]\n\t_dead: boolean\n}\nexport interface Root extends Scope {\n\t_onRead?:\n\t\t| ((value: unknown, token: ReadableToken<unknown>, store: RootStore) => void)\n\t\t| undefined\n\t_presence?: PresenceCoordinator\n\t_presenceFactory?: Capability[`presence`]\n\t_capabilities: Map<string, Capability>\n\t_boundaryCapabilities?: Map<Capability, number>\n\t_prepareCapability?: ((capability: Capability) => void) | undefined\n\t_failure?: { error: unknown; report: Root[`error`] } | undefined\n\t_store: RootStore\n\t_prefix: string\n\t_id: number\n\t_queue: Set<Cleanup>\n\t_enqueueCount?: number\n\t_mounts: Cleanup[] | undefined\n\t_commits?: Set<CommitJob>\n\t_flushing?: boolean\n\t_forms?: Set<() => boolean>\n\t_host?: Element\n\tflush: Cleanup\n\terror: (error: unknown) => void\n}\n\ninterface CommitJob {\n\tscope: Scope\n\torder: number\n\trun: Cleanup\n\tloopError: Error | undefined\n}\ninterface CommitGroup {\n\torder: number\n\tchildren: CommitGroup[]\n\tjobs: CommitJob[]\n}\n\nexport let owner: Scope | undefined\ntype Subscribe = (notify: Cleanup) => Cleanup\nlet tracking: ((subscribe: Subscribe) => void) | undefined\nlet serial = 0\nlet setupOrder = 0\n\nfunction scopedErrorHandler(\n\tscope: Scope,\n\terror: unknown,\n): Root[`error`] | undefined {\n\tconst failure = scope._root._failure\n\treturn failure && Object.is(failure.error, error)\n\t\t? failure.report\n\t\t: scope._options?.onError\n}\nfunction throwScopedError(\n\tscope: Scope,\n\terror: unknown,\n\treport = scopedErrorHandler(scope, error),\n): never {\n\tif (report) scope._root._failure = { error, report }\n\tthrow error\n}\nexport function within<T>(scope: Scope, run: () => T): T {\n\tconst previous = owner\n\towner = scope\n\ttry {\n\t\treturn run()\n\t} catch (error) {\n\t\tthrowScopedError(scope, error)\n\t} finally {\n\t\towner = previous\n\t}\n}\nexport function untrack<T>(run: () => T): T {\n\tconst previous = tracking\n\ttracking = undefined\n\ttry {\n\t\treturn run()\n\t} finally {\n\t\ttracking = previous\n\t}\n}\nexport function createScope(parent?: Scope): Scope {\n\tconst child: Scope = {\n\t\t_root: parent?._root as Root,\n\t\t_parent: parent,\n\t\t_options: parent?._options,\n\t\t_setupOrder: setupOrder++,\n\t\t_cleanups: new Set(),\n\t\t_updates: [],\n\t\t_dead: false,\n\t}\n\tparent?._cleanups.add(child)\n\treturn child\n}\nexport function fail(scope: Scope, error: unknown): never {\n\tconst report = scopedErrorHandler(scope, error)\n\ttry {\n\t\tdispose(scope)\n\t} catch (cleanup) {\n\t\tthrowScopedError(scope, new AggregateError([error, cleanup]), report)\n\t}\n\tthrow error\n}\nexport function dispose(scope: Scope): void {\n\tif (scope._dead) return\n\tscope._dead = true\n\tconst errors: unknown[] = []\n\tlet report: Root[`error`] | undefined\n\tconst record = (error: unknown) => {\n\t\terrors.push(error)\n\t\t// Keep the first boundary handler as nested disposal wraps its errors.\n\t\treport ??= scopedErrorHandler(scope, error)\n\t}\n\ttry {\n\t\tscope._root._presence?.forget(scope)\n\t} catch (error) {\n\t\trecord(error)\n\t}\n\tfor (const cleanup of [...scope._cleanups].reverse()) {\n\t\ttry {\n\t\t\ttypeof cleanup === `function` ? cleanup() : dispose(cleanup)\n\t\t} catch (error) {\n\t\t\trecord(error)\n\t\t}\n\t}\n\tscope._parent?._cleanups.delete(scope)\n\tscope._cleanups.clear()\n\tscope._targets?.clear()\n\tscope._updates.length = 0\n\tif (errors.length) throwScopedError(scope, new AggregateError(errors), report)\n}\nexport function invalidate(scope: Scope): void {\n\tfor (const run of scope._updates) enqueue(scope, run)\n\tfor (const child of scope._cleanups)\n\t\tif (typeof child !== `function`) invalidate(child)\n}\nexport function enqueue(scope: Scope, run: Cleanup): void {\n\tif (!isPresent(scope)) return\n\tconst root = scope._root\n\tif (!root._queue.size && !root._flushing)\n\t\tqueueMicrotask(() => {\n\t\t\ttry {\n\t\t\t\troot.flush()\n\t\t\t} catch (error) {\n\t\t\t\tconst report = scopedErrorHandler(root, error) ?? root.error\n\t\t\t\troot._failure = undefined\n\t\t\t\treport(error)\n\t\t\t}\n\t\t})\n\t// A write can invalidate an observer that is already pending.\n\tif (import.meta.env.DEV) root._enqueueCount = (root._enqueueCount ?? 0) + 1\n\troot._queue.add(run)\n}\n\nfunction runCommits(root: Root, pending: Set<CommitJob>): CommitJob | undefined {\n\tconst top: CommitGroup = { order: root._setupOrder, children: [], jobs: [] }\n\tconst groups = new Map<Scope, CommitGroup>([[root, top]])\n\t// Keep only branches with pending work. Visit siblings in setup order.\n\tconst groupFor = (scope: Scope): CommitGroup => {\n\t\tlet group = groups.get(scope)\n\t\tif (!group) {\n\t\t\tgroup = { order: scope._setupOrder, children: [], jobs: [] }\n\t\t\tgroups.set(scope, group)\n\t\t\tgroupFor(scope._parent!).children.push(group)\n\t\t}\n\t\treturn group\n\t}\n\tfor (const job of [...pending].sort((a, b) => a.order - b.order))\n\t\tgroupFor(job.scope).jobs.push(job)\n\tlet last: CommitJob | undefined\n\tconst visit = (group: CommitGroup) => {\n\t\tfor (const child of group.children.sort((a, b) => a.order - b.order))\n\t\t\tvisit(child)\n\t\tfor (const job of group.jobs) {\n\t\t\tif (pending.delete(job) && isPresent(job.scope)) {\n\t\t\t\tconst enqueueCount = import.meta.env.DEV ? root._enqueueCount : undefined\n\t\t\t\tjob.run()\n\t\t\t\tif (import.meta.env.DEV && root._enqueueCount !== enqueueCount)\n\t\t\t\t\tlast = job\n\t\t\t}\n\t\t}\n\t}\n\tvisit(top)\n\treturn last\n}\n\nfunction capabilityMap(list: readonly Capability[] | undefined) {\n\tconst capabilities = new Map<string, Capability>()\n\tfor (const capability of list ?? []) {\n\t\tif (capabilities.has(capability.namespace))\n\t\t\tthrow new Error(`spa: duplicate capability ${capability.namespace}`)\n\t\tcapabilities.set(capability.namespace, capability)\n\t}\n\treturn capabilities\n}\nfunction registerPresence(\n\troot: Root,\n\tcapability: Capability,\n\tshared = false,\n): void {\n\tconst create = capability.presence\n\tif (!create) return\n\tif (root._presence) {\n\t\tif (!shared || root._presenceFactory !== create)\n\t\t\tthrow new Error(`spa: multiple presence coordinators`)\n\t} else {\n\t\troot._presence = create(root)\n\t\troot._presenceFactory = create\n\t}\n}\nexport function scopeCapabilities(scope: Scope): Map<string, Capability> {\n\treturn scope._options?._capabilities ?? scope._root._capabilities\n}\nexport function reportScopeError(scope: Scope, error: unknown): void {\n\tconst report = scopedErrorHandler(scope, error) ?? scope._root.error\n\ttry {\n\t\tfail(scope._root, error)\n\t} catch (failure) {\n\t\tscope._root._failure = undefined\n\t\treport(failure)\n\t}\n}\n\n/** Override root options for these children while sharing their parent's ownership. */\nexport function RootBoundary(\n\tprops: RootOptions & { children?: Children },\n): Children {\n\tconst scope = owner!\n\tconst { store, idPrefix, onError, capabilities } = props\n\tconst options = { ...scope._options }\n\tif (store !== undefined) options.store = store\n\tif (idPrefix !== undefined) options.idPrefix = idPrefix\n\tif (onError !== undefined) options.onError = onError\n\tif (capabilities !== undefined) {\n\t\toptions._capabilities = capabilityMap(capabilities)\n\t\tconst root = scope._root\n\t\tconst active = (root._boundaryCapabilities ??= new Map())\n\t\tfor (const capability of options._capabilities.values()) {\n\t\t\tregisterPresence(root, capability, true)\n\t\t\tactive.set(capability, (active.get(capability) ?? 0) + 1)\n\t\t\tscope._cleanups.add(() => {\n\t\t\t\tconst remaining = active.get(capability)! - 1\n\t\t\t\tif (remaining) active.set(capability, remaining)\n\t\t\t\telse active.delete(capability)\n\t\t\t})\n\t\t\troot._prepareCapability?.(capability)\n\t\t}\n\t}\n\tscope._options = options\n\treturn () => props.children\n}\n\nexport function createRoot(options: RootOptions = {}, server = false): Root {\n\tconst capabilities = capabilityMap(options.capabilities)\n\tconst root = {\n\t\t_capabilities: capabilities,\n\t\t_store: options.store ?? IMPLICIT.STORE,\n\t\t_prefix: options.idPrefix ?? `w${serial++}`,\n\t\t_id: 0,\n\t\t...createScope(),\n\t\t_queue: new Set(),\n\t\t_mounts: server ? undefined : [],\n\t} as unknown as Root\n\troot._root = root\n\troot.error =\n\t\toptions.onError ??\n\t\t((error) => {\n\t\t\tthrow error\n\t\t})\n\tfor (const capability of capabilities.values())\n\t\tregisterPresence(root, capability)\n\tconst hasWrites = () => root._queue.size || root._mounts!.length\n\tconst hasWork = () => hasWrites() || root._commits?.size\n\tlet flushPendingWrites: Cleanup | undefined\n\troot.flush = () => {\n\t\tconst nested = root._flushing\n\t\tif (!(nested ? hasWrites() : hasWork()) && !root._forms?.size) return\n\t\troot._flushing = true\n\t\ttry {\n\t\t\tif (nested) {\n\t\t\t\t// The outer flush owns commit dispatch. Mount callbacks can drain writes.\n\t\t\t\tflushPendingWrites?.()\n\t\t\t\treturn\n\t\t\t}\n\t\t\troot._failure = undefined\n\t\t\tlet passes = 0\n\t\t\tlet lastCommit: CommitJob | undefined\n\t\t\tconst checkLoop = () => {\n\t\t\t\tif (import.meta.env.DEV && ++passes > 100)\n\t\t\t\t\tthrow lastCommit?.loopError ?? new Error(`spa: update loop`)\n\t\t\t}\n\t\t\tconst runWriteBatch = () => {\n\t\t\t\tconst commits = new Map<Capability, Cleanup | undefined>()\n\t\t\t\tconst prepare = (capability: Capability) => {\n\t\t\t\t\tif (!commits.has(capability))\n\t\t\t\t\t\tcommits.set(capability, capability.beforeUpdate?.(root))\n\t\t\t\t}\n\t\t\t\tconst previous = root._prepareCapability\n\t\t\t\troot._prepareCapability = prepare\n\t\t\t\tlet formsReady = true\n\t\t\t\ttry {\n\t\t\t\t\tfor (const capability of capabilities.values()) prepare(capability)\n\t\t\t\t\tfor (const capability of root._boundaryCapabilities?.keys() ?? [])\n\t\t\t\t\t\tprepare(capability)\n\t\t\t\t\twhile (hasWrites()) {\n\t\t\t\t\t\tcheckLoop()\n\t\t\t\t\t\tfor (const run of [...root._queue])\n\t\t\t\t\t\t\tif (root._queue.delete(run)) run()\n\t\t\t\t\t\tfor (const run of root._mounts!.splice(0)) run()\n\t\t\t\t\t}\n\t\t\t\t\tfor (const restore of root._forms ?? [])\n\t\t\t\t\t\tif (!untrack(restore)) formsReady = false\n\t\t\t\t} finally {\n\t\t\t\t\troot._prepareCapability = previous\n\t\t\t\t\tfor (const commit of commits.values()) commit?.()\n\t\t\t\t}\n\t\t\t\treturn formsReady\n\t\t\t}\n\t\t\tdo {\n\t\t\t\tflushPendingWrites = runWriteBatch\n\t\t\t\tconst formsReady = runWriteBatch()\n\t\t\t\tflushPendingWrites = undefined\n\t\t\t\tif (!hasWrites()) {\n\t\t\t\t\t// Form event completion schedules a flush to restore the controls.\n\t\t\t\t\tif (!formsReady || !root._commits?.size) break\n\t\t\t\t\tcheckLoop()\n\t\t\t\t\tlastCommit = runCommits(root, root._commits) ?? lastCommit\n\t\t\t\t}\n\t\t\t} while (hasWork())\n\t\t\troot._failure = undefined\n\t\t} catch (error) {\n\t\t\tflushPendingWrites = undefined\n\t\t\tfail(root, error)\n\t\t} finally {\n\t\t\tif (!nested) root._flushing = false\n\t\t}\n\t}\n\treturn root\n}\n/** Return the atom.io store selected by the current owner. */\nexport function useStore(): RootStore {\n\treturn owner!._options?.store ?? owner!._root._store\n}\n/** Return atom.io disposal bound to the current root's store. */\nexport function useDisposal(): typeof disposeState {\n\treturn disposeFromStore.bind(null, useStore()) as typeof disposeState\n}\nexport function onCleanup(cleanup: Cleanup): void {\n\towner!._cleanups.add(cleanup)\n}\nexport function onMount(run: Cleanup): void {\n\tconst scope = owner!\n\tscope._root._mounts?.push(() => {\n\t\tif (!scope._dead)\n\t\t\twithin(scope, () => {\n\t\t\t\tuntrack(run)\n\t\t\t})\n\t})\n}\n/** Observe state during setup and apply changes after the root's writes. */\nexport function onCommit<T>(\n\tread: Accessor<T>,\n\tapply: (value: T, previous: T | undefined) => void | Cleanup,\n): void {\n\tconst scope = owner!\n\tconst root = scope._root\n\tif (!root._mounts) return\n\tconst pending = (root._commits ??= new Set())\n\tlet ran = false\n\tlet next: T\n\tlet previous: T | undefined\n\tlet cleanup: Cleanup | void\n\tconst clear = () => {\n\t\tconst release = cleanup\n\t\tcleanup = undefined\n\t\tif (release) untrack(release)\n\t}\n\tconst job: CommitJob = {\n\t\tscope,\n\t\torder: setupOrder++,\n\t\t// The registration stack identifies the component in a feedback loop.\n\t\tloopError: import.meta.env.DEV\n\t\t\t? new Error(`spa: onCommit update loop`)\n\t\t\t: undefined,\n\t\trun() {\n\t\t\twithin(scope, () => {\n\t\t\t\tuntrack(() => {\n\t\t\t\t\tclear()\n\t\t\t\t\tif (!isPresent(scope)) return\n\t\t\t\t\tconst old = previous\n\t\t\t\t\tprevious = next\n\t\t\t\t\tran = true\n\t\t\t\t\tcleanup = apply(next, old)\n\t\t\t\t\tif (scope._dead) clear()\n\t\t\t\t})\n\t\t\t})\n\t\t},\n\t}\n\tscope._cleanups.add(() => {\n\t\tpending.delete(job)\n\t\tclear()\n\t})\n\tobserve(scope, read, (value) => {\n\t\tnext = value\n\t\tif (!ran || !Object.is(value, previous)) pending.add(job)\n\t\telse pending.delete(job)\n\t})\n}\nexport function useId(): string {\n\tconst root = owner!._root\n\treturn `${owner!._options?.idPrefix ?? root._prefix}-${root._id++}`\n}\n\nexport function observe<T>(\n\tscope: Scope,\n\tread: Accessor<T>,\n\tapply: (value: T) => void,\n): void {\n\tconst subscriptions = new Map<Subscribe, Cleanup>()\n\tconst run = () => {\n\t\tif (!isPresent(scope)) return\n\t\tconst used = new Set<Subscribe>()\n\t\tconst previous = tracking\n\t\ttracking = (subscribe) => {\n\t\t\tused.add(subscribe)\n\t\t\tif (!subscriptions.has(subscribe))\n\t\t\t\tsubscriptions.set(\n\t\t\t\t\tsubscribe,\n\t\t\t\t\tsubscribe(() => {\n\t\t\t\t\t\tenqueue(scope, run)\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t}\n\t\tlet value: T\n\t\ttry {\n\t\t\tvalue = within(scope, read)\n\t\t} finally {\n\t\t\ttracking = previous\n\t\t\tfor (const [subscribe, unsubscribe] of subscriptions)\n\t\t\t\tif (!used.has(subscribe)) {\n\t\t\t\t\tunsubscribe()\n\t\t\t\t\tsubscriptions.delete(subscribe)\n\t\t\t\t}\n\t\t}\n\t\twithin(scope, () => {\n\t\t\tuntrack(() => {\n\t\t\t\tapply(value)\n\t\t\t})\n\t\t})\n\t}\n\tscope._updates.push(run)\n\tscope._cleanups.add(() => {\n\t\tscope._root._queue.delete(run)\n\t\tfor (const unsubscribe of subscriptions.values()) unsubscribe()\n\t})\n\trun()\n}\n\n/** Resolve a fixed family key in the current owner's store. */\nexport function resolveStateToken(token: any, key?: Canonical): any {\n\tconst store = useStore()\n\treturn token.type.endsWith(`_family`) ? findInStore(store, token, key!) : token\n}\n\n/** Capture a token for this instance. Change the component key to change its token. */\nexport function useGetter<T, E = never>(\n\ttoken: ReadableToken<T, any, E>,\n): Accessor<ViewOf<T | E>>\nexport function useGetter<T, K extends Canonical, E = never>(\n\tfamily: ReadableFamilyToken<T, K, E>,\n\tkey: NoInfer<K>,\n): Accessor<ViewOf<T | E>>\nexport function useGetter(token: any, key?: Canonical): Accessor<any> {\n\ttoken = resolveStateToken(token, key)\n\tconst root = owner!._root\n\tconst store = useStore()\n\tconst subscribe: Subscribe = (notify) =>\n\t\tsubscribeToState(store, token, `spa:${serial++}`, notify)\n\treturn () => {\n\t\tconst value = getFromStore(store, token)\n\t\troot._onRead?.(value, token, store)\n\t\ttracking?.(subscribe)\n\t\treturn value\n\t}\n}\nexport function useSetter<T>(\n\ttoken: WritableToken<T, any, any>,\n): (value: T | Setter<T>) => void\nexport function useSetter<T, K extends Canonical>(\n\tfamily: WritableFamilyToken<T, K, any>,\n\tkey: NoInfer<K>,\n): (value: T | Setter<T>) => void\nexport function useSetter(token: any, key?: Canonical): (value: any) => void {\n\ttoken = resolveStateToken(token, key)\n\tconst store = useStore()\n\treturn (value) => {\n\t\tsetIntoStore(store, token, value)\n\t}\n}\nexport function useTransaction<F extends (...args: any[]) => any>(\n\ttoken: TransactionToken<F>,\n): (...args: Parameters<F>) => ReturnType<F> {\n\treturn actUponStore(useStore(), token, `spa:${serial++}`)\n}\n\nconst refs = new WeakMap<RootStore, Map<string, object>>()\nexport function useRef<E extends Element>(\n\ttoken: RegularAtomToken<E | null>,\n): (element: E | null) => void\nexport function useRef<E extends Element, K extends Canonical>(\n\tfamily: RegularAtomFamilyToken<E | null, K>,\n\tkey: NoInfer<K>,\n): (element: E | null) => void\nexport function useRef<E extends Element>(\n\ttoken: any,\n\tkey?: Canonical,\n): (element: E | null) => void {\n\ttoken = resolveStateToken(token, key)\n\tconst store = useStore()\n\tconst owners = refs.get(store) ?? new Map<string, object>()\n\trefs.set(store, owners)\n\tconst identity = {}\n\tlet held: E | null = null\n\treturn (element) => {\n\t\tif (element) {\n\t\t\theld = element\n\t\t\towners.set(token.key, identity)\n\t\t\tsetIntoStore(store, token, element)\n\t\t} else if (owners.get(token.key) === identity) {\n\t\t\towners.delete(token.key)\n\t\t\tif (getFromStore(store, token) === held) setIntoStore(store, token, null)\n\t\t\theld = null\n\t\t}\n\t}\n}\nexport interface TimelineControls {\n\tgetCursor(): number\n\tgetLength(): number\n\tundo(): void\n\tredo(): void\n\tclear(): void\n\tgetTransaction(): { undo?: Cleanup; redo?: Cleanup }\n}\nexport function useTimeline<M extends TimelineManageable>(\n\ttoken: TimelineToken<M>,\n): TimelineControls\nexport function useTimeline<K extends Canonical, M extends TimelineManageable>(\n\tfamily: TimelineFamilyToken<K, M>,\n\tkey: NoInfer<K>,\n): TimelineControls\nexport function useTimeline(token: any, key?: Canonical): TimelineControls {\n\tconst store = useStore()\n\tconst selected: TimelineToken<any> =\n\t\ttoken.type === `timeline_family`\n\t\t\t? findTimelineInStore(store, token, key!)\n\t\t\t: token\n\tconst subscribe: Subscribe = (notify) =>\n\t\tsubscribeToTimeline(store, selected, `spa:${serial++}`, notify)\n\tconst read = () => {\n\t\tconst timeline = withdraw(store, selected)\n\t\ttracking?.(subscribe)\n\t\treturn timeline\n\t}\n\treturn {\n\t\tgetCursor: () => read().at,\n\t\tgetLength: () => read().history.length,\n\t\tundo: () => {\n\t\t\ttimeTravel(store, `undo`, selected)\n\t\t},\n\t\tredo: () => {\n\t\t\ttimeTravel(store, `redo`, selected)\n\t\t},\n\t\tclear: () => {\n\t\t\tclearTimelineInStore(store, selected)\n\t\t},\n\t\tgetTransaction: () => {\n\t\t\tconst timeline = read()\n\t\t\tconst controls: ReturnType<TimelineControls[`getTransaction`]> = {}\n\t\t\tfor (const direction of [`undo`, `redo`] as const) {\n\t\t\t\tconst group = getTimelineTransactionAtHead(timeline, direction)\n\t\t\t\tif (group)\n\t\t\t\t\tcontrols[direction] = () => {\n\t\t\t\t\t\ttimeTravelTransactionGroupInStore(store, direction, group)\n\t\t\t\t\t}\n\t\t\t}\n\t\t\treturn controls\n\t\t},\n\t}\n}\n\nexport function plain(value: Children): string {\n\tif (typeof value === `function`) return plain(value())\n\tif (Array.isArray(value)) return value.map(plain).join(``)\n\tif (value == null || typeof value === `boolean`) return ``\n\tif (import.meta.env.DEV && typeof value === `object`)\n\t\tthrow new Error(`spa: text required`)\n\t// oxlint-disable-next-line typescript/no-base-to-string -- Valid text children are primitives here; development rejects malformed object children.\n\treturn String(value)\n}\n\nexport function isPresent(scope: Scope): boolean {\n\tfor (let at: Scope | undefined = scope; at; at = at._parent)\n\t\tif (at._dead || at._exiting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I,MAAM,oBAAoB;CAErC,OAAO,OAAO,KAAK;AACpB;AAEA,SAAgB,UAAU,OAAuB;CAChD,KAAK,IAAI,KAAwB,OAAO,IAAI,KAAK,GAAG,SACnD,IAAI,GAAG,SAAS,GAAG,UAAU,OAAO;CACrC,OAAO;AACR"}
@@ -1,7 +1,7 @@
1
- import { i as capabilityProps, n as trackKeys, t as identifyChildren } from "./identity-B8wTFkyW.js";
2
- import { D as within, a as enqueue, c as isPresent, i as dispose, l as observe, m as plain, n as createRoot, o as fail, r as createScope, s as invalidate, v as untrack } from "./core-DrUd8x25.js";
1
+ import { i as capabilityProps, n as trackKeys, t as identifyChildren } from "./identity-DWHH6jbd.js";
2
+ import { D as within, a as enqueue, c as isPresent, i as dispose, l as observe, m as plain, n as createRoot, o as fail, r as createScope, s as invalidate, v as untrack } from "./core-D1FWUMMC.js";
3
3
  import { hotRoot, trackRoot } from "./hot.js";
4
- import { a as instanceProps, t as Fragment } from "./jsx-runtime-BGDPK50B.js";
4
+ import { a as instanceProps, t as Fragment } from "./jsx-runtime-B2XxfA3E.js";
5
5
  // src/dom-forms.ts
6
6
  const changes = /* @__PURE__ */ new WeakMap();
7
7
  const requests = /* @__PURE__ */ new WeakMap();
@@ -354,4 +354,4 @@ function hydrate(setup, host, options = {}) {
354
354
  }
355
355
  export { render as n, hydrate as t };
356
356
 
357
- //# sourceMappingURL=dom-CEVtlaav.js.map
357
+ //# sourceMappingURL=dom-C1cVf5Vm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dom-CEVtlaav.js","names":[],"sources":["../../src/dom-forms.ts","../../src/dom.ts"],"sourcesContent":["import type { Scope } from \"./core.ts\"\nimport { enqueue, isPresent } from \"./core.ts\"\n\ntype Control = HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement\nconst changes = new WeakMap<EventListener, EventListener>()\nconst requests = new WeakMap<Element, () => void>()\nconst events = [`input`, `change`, `click`]\nconst wake = () => {}\n\n/** Keep native input events, using per-edit change semantics for text/range controls. */\nexport function changeHandler(handler: EventListener): EventListener {\n\tlet wrapped = changes.get(handler)\n\tif (!wrapped) {\n\t\twrapped = (event) => {\n\t\t\tconst target = event.target as Control | null\n\t\t\tconst editing =\n\t\t\t\ttarget?.localName === `textarea` ||\n\t\t\t\t(target?.localName === `input` &&\n\t\t\t\t\t!/^(checkbox|radio|file)$/.test(target.type))\n\t\t\tif (event.type === (editing ? `input` : `change`))\n\t\t\t\thandler.call(event.currentTarget, event)\n\t\t}\n\t\tchanges.set(handler, wrapped)\n\t}\n\treturn wrapped\n}\n\nexport function controlValue(control: Control, value: string | number): void {\n\tif (\n\t\tcontrol.localName === `input` &&\n\t\tcontrol.type === `number` &&\n\t\ttypeof value === `number` &&\n\t\tcontrol.value !== `` &&\n\t\tNumber(control.value) === value\n\t)\n\t\treturn\n\tif (control.value !== String(value)) control.value = String(value)\n\tif (control.localName === `select`) {\n\t\tconst select = control as HTMLSelectElement\n\t\tif (select.selectedIndex < 0) {\n\t\t\tconst first = [...select.options].find((option) => !option.disabled)\n\t\t\tif (first) first.selected = true\n\t\t}\n\t}\n}\n\nfunction requestRestore(control: Control): void {\n\trequests.get(control)?.()\n\tif (control.localName !== `input` || control.type !== `radio`) return\n\tconst input = control as HTMLInputElement\n\tfor (const peer of (\n\t\tinput.getRootNode() as ParentNode\n\t).querySelectorAll<HTMLInputElement>(`input`)) {\n\t\tif (\n\t\t\tpeer !== input &&\n\t\t\tpeer.type === `radio` &&\n\t\t\tpeer.name === input.name &&\n\t\t\tpeer.form === input.form\n\t\t)\n\t\t\trequests.get(peer)?.()\n\t}\n}\n\n/** Restore controlled fields after event handlers and all queued option/prop updates. */\nexport function bindForm(\n\tcontrol: Control,\n\tprops: Record<string, any>,\n\tscope: Scope,\n): void {\n\tlet active: Event | undefined\n\tlet timer: ReturnType<typeof setTimeout> | undefined\n\tconst restore = () => {\n\t\tif (!isPresent(scope)) return true\n\t\tconst value = props[`value`]\n\t\tconst checked = control.localName === `input` ? props[`checked`] : undefined\n\t\tif (active?.eventPhase) return value == null && checked == null\n\t\tif (value != null) controlValue(control, value)\n\t\tif (checked != null) {\n\t\t\tconst input = control as HTMLInputElement\n\t\t\tif (input.checked !== Boolean(checked)) input.checked = Boolean(checked)\n\t\t}\n\t\treturn true\n\t}\n\tconst finish = () => {\n\t\tactive = undefined\n\t\tclearTimeout(timer)\n\t\tenqueue(scope, wake)\n\t}\n\tconst capture = (event: Event) => {\n\t\tif (event.type === `click` && !/^(checkbox|radio)$/.test(control.type))\n\t\t\treturn\n\t\tactive = event\n\t\tclearTimeout(timer)\n\t\t// A stopped native event never reaches the root's bubble listener.\n\t\ttimer = setTimeout(() => {\n\t\t\trequestRestore(control)\n\t\t}, 0)\n\t}\n\tconst root = scope._root\n\tif (!root._forms) {\n\t\troot._forms = new Set()\n\t\tconst end = (event: Event) => {\n\t\t\tconst target = event.target as Control\n\t\t\t// Checkbox/radio change follows click and input; its handlers must see the edit.\n\t\t\tif (\n\t\t\t\tevent.type === `click` ||\n\t\t\t\t(event.type === `input` && /^(checkbox|radio)$/.test(target.type))\n\t\t\t)\n\t\t\t\treturn\n\t\t\trequestRestore(target)\n\t\t}\n\t\tfor (const event of events) root._host!.addEventListener(event, end)\n\t\troot._cleanups.add(() => {\n\t\t\tfor (const event of events) root._host!.removeEventListener(event, end)\n\t\t})\n\t}\n\tconst forms = root._forms\n\tforms.add(restore)\n\trequests.set(control, finish)\n\tfor (const event of events) control.addEventListener(event, capture, true)\n\tscope._cleanups.add(() => {\n\t\tclearTimeout(timer)\n\t\tforms.delete(restore)\n\t\trequests.delete(control)\n\t\tfor (const event of events) control.removeEventListener(event, capture, true)\n\t})\n}\n","import type { Canonical } from \"atom.io/foundations/canonical\"\n\nimport { capabilityProps } from \"./capabilities.ts\"\nimport type {\n\tAccessor,\n\tChildren,\n\tRootOptions,\n\tScope,\n\tSpaElement,\n} from \"./core.ts\"\nimport {\n\tcreateRoot,\n\tcreateScope,\n\tdispose,\n\tfail,\n\tinvalidate,\n\tobserve,\n\tplain,\n\tuntrack,\n\twithin,\n} from \"./core.ts\"\nimport { bindForm, changeHandler, controlValue } from \"./dom-forms.ts\"\nimport { hotRoot, trackRoot } from \"./hot.ts\"\nimport { identifyChildren, trackKeys } from \"./identity.ts\"\nimport { Fragment } from \"./jsx-runtime.ts\"\nimport type { PresenceCollection } from \"./presence.ts\"\nimport { instanceProps } from \"./props.ts\"\n\nconst HTML = `http://www.w3.org/1999/xhtml`\nconst SVG = `http://www.w3.org/2000/svg`\ntype Cursor = {\n\tnode: Node | null\n\treport(expected: Node | null, found: Node | null): void\n}\ntype RecordNode = {\n\t_value: Children\n\t_scope: Scope\n\t_start: Node\n\t_end: Node\n\t_index: number\n}\nfunction compatible(record: RecordNode, child: Children): boolean {\n\treturn (\n\t\ttypeof record._value === typeof child &&\n\t\t(record._value as SpaElement | null)?.type ===\n\t\t\t(child as SpaElement | null)?.type\n\t)\n}\n\nfunction finish(cursor?: Cursor): void {\n\tif (cursor?.node) {\n\t\tcursor.report(null, cursor.node)\n\t\twhile (cursor.node) {\n\t\t\tconst node: Node = cursor.node\n\t\t\tcursor.node = node.nextSibling\n\t\t\t;(node as ChildNode).remove()\n\t\t}\n\t}\n}\n\nfunction take(\n\tnode: Node,\n\tparent: Node,\n\tbefore: Node | null,\n\towner: Scope,\n\tcursor?: Cursor,\n): Node {\n\tif (\n\t\tcursor &&\n\t\t!(node.nodeType === 3 && !node.nodeValue && cursor.node?.nodeType !== 3)\n\t) {\n\t\tconst found = cursor.node\n\t\tif (\n\t\t\t!found ||\n\t\t\tfound.nodeType !== node.nodeType ||\n\t\t\tfound.nodeName !== node.nodeName ||\n\t\t\t(found as Element).namespaceURI !== (node as Element).namespaceURI ||\n\t\t\t(node.nodeType !== 1 && found.nodeValue !== node.nodeValue)\n\t\t) {\n\t\t\tcursor.report(node, found)\n\t\t\tparent.insertBefore(node, found)\n\t\t\tcursor.node = found?.nextSibling ?? null\n\t\t\t;(found as ChildNode | null)?.remove()\n\t\t} else {\n\t\t\tnode = found\n\t\t\tcursor.node = found.nextSibling\n\t\t}\n\t} else parent.insertBefore(node, cursor ? cursor.node : before)\n\towner._cleanups.add(() => {\n\t\t;(node as ChildNode).remove()\n\t})\n\treturn node\n}\nfunction comment(\n\tvalue: string,\n\tparent: Node,\n\tbefore: Node | null,\n\towner: Scope,\n\tcursor?: Cursor,\n): Node {\n\treturn take(\n\t\tparent.ownerDocument!.createComment(value),\n\t\tparent,\n\t\tbefore,\n\t\towner,\n\t\tcursor,\n\t)\n}\nfunction property(\n\telement: Element,\n\tkey: string,\n\tvalue: any,\n\tprevious: any,\n): void {\n\tif (/^(key|children|ref)$/.test(key)) return\n\tif (key === `innerHTML` && element.localName === `astro-slot`) return\n\tif (\n\t\t/^(innerHTML|outerHTML|textContent|innerText|dangerouslySetInnerHTML)$/.test(\n\t\t\tkey,\n\t\t)\n\t)\n\t\tthrow new Error(import.meta.env.DEV ? `spa: owned content` : undefined)\n\tif (key.startsWith(`on`)) {\n\t\tconst capture = /(?<!Pointer)Capture$/.test(key)\n\t\tconst event = key\n\t\t\t.slice(2, capture ? -7 : undefined)\n\t\t\t.toLowerCase()\n\t\t\t.replace(`doubleclick`, `dblclick`)\n\t\tconst events =\n\t\t\tevent === `change`\n\t\t\t\t? [`input`, `change`]\n\t\t\t\t: [event === `focus` ? `focusin` : event === `blur` ? `focusout` : event]\n\t\tif (previous)\n\t\t\tfor (const name of events)\n\t\t\t\telement.removeEventListener(\n\t\t\t\t\tname,\n\t\t\t\t\tevent === `change` ? changeHandler(previous) : previous,\n\t\t\t\t\tcapture,\n\t\t\t\t)\n\t\tif (value != null) {\n\t\t\tif (import.meta.env.DEV && typeof value !== `function`)\n\t\t\t\tthrow new Error(`spa: event handler`)\n\t\t\tfor (const name of events)\n\t\t\t\telement.addEventListener(\n\t\t\t\t\tname,\n\t\t\t\t\tevent === `change` ? changeHandler(value) : value,\n\t\t\t\t\tcapture,\n\t\t\t\t)\n\t\t}\n\t\treturn\n\t}\n\tif (key === `className`) key = `class`\n\tif (key === `htmlFor`) key = `for`\n\tif (\n\t\timport.meta.env.DEV &&\n\t\tkey === `style` &&\n\t\tvalue != null &&\n\t\ttypeof value !== `string`\n\t)\n\t\tthrow new Error(`spa: CSS string required`)\n\tif (\n\t\telement.namespaceURI === SVG &&\n\t\tkey === `focusable` &&\n\t\ttypeof value === `boolean`\n\t)\n\t\tvalue = String(value)\n\tif (\n\t\telement.namespaceURI === HTML &&\n\t\tkey in element &&\n\t\t!/^(style|form|list)$/.test(key)\n\t) {\n\t\tconst target = element as any\n\t\tif (\n\t\t\tkey === `value` &&\n\t\t\t/^(input|textarea|select)$/.test(element.localName) &&\n\t\t\tvalue != null\n\t\t)\n\t\t\tcontrolValue(target, value)\n\t\telse target[key] = value ?? (typeof target[key] === `boolean` ? false : ``)\n\t\tif (value == null) element.removeAttribute(key)\n\t} else if (value == null || (value === false && !/^(aria-|data-)/.test(key)))\n\t\telement.removeAttribute(key)\n\telse\n\t\telement.setAttribute(\n\t\t\tkey,\n\t\t\tvalue === true && !/^(aria-|data-)/.test(key) ? `` : String(value),\n\t\t)\n}\n\nfunction mount(\n\tvalue: Children,\n\tparent: Node,\n\tbefore: Node | null,\n\towner: Scope,\n\tnamespace: string,\n\tcursor?: Cursor,\n\tsource = () => value,\n\tinitialKey?: Canonical,\n): void {\n\tif (typeof value === `function`) {\n\t\tconst begin = comment(`{`, parent, before, owner, cursor)\n\t\tlet end: Node | null = null\n\t\tlet records = new Map<string | number, RecordNode>()\n\t\tlet presence: PresenceCollection<RecordNode, Children> | undefined\n\t\tconst retire = (\n\t\t\trecord: RecordNode,\n\t\t\tkey: unknown,\n\t\t\teligible: boolean,\n\t\t\tindex: number,\n\t\t) => {\n\t\t\tif (presence) presence.remove(record, key, eligible, index, () => {})\n\t\t\telse dispose(record._scope)\n\t\t}\n\t\tlet initial = cursor\n\t\tobserve(\n\t\t\towner,\n\t\t\t() => identifyChildren((source() as () => Children)()),\n\t\t\t(values) => {\n\t\t\t\tpresence ??= owner._root._presence?.collection(\n\t\t\t\t\t(record: RecordNode) => record._scope,\n\t\t\t\t\tcompatible,\n\t\t\t\t)\n\t\t\t\tconst kept = new Map<string | number, RecordNode>()\n\t\t\t\tlet previous: RecordNode | undefined\n\t\t\t\tconst focus = parent.ownerDocument!.activeElement as HTMLElement | null\n\t\t\t\tfor (let index = 0; index < values.length; index++) {\n\t\t\t\t\tconst { value: child, key, id } = values[index]\n\t\t\t\t\tlet record = records.get(id)\n\t\t\t\t\tif (record && !compatible(record, child)) {\n\t\t\t\t\t\tretire(\n\t\t\t\t\t\t\trecord,\n\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\tchild == null || typeof child === `boolean`,\n\t\t\t\t\t\t\trecord._index,\n\t\t\t\t\t\t)\n\t\t\t\t\t\trecord = undefined\n\t\t\t\t\t}\n\t\t\t\t\trecord ??= presence?.take(id, child)\n\t\t\t\t\tif (!record) {\n\t\t\t\t\t\tconst at = previous ? previous._end.nextSibling : begin.nextSibling\n\t\t\t\t\t\tconst childOwner = createScope(owner)\n\t\t\t\t\t\trecord = {\n\t\t\t\t\t\t\t_index: index,\n\t\t\t\t\t\t\t_value: child,\n\t\t\t\t\t\t\t_scope: childOwner,\n\t\t\t\t\t\t\t_start: comment(`[`, parent, at, childOwner, initial),\n\t\t\t\t\t\t\t_end: null!,\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst held = record\n\t\t\t\t\t\tmount(\n\t\t\t\t\t\t\tchild,\n\t\t\t\t\t\t\tparent,\n\t\t\t\t\t\t\tat,\n\t\t\t\t\t\t\tchildOwner,\n\t\t\t\t\t\t\tnamespace,\n\t\t\t\t\t\t\tinitial,\n\t\t\t\t\t\t\t() => held._value,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t)\n\t\t\t\t\t\trecord._end = comment(`]`, parent, at, childOwner, initial)\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Frozen descriptors opt into reuse; mutable props and accessors must refresh.\n\t\t\t\t\t\tconst reusable =\n\t\t\t\t\t\t\trecord._value === child &&\n\t\t\t\t\t\t\ttypeof child === `object` &&\n\t\t\t\t\t\t\tchild !== null &&\n\t\t\t\t\t\t\tObject.isFrozen(child) &&\n\t\t\t\t\t\t\tObject.isFrozen((child as SpaElement).props)\n\t\t\t\t\t\trecord._value = child\n\t\t\t\t\t\towner._root._presence?.resume(record._scope)\n\t\t\t\t\t\tif (!reusable) invalidate(record._scope)\n\t\t\t\t\t}\n\t\t\t\t\trecord._index = index\n\t\t\t\t\tprevious = record\n\t\t\t\t\tkept.set(id, record)\n\t\t\t\t}\n\t\t\t\tfor (const [key, record] of records)\n\t\t\t\t\tif (!kept.has(key)) retire(record, key, true, record._index)\n\t\t\t\tif (!initial) {\n\t\t\t\t\tlet at = end ?? before\n\t\t\t\t\tconst rendered = presence?.merge([...kept.values()]) ?? [\n\t\t\t\t\t\t...kept.values(),\n\t\t\t\t\t]\n\t\t\t\t\tfor (const record of rendered.reverse()) {\n\t\t\t\t\t\tif (record._end.nextSibling !== at) {\n\t\t\t\t\t\t\tconst range = parent.ownerDocument!.createRange()\n\t\t\t\t\t\t\trange.setStartBefore(record._start)\n\t\t\t\t\t\t\trange.setEndAfter(record._end)\n\t\t\t\t\t\t\tparent.insertBefore(range.extractContents(), at)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tat = record._start\n\t\t\t\t\t}\n\t\t\t\t\tif (\n\t\t\t\t\t\tfocus?.isConnected &&\n\t\t\t\t\t\t!focus.closest(`[inert]`) &&\n\t\t\t\t\t\tfocus !== parent.ownerDocument!.activeElement\n\t\t\t\t\t)\n\t\t\t\t\t\tfocus.focus({ preventScroll: true })\n\t\t\t\t}\n\t\t\t\tinitial = undefined\n\t\t\t\trecords = kept\n\t\t\t},\n\t\t)\n\t\tend = comment(`}`, parent, before, owner, cursor)\n\t\treturn\n\t}\n\tif (Array.isArray(value)) {\n\t\tfor (const child of value)\n\t\t\tmount(child, parent, before, owner, namespace, cursor)\n\t\treturn\n\t}\n\tif (value == null || typeof value === `boolean`) return\n\tif (typeof value !== `object`) {\n\t\tcomment(`t`, parent, before, owner, cursor)\n\t\tconst text = take(\n\t\t\tparent.ownerDocument!.createTextNode(String(value)),\n\t\t\tparent,\n\t\t\tbefore,\n\t\t\towner,\n\t\t\tcursor,\n\t\t)\n\t\tobserve(owner, source as Accessor<string | number | bigint>, (next) => {\n\t\t\tconst data = String(next)\n\t\t\tif (text.nodeValue !== data) text.nodeValue = data\n\t\t})\n\t\treturn\n\t}\n\tif (import.meta.env.DEV && (!(`type` in value) || !(`props` in value)))\n\t\tthrow new Error(`spa: invalid child`)\n\tconst vnode = value as SpaElement\n\tconst props = instanceProps(() => (source() as SpaElement).props, initialKey)\n\tif (!vnode.type || vnode.type === Fragment) {\n\t\tmount(() => props[`children`], parent, before, owner, namespace, cursor)\n\t\treturn\n\t}\n\tif (typeof vnode.type === `function`) {\n\t\tconst childOwner = createScope(owner)\n\t\tconst output = within(childOwner, () =>\n\t\t\tuntrack(() => (vnode.type as Function)(props)),\n\t\t)\n\t\tmount(trackKeys(output), parent, before, childOwner, namespace, cursor)\n\t\treturn\n\t}\n\tconst ns = vnode.type === `svg` ? SVG : namespace\n\tconst element = take(\n\t\tparent.ownerDocument!.createElementNS(ns, vnode.type),\n\t\tparent,\n\t\tbefore,\n\t\towner,\n\t\tcursor,\n\t) as Element\n\tif (ns === HTML && /^(input|textarea|select)$/.test(vnode.type))\n\t\tbindForm(element as HTMLInputElement, props, owner)\n\tif (ns === HTML && (props[`autoFocus`] || props[`autofocus`])) {\n\t\towner._root._mounts!.push(() => {\n\t\t\tif (!owner._dead) (element as HTMLElement).focus()\n\t\t})\n\t}\n\tif (vnode.type === `astro-slot`) {\n\t\tif (!cursor) element.innerHTML = props[`innerHTML`] ?? ``\n\t} else if (ns === HTML && /^(textarea|title|style|script)$/.test(vnode.type)) {\n\t\tobserve(\n\t\t\towner,\n\t\t\t() =>\n\t\t\t\tplain(\n\t\t\t\t\tvnode.type === `textarea`\n\t\t\t\t\t\t? (props[`value`] ?? props[`children`])\n\t\t\t\t\t\t: props[`children`],\n\t\t\t\t),\n\t\t\t(text) => {\n\t\t\t\tif (element.textContent !== text) element.textContent = text\n\t\t\t},\n\t\t)\n\t} else {\n\t\tconst children = cursor\n\t\t\t? { node: element.firstChild, report: cursor.report }\n\t\t\t: undefined\n\t\tif (\n\t\t\t!/^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/.test(\n\t\t\t\tvnode.type,\n\t\t\t) ||\n\t\t\tns !== HTML\n\t\t)\n\t\t\tmount(\n\t\t\t\t() => props[`children`],\n\t\t\t\telement,\n\t\t\t\tnull,\n\t\t\t\towner,\n\t\t\t\tvnode.type === `foreignObject` ? HTML : ns,\n\t\t\t\tchildren,\n\t\t\t)\n\t\tfinish(children)\n\t}\n\tlet previous: Record<string, any> = {}\n\tconst nativeProps = capabilityProps(\n\t\towner,\n\t\t{ kind: `dom`, node: element },\n\t\t() => ({ ...props }),\n\t\t(next) => {\n\t\t\tconst previousStyle =\n\t\t\t\tprevious[`style`] !== next[`style`]\n\t\t\t\t\t? (element.getAttribute(`style`) ?? ``)\n\t\t\t\t\t: undefined\n\t\t\tfor (const key in { ...previous, ...next })\n\t\t\t\tif (\n\t\t\t\t\t!Object.is(previous[key], next[key]) ||\n\t\t\t\t\ttypeof next[key] === `object`\n\t\t\t\t) {\n\t\t\t\t\tproperty(element, key, next[key], previous[key])\n\t\t\t\t\tprevious[key] = next[key]\n\t\t\t\t}\n\t\t\tprevious = next\n\t\t\treturn previousStyle\n\t\t},\n\t)\n\towner._cleanups.add(() => {\n\t\tfor (const key in previous)\n\t\t\tif (key.startsWith(`on`)) property(element, key, null, previous[key])\n\t})\n\tobserve(owner, () => ({ ...props }), nativeProps)\n\tconst ref = untrack(() => props[`ref`])\n\tif (ref) {\n\t\towner._root._mounts!.unshift(() => {\n\t\t\tif (!owner._dead) {\n\t\t\t\towner._cleanups.add(() => ref(null))\n\t\t\t\twithin(owner, () => ref(element))\n\t\t\t}\n\t\t})\n\t}\n}\n\nexport interface SpaRoot {\n\tdispose(): void\n\tflush(): void\n}\nfunction start(\n\tsetup: () => Children,\n\thost: Element,\n\toptions: RootOptions,\n\thydrating: boolean,\n\tbefore: Node | null = null,\n): SpaRoot {\n\tlet reported = false\n\tconst cursor: Cursor | undefined = hydrating\n\t\t? {\n\t\t\t\tnode: host.firstChild,\n\t\t\t\treport(expected, found) {\n\t\t\t\t\tif (!reported) {\n\t\t\t\t\t\treported = true\n\t\t\t\t\t\t// eslint-disable-next-line no-console -- Recoverable degradation must remain human-readable in production.\n\t\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t\t`spa: hydration mismatch. Repairing server HTML to match the browser view; replaced nodes may lose focus or unsaved input.`,\n\t\t\t\t\t\t\t{ host, expected, found },\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}\n\t\t: undefined\n\tconst marker = cursor?.node\n\tconst prefix =\n\t\tmarker?.nodeType === 8 && marker.nodeValue?.startsWith(`w:`)\n\t\t\t? marker.nodeValue.slice(2)\n\t\t\t: undefined\n\tconst root = createRoot(options)\n\troot._host = host\n\tif (prefix !== undefined && options.idPrefix === undefined)\n\t\troot._prefix = prefix\n\tif (import.meta.env.DEV) trackRoot(root)\n\ttry {\n\t\tcomment(`w:${root._prefix}`, host, before, root, cursor)\n\t\twithin(root, () => {\n\t\t\tmount(\n\t\t\t\ttrackKeys(untrack(setup)),\n\t\t\t\thost,\n\t\t\t\tbefore,\n\t\t\t\troot,\n\t\t\t\thost.namespaceURI === SVG ? SVG : HTML,\n\t\t\t\tcursor,\n\t\t\t)\n\t\t})\n\t\tcomment(`/w`, host, before, root, cursor)\n\t\tfinish(cursor)\n\t\troot.flush()\n\t} catch (error) {\n\t\tfail(root, error)\n\t}\n\treturn {\n\t\tdispose: () => {\n\t\t\tdispose(root)\n\t\t},\n\t\tflush: root.flush,\n\t}\n}\nexport function render(\n\tsetup: () => Children,\n\thost: Element,\n\toptions: RootOptions = {},\n): SpaRoot {\n\tif (import.meta.env.DEV)\n\t\treturn hotRoot(\n\t\t\t(next, before) => start(setup, host, next, false, before),\n\t\t\toptions,\n\t\t\thost,\n\t\t)\n\treturn start(setup, host, options, false)\n}\nexport function hydrate(\n\tsetup: () => Children,\n\thost: Element,\n\toptions: RootOptions = {},\n): SpaRoot {\n\tif (import.meta.env.DEV) {\n\t\tlet initial = true\n\t\treturn hotRoot(\n\t\t\t(next, before) => {\n\t\t\t\tconst current = start(setup, host, next, initial, before)\n\t\t\t\tinitial = false\n\t\t\t\treturn current\n\t\t\t},\n\t\t\toptions,\n\t\t\thost,\n\t\t)\n\t}\n\treturn start(setup, host, options, true)\n}\n"],"mappings":";;;;;AAIA,MAAM,0BAAU,IAAI,QAAsC;AAC1D,MAAM,2BAAW,IAAI,QAA6B;AAClD,MAAM,SAAS;CAAC;CAAS;CAAU;AAAO;AAC1C,MAAM,aAAa,CAAC;;AAGpB,SAAgB,cAAc,SAAuC;CACpE,IAAI,UAAU,QAAQ,IAAI,OAAO;CACjC,IAAI,CAAC,SAAS;EACb,WAAW,UAAU;GACpB,MAAM,SAAS,MAAM;GACrB,MAAM,UACL,QAAQ,cAAc,cACrB,QAAQ,cAAc,WACtB,CAAC,0BAA0B,KAAK,OAAO,IAAI;GAC7C,IAAI,MAAM,UAAU,UAAU,UAAU,WACvC,QAAQ,KAAK,MAAM,eAAe,KAAK;EACzC;EACA,QAAQ,IAAI,SAAS,OAAO;CAC7B;CACA,OAAO;AACR;AAEA,SAAgB,aAAa,SAAkB,OAA8B;CAC5E,IACC,QAAQ,cAAc,WACtB,QAAQ,SAAS,YACjB,OAAO,UAAU,YACjB,QAAQ,UAAU,MAClB,OAAO,QAAQ,KAAK,MAAM,OAE1B;CACD,IAAI,QAAQ,UAAU,OAAO,KAAK,GAAG,QAAQ,QAAQ,OAAO,KAAK;CACjE,IAAI,QAAQ,cAAc,UAAU;EACnC,MAAM,SAAS;EACf,IAAI,OAAO,gB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AAU,QAAQ,KAAK,CAAC,GACxB,MACA,QACA,MACA,KAAK,iBAAiB,MAAM,MAAM,MAClC,MACD;EACD,CAAC;EACD,QAAQ,MAAM,MAAM,QAAQ,MAAM,MAAM;EACxC,OAAO,MAAM;EACb,KAAK,MAAM;CACZ,SAAS,OAAO;EACf,KAAK,MAAM,KAAK;CACjB;CACA,OAAO;EACN,eAAe;GACd,QAAQ,IAAI;EACb;EACA,OAAO,KAAK;CACb;AACD;AACA,SAAgB,OACf,OACA,MACA,UAAuB,CAAC,GACd;CAET,OAAO,SACL,MAAM,WAAW,MAAM,OAAO,MAAM,MAAM,OAAO,MAAM,GACxD,SACA,IACD;AAEF;AACA,SAAgB,QACf,OACA,MACA,UAAuB,CAAC,GACd;CACe;EACxB,IAAI,UAAU;EACd,OAAO,SACL,MAAM,WAAW;GACjB,MAAM,UAAU,MAAM,OAAO,MAAM,MAAM,SAAS,MAAM;GACxD,UAAU;GACV,OAAO;EACR,GACA,SACA,IACD;CACD;AAED"}
1
+ {"version":3,"file":"dom-C1cVf5Vm.js","names":[],"sources":["../../src/dom-forms.ts","../../src/dom.ts"],"sourcesContent":["import type { Scope } from \"./core.ts\"\nimport { enqueue, isPresent } from \"./core.ts\"\n\ntype Control = HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement\nconst changes = new WeakMap<EventListener, EventListener>()\nconst requests = new WeakMap<Element, () => void>()\nconst events = [`input`, `change`, `click`]\nconst wake = () => {}\n\n/** Keep native input events, using per-edit change semantics for text/range controls. */\nexport function changeHandler(handler: EventListener): EventListener {\n\tlet wrapped = changes.get(handler)\n\tif (!wrapped) {\n\t\twrapped = (event) => {\n\t\t\tconst target = event.target as Control | null\n\t\t\tconst editing =\n\t\t\t\ttarget?.localName === `textarea` ||\n\t\t\t\t(target?.localName === `input` &&\n\t\t\t\t\t!/^(checkbox|radio|file)$/.test(target.type))\n\t\t\tif (event.type === (editing ? `input` : `change`))\n\t\t\t\thandler.call(event.currentTarget, event)\n\t\t}\n\t\tchanges.set(handler, wrapped)\n\t}\n\treturn wrapped\n}\n\nexport function controlValue(control: Control, value: string | number): void {\n\tif (\n\t\tcontrol.localName === `input` &&\n\t\tcontrol.type === `number` &&\n\t\ttypeof value === `number` &&\n\t\tcontrol.value !== `` &&\n\t\tNumber(control.value) === value\n\t)\n\t\treturn\n\tif (control.value !== String(value)) control.value = String(value)\n\tif (control.localName === `select`) {\n\t\tconst select = control as HTMLSelectElement\n\t\tif (select.selectedIndex < 0) {\n\t\t\tconst first = [...select.options].find((option) => !option.disabled)\n\t\t\tif (first) first.selected = true\n\t\t}\n\t}\n}\n\nfunction requestRestore(control: Control): void {\n\trequests.get(control)?.()\n\tif (control.localName !== `input` || control.type !== `radio`) return\n\tconst input = control as HTMLInputElement\n\tfor (const peer of (\n\t\tinput.getRootNode() as ParentNode\n\t).querySelectorAll<HTMLInputElement>(`input`)) {\n\t\tif (\n\t\t\tpeer !== input &&\n\t\t\tpeer.type === `radio` &&\n\t\t\tpeer.name === input.name &&\n\t\t\tpeer.form === input.form\n\t\t)\n\t\t\trequests.get(peer)?.()\n\t}\n}\n\n/** Restore controlled fields after event handlers and all queued option/prop updates. */\nexport function bindForm(\n\tcontrol: Control,\n\tprops: Record<string, any>,\n\tscope: Scope,\n): void {\n\tlet active: Event | undefined\n\tlet timer: ReturnType<typeof setTimeout> | undefined\n\tconst restore = () => {\n\t\tif (!isPresent(scope)) return true\n\t\tconst value = props[`value`]\n\t\tconst checked = control.localName === `input` ? props[`checked`] : undefined\n\t\tif (active?.eventPhase) return value == null && checked == null\n\t\tif (value != null) controlValue(control, value)\n\t\tif (checked != null) {\n\t\t\tconst input = control as HTMLInputElement\n\t\t\tif (input.checked !== Boolean(checked)) input.checked = Boolean(checked)\n\t\t}\n\t\treturn true\n\t}\n\tconst finish = () => {\n\t\tactive = undefined\n\t\tclearTimeout(timer)\n\t\tenqueue(scope, wake)\n\t}\n\tconst capture = (event: Event) => {\n\t\tif (event.type === `click` && !/^(checkbox|radio)$/.test(control.type))\n\t\t\treturn\n\t\tactive = event\n\t\tclearTimeout(timer)\n\t\t// A stopped native event never reaches the root's bubble listener.\n\t\ttimer = setTimeout(() => {\n\t\t\trequestRestore(control)\n\t\t}, 0)\n\t}\n\tconst root = scope._root\n\tif (!root._forms) {\n\t\troot._forms = new Set()\n\t\tconst end = (event: Event) => {\n\t\t\tconst target = event.target as Control\n\t\t\t// Checkbox/radio change follows click and input; its handlers must see the edit.\n\t\t\tif (\n\t\t\t\tevent.type === `click` ||\n\t\t\t\t(event.type === `input` && /^(checkbox|radio)$/.test(target.type))\n\t\t\t)\n\t\t\t\treturn\n\t\t\trequestRestore(target)\n\t\t}\n\t\tfor (const event of events) root._host!.addEventListener(event, end)\n\t\troot._cleanups.add(() => {\n\t\t\tfor (const event of events) root._host!.removeEventListener(event, end)\n\t\t})\n\t}\n\tconst forms = root._forms\n\tforms.add(restore)\n\trequests.set(control, finish)\n\tfor (const event of events) control.addEventListener(event, capture, true)\n\tscope._cleanups.add(() => {\n\t\tclearTimeout(timer)\n\t\tforms.delete(restore)\n\t\trequests.delete(control)\n\t\tfor (const event of events) control.removeEventListener(event, capture, true)\n\t})\n}\n","import type { Canonical } from \"atom.io/foundations/canonical\"\n\nimport { capabilityProps } from \"./capabilities.ts\"\nimport type {\n\tAccessor,\n\tChildren,\n\tRootOptions,\n\tScope,\n\tSpaElement,\n} from \"./core.ts\"\nimport {\n\tcreateRoot,\n\tcreateScope,\n\tdispose,\n\tfail,\n\tinvalidate,\n\tobserve,\n\tplain,\n\tuntrack,\n\twithin,\n} from \"./core.ts\"\nimport { bindForm, changeHandler, controlValue } from \"./dom-forms.ts\"\nimport { hotRoot, trackRoot } from \"./hot.ts\"\nimport { identifyChildren, trackKeys } from \"./identity.ts\"\nimport { Fragment } from \"./jsx-runtime.ts\"\nimport type { PresenceCollection } from \"./presence.ts\"\nimport { instanceProps } from \"./props.ts\"\n\nconst HTML = `http://www.w3.org/1999/xhtml`\nconst SVG = `http://www.w3.org/2000/svg`\ntype Cursor = {\n\tnode: Node | null\n\treport(expected: Node | null, found: Node | null): void\n}\ntype RecordNode = {\n\t_value: Children\n\t_scope: Scope\n\t_start: Node\n\t_end: Node\n\t_index: number\n}\nfunction compatible(record: RecordNode, child: Children): boolean {\n\treturn (\n\t\ttypeof record._value === typeof child &&\n\t\t(record._value as SpaElement | null)?.type ===\n\t\t\t(child as SpaElement | null)?.type\n\t)\n}\n\nfunction finish(cursor?: Cursor): void {\n\tif (cursor?.node) {\n\t\tcursor.report(null, cursor.node)\n\t\twhile (cursor.node) {\n\t\t\tconst node: Node = cursor.node\n\t\t\tcursor.node = node.nextSibling\n\t\t\t;(node as ChildNode).remove()\n\t\t}\n\t}\n}\n\nfunction take(\n\tnode: Node,\n\tparent: Node,\n\tbefore: Node | null,\n\towner: Scope,\n\tcursor?: Cursor,\n): Node {\n\tif (\n\t\tcursor &&\n\t\t!(node.nodeType === 3 && !node.nodeValue && cursor.node?.nodeType !== 3)\n\t) {\n\t\tconst found = cursor.node\n\t\tif (\n\t\t\t!found ||\n\t\t\tfound.nodeType !== node.nodeType ||\n\t\t\tfound.nodeName !== node.nodeName ||\n\t\t\t(found as Element).namespaceURI !== (node as Element).namespaceURI ||\n\t\t\t(node.nodeType !== 1 && found.nodeValue !== node.nodeValue)\n\t\t) {\n\t\t\tcursor.report(node, found)\n\t\t\tparent.insertBefore(node, found)\n\t\t\tcursor.node = found?.nextSibling ?? null\n\t\t\t;(found as ChildNode | null)?.remove()\n\t\t} else {\n\t\t\tnode = found\n\t\t\tcursor.node = found.nextSibling\n\t\t}\n\t} else parent.insertBefore(node, cursor ? cursor.node : before)\n\towner._cleanups.add(() => {\n\t\t;(node as ChildNode).remove()\n\t})\n\treturn node\n}\nfunction comment(\n\tvalue: string,\n\tparent: Node,\n\tbefore: Node | null,\n\towner: Scope,\n\tcursor?: Cursor,\n): Node {\n\treturn take(\n\t\tparent.ownerDocument!.createComment(value),\n\t\tparent,\n\t\tbefore,\n\t\towner,\n\t\tcursor,\n\t)\n}\nfunction property(\n\telement: Element,\n\tkey: string,\n\tvalue: any,\n\tprevious: any,\n): void {\n\tif (/^(key|children|ref)$/.test(key)) return\n\tif (key === `innerHTML` && element.localName === `astro-slot`) return\n\tif (\n\t\t/^(innerHTML|outerHTML|textContent|innerText|dangerouslySetInnerHTML)$/.test(\n\t\t\tkey,\n\t\t)\n\t)\n\t\tthrow new Error(import.meta.env.DEV ? `spa: owned content` : undefined)\n\tif (key.startsWith(`on`)) {\n\t\tconst capture = /(?<!Pointer)Capture$/.test(key)\n\t\tconst event = key\n\t\t\t.slice(2, capture ? -7 : undefined)\n\t\t\t.toLowerCase()\n\t\t\t.replace(`doubleclick`, `dblclick`)\n\t\tconst events =\n\t\t\tevent === `change`\n\t\t\t\t? [`input`, `change`]\n\t\t\t\t: [event === `focus` ? `focusin` : event === `blur` ? `focusout` : event]\n\t\tif (previous)\n\t\t\tfor (const name of events)\n\t\t\t\telement.removeEventListener(\n\t\t\t\t\tname,\n\t\t\t\t\tevent === `change` ? changeHandler(previous) : previous,\n\t\t\t\t\tcapture,\n\t\t\t\t)\n\t\tif (value != null) {\n\t\t\tif (import.meta.env.DEV && typeof value !== `function`)\n\t\t\t\tthrow new Error(`spa: event handler`)\n\t\t\tfor (const name of events)\n\t\t\t\telement.addEventListener(\n\t\t\t\t\tname,\n\t\t\t\t\tevent === `change` ? changeHandler(value) : value,\n\t\t\t\t\tcapture,\n\t\t\t\t)\n\t\t}\n\t\treturn\n\t}\n\tif (key === `className`) key = `class`\n\tif (key === `htmlFor`) key = `for`\n\tif (\n\t\timport.meta.env.DEV &&\n\t\tkey === `style` &&\n\t\tvalue != null &&\n\t\ttypeof value !== `string`\n\t)\n\t\tthrow new Error(`spa: CSS string required`)\n\tif (\n\t\telement.namespaceURI === SVG &&\n\t\tkey === `focusable` &&\n\t\ttypeof value === `boolean`\n\t)\n\t\tvalue = String(value)\n\tif (\n\t\telement.namespaceURI === HTML &&\n\t\tkey in element &&\n\t\t!/^(style|form|list)$/.test(key)\n\t) {\n\t\tconst target = element as any\n\t\tif (\n\t\t\tkey === `value` &&\n\t\t\t/^(input|textarea|select)$/.test(element.localName) &&\n\t\t\tvalue != null\n\t\t)\n\t\t\tcontrolValue(target, value)\n\t\telse target[key] = value ?? (typeof target[key] === `boolean` ? false : ``)\n\t\tif (value == null) element.removeAttribute(key)\n\t} else if (value == null || (value === false && !/^(aria-|data-)/.test(key)))\n\t\telement.removeAttribute(key)\n\telse\n\t\telement.setAttribute(\n\t\t\tkey,\n\t\t\tvalue === true && !/^(aria-|data-)/.test(key) ? `` : String(value),\n\t\t)\n}\n\nfunction mount(\n\tvalue: Children,\n\tparent: Node,\n\tbefore: Node | null,\n\towner: Scope,\n\tnamespace: string,\n\tcursor?: Cursor,\n\tsource = () => value,\n\tinitialKey?: Canonical,\n): void {\n\tif (typeof value === `function`) {\n\t\tconst begin = comment(`{`, parent, before, owner, cursor)\n\t\tlet end: Node | null = null\n\t\tlet records = new Map<string | number, RecordNode>()\n\t\tlet presence: PresenceCollection<RecordNode, Children> | undefined\n\t\tconst retire = (\n\t\t\trecord: RecordNode,\n\t\t\tkey: unknown,\n\t\t\teligible: boolean,\n\t\t\tindex: number,\n\t\t) => {\n\t\t\tif (presence) presence.remove(record, key, eligible, index, () => {})\n\t\t\telse dispose(record._scope)\n\t\t}\n\t\tlet initial = cursor\n\t\tobserve(\n\t\t\towner,\n\t\t\t() => identifyChildren((source() as () => Children)()),\n\t\t\t(values) => {\n\t\t\t\tpresence ??= owner._root._presence?.collection(\n\t\t\t\t\t(record: RecordNode) => record._scope,\n\t\t\t\t\tcompatible,\n\t\t\t\t)\n\t\t\t\tconst kept = new Map<string | number, RecordNode>()\n\t\t\t\tlet previous: RecordNode | undefined\n\t\t\t\tconst focus = parent.ownerDocument!.activeElement as HTMLElement | null\n\t\t\t\tfor (let index = 0; index < values.length; index++) {\n\t\t\t\t\tconst { value: child, key, id } = values[index]\n\t\t\t\t\tlet record = records.get(id)\n\t\t\t\t\tif (record && !compatible(record, child)) {\n\t\t\t\t\t\tretire(\n\t\t\t\t\t\t\trecord,\n\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\tchild == null || typeof child === `boolean`,\n\t\t\t\t\t\t\trecord._index,\n\t\t\t\t\t\t)\n\t\t\t\t\t\trecord = undefined\n\t\t\t\t\t}\n\t\t\t\t\trecord ??= presence?.take(id, child)\n\t\t\t\t\tif (!record) {\n\t\t\t\t\t\tconst at = previous ? previous._end.nextSibling : begin.nextSibling\n\t\t\t\t\t\tconst childOwner = createScope(owner)\n\t\t\t\t\t\trecord = {\n\t\t\t\t\t\t\t_index: index,\n\t\t\t\t\t\t\t_value: child,\n\t\t\t\t\t\t\t_scope: childOwner,\n\t\t\t\t\t\t\t_start: comment(`[`, parent, at, childOwner, initial),\n\t\t\t\t\t\t\t_end: null!,\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst held = record\n\t\t\t\t\t\tmount(\n\t\t\t\t\t\t\tchild,\n\t\t\t\t\t\t\tparent,\n\t\t\t\t\t\t\tat,\n\t\t\t\t\t\t\tchildOwner,\n\t\t\t\t\t\t\tnamespace,\n\t\t\t\t\t\t\tinitial,\n\t\t\t\t\t\t\t() => held._value,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t)\n\t\t\t\t\t\trecord._end = comment(`]`, parent, at, childOwner, initial)\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Frozen descriptors opt into reuse; mutable props and accessors must refresh.\n\t\t\t\t\t\tconst reusable =\n\t\t\t\t\t\t\trecord._value === child &&\n\t\t\t\t\t\t\ttypeof child === `object` &&\n\t\t\t\t\t\t\tchild !== null &&\n\t\t\t\t\t\t\tObject.isFrozen(child) &&\n\t\t\t\t\t\t\tObject.isFrozen((child as SpaElement).props)\n\t\t\t\t\t\trecord._value = child\n\t\t\t\t\t\towner._root._presence?.resume(record._scope)\n\t\t\t\t\t\tif (!reusable) invalidate(record._scope)\n\t\t\t\t\t}\n\t\t\t\t\trecord._index = index\n\t\t\t\t\tprevious = record\n\t\t\t\t\tkept.set(id, record)\n\t\t\t\t}\n\t\t\t\tfor (const [key, record] of records)\n\t\t\t\t\tif (!kept.has(key)) retire(record, key, true, record._index)\n\t\t\t\tif (!initial) {\n\t\t\t\t\tlet at = end ?? before\n\t\t\t\t\tconst rendered = presence?.merge([...kept.values()]) ?? [\n\t\t\t\t\t\t...kept.values(),\n\t\t\t\t\t]\n\t\t\t\t\tfor (const record of rendered.reverse()) {\n\t\t\t\t\t\tif (record._end.nextSibling !== at) {\n\t\t\t\t\t\t\tconst range = parent.ownerDocument!.createRange()\n\t\t\t\t\t\t\trange.setStartBefore(record._start)\n\t\t\t\t\t\t\trange.setEndAfter(record._end)\n\t\t\t\t\t\t\tparent.insertBefore(range.extractContents(), at)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tat = record._start\n\t\t\t\t\t}\n\t\t\t\t\tif (\n\t\t\t\t\t\tfocus?.isConnected &&\n\t\t\t\t\t\t!focus.closest(`[inert]`) &&\n\t\t\t\t\t\tfocus !== parent.ownerDocument!.activeElement\n\t\t\t\t\t)\n\t\t\t\t\t\tfocus.focus({ preventScroll: true })\n\t\t\t\t}\n\t\t\t\tinitial = undefined\n\t\t\t\trecords = kept\n\t\t\t},\n\t\t)\n\t\tend = comment(`}`, parent, before, owner, cursor)\n\t\treturn\n\t}\n\tif (Array.isArray(value)) {\n\t\tfor (const child of value)\n\t\t\tmount(child, parent, before, owner, namespace, cursor)\n\t\treturn\n\t}\n\tif (value == null || typeof value === `boolean`) return\n\tif (typeof value !== `object`) {\n\t\tcomment(`t`, parent, before, owner, cursor)\n\t\tconst text = take(\n\t\t\tparent.ownerDocument!.createTextNode(String(value)),\n\t\t\tparent,\n\t\t\tbefore,\n\t\t\towner,\n\t\t\tcursor,\n\t\t)\n\t\tobserve(owner, source as Accessor<string | number | bigint>, (next) => {\n\t\t\tconst data = String(next)\n\t\t\tif (text.nodeValue !== data) text.nodeValue = data\n\t\t})\n\t\treturn\n\t}\n\tif (import.meta.env.DEV && (!(`type` in value) || !(`props` in value)))\n\t\tthrow new Error(`spa: invalid child`)\n\tconst vnode = value as SpaElement\n\tconst props = instanceProps(() => (source() as SpaElement).props, initialKey)\n\tif (!vnode.type || vnode.type === Fragment) {\n\t\tmount(() => props[`children`], parent, before, owner, namespace, cursor)\n\t\treturn\n\t}\n\tif (typeof vnode.type === `function`) {\n\t\tconst childOwner = createScope(owner)\n\t\tconst output = within(childOwner, () =>\n\t\t\tuntrack(() => (vnode.type as Function)(props)),\n\t\t)\n\t\tmount(trackKeys(output), parent, before, childOwner, namespace, cursor)\n\t\treturn\n\t}\n\tconst ns = vnode.type === `svg` ? SVG : namespace\n\tconst element = take(\n\t\tparent.ownerDocument!.createElementNS(ns, vnode.type),\n\t\tparent,\n\t\tbefore,\n\t\towner,\n\t\tcursor,\n\t) as Element\n\tif (ns === HTML && /^(input|textarea|select)$/.test(vnode.type))\n\t\tbindForm(element as HTMLInputElement, props, owner)\n\tif (ns === HTML && (props[`autoFocus`] || props[`autofocus`])) {\n\t\towner._root._mounts!.push(() => {\n\t\t\tif (!owner._dead) (element as HTMLElement).focus()\n\t\t})\n\t}\n\tif (vnode.type === `astro-slot`) {\n\t\tif (!cursor) element.innerHTML = props[`innerHTML`] ?? ``\n\t} else if (ns === HTML && /^(textarea|title|style|script)$/.test(vnode.type)) {\n\t\tobserve(\n\t\t\towner,\n\t\t\t() =>\n\t\t\t\tplain(\n\t\t\t\t\tvnode.type === `textarea`\n\t\t\t\t\t\t? (props[`value`] ?? props[`children`])\n\t\t\t\t\t\t: props[`children`],\n\t\t\t\t),\n\t\t\t(text) => {\n\t\t\t\tif (element.textContent !== text) element.textContent = text\n\t\t\t},\n\t\t)\n\t} else {\n\t\tconst children = cursor\n\t\t\t? { node: element.firstChild, report: cursor.report }\n\t\t\t: undefined\n\t\tif (\n\t\t\t!/^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/.test(\n\t\t\t\tvnode.type,\n\t\t\t) ||\n\t\t\tns !== HTML\n\t\t)\n\t\t\tmount(\n\t\t\t\t() => props[`children`],\n\t\t\t\telement,\n\t\t\t\tnull,\n\t\t\t\towner,\n\t\t\t\tvnode.type === `foreignObject` ? HTML : ns,\n\t\t\t\tchildren,\n\t\t\t)\n\t\tfinish(children)\n\t}\n\tlet previous: Record<string, any> = {}\n\tconst nativeProps = capabilityProps(\n\t\towner,\n\t\t{ kind: `dom`, node: element },\n\t\t() => ({ ...props }),\n\t\t(next) => {\n\t\t\tconst previousStyle =\n\t\t\t\tprevious[`style`] !== next[`style`]\n\t\t\t\t\t? (element.getAttribute(`style`) ?? ``)\n\t\t\t\t\t: undefined\n\t\t\tfor (const key in { ...previous, ...next })\n\t\t\t\tif (\n\t\t\t\t\t!Object.is(previous[key], next[key]) ||\n\t\t\t\t\ttypeof next[key] === `object`\n\t\t\t\t) {\n\t\t\t\t\tproperty(element, key, next[key], previous[key])\n\t\t\t\t\tprevious[key] = next[key]\n\t\t\t\t}\n\t\t\tprevious = next\n\t\t\treturn previousStyle\n\t\t},\n\t)\n\towner._cleanups.add(() => {\n\t\tfor (const key in previous)\n\t\t\tif (key.startsWith(`on`)) property(element, key, null, previous[key])\n\t})\n\tobserve(owner, () => ({ ...props }), nativeProps)\n\tconst ref = untrack(() => props[`ref`])\n\tif (ref) {\n\t\towner._root._mounts!.unshift(() => {\n\t\t\tif (!owner._dead) {\n\t\t\t\towner._cleanups.add(() => ref(null))\n\t\t\t\twithin(owner, () => ref(element))\n\t\t\t}\n\t\t})\n\t}\n}\n\nexport interface SpaRoot {\n\tdispose(): void\n\tflush(): void\n}\nfunction start(\n\tsetup: () => Children,\n\thost: Element,\n\toptions: RootOptions,\n\thydrating: boolean,\n\tbefore: Node | null = null,\n): SpaRoot {\n\tlet reported = false\n\tconst cursor: Cursor | undefined = hydrating\n\t\t? {\n\t\t\t\tnode: host.firstChild,\n\t\t\t\treport(expected, found) {\n\t\t\t\t\tif (!reported) {\n\t\t\t\t\t\treported = true\n\t\t\t\t\t\t// eslint-disable-next-line no-console -- Recoverable degradation must remain human-readable in production.\n\t\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t\t`spa: hydration mismatch. Repairing server HTML to match the browser view; replaced nodes may lose focus or unsaved input.`,\n\t\t\t\t\t\t\t{ host, expected, found },\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}\n\t\t: undefined\n\tconst marker = cursor?.node\n\tconst prefix =\n\t\tmarker?.nodeType === 8 && marker.nodeValue?.startsWith(`w:`)\n\t\t\t? marker.nodeValue.slice(2)\n\t\t\t: undefined\n\tconst root = createRoot(options)\n\troot._host = host\n\tif (prefix !== undefined && options.idPrefix === undefined)\n\t\troot._prefix = prefix\n\tif (import.meta.env.DEV) trackRoot(root)\n\ttry {\n\t\tcomment(`w:${root._prefix}`, host, before, root, cursor)\n\t\twithin(root, () => {\n\t\t\tmount(\n\t\t\t\ttrackKeys(untrack(setup)),\n\t\t\t\thost,\n\t\t\t\tbefore,\n\t\t\t\troot,\n\t\t\t\thost.namespaceURI === SVG ? SVG : HTML,\n\t\t\t\tcursor,\n\t\t\t)\n\t\t})\n\t\tcomment(`/w`, host, before, root, cursor)\n\t\tfinish(cursor)\n\t\troot.flush()\n\t} catch (error) {\n\t\tfail(root, error)\n\t}\n\treturn {\n\t\tdispose: () => {\n\t\t\tdispose(root)\n\t\t},\n\t\tflush: root.flush,\n\t}\n}\nexport function render(\n\tsetup: () => Children,\n\thost: Element,\n\toptions: RootOptions = {},\n): SpaRoot {\n\tif (import.meta.env.DEV)\n\t\treturn hotRoot(\n\t\t\t(next, before) => start(setup, host, next, false, before),\n\t\t\toptions,\n\t\t\thost,\n\t\t)\n\treturn start(setup, host, options, false)\n}\nexport function hydrate(\n\tsetup: () => Children,\n\thost: Element,\n\toptions: RootOptions = {},\n): SpaRoot {\n\tif (import.meta.env.DEV) {\n\t\tlet initial = true\n\t\treturn hotRoot(\n\t\t\t(next, before) => {\n\t\t\t\tconst current = start(setup, host, next, initial, before)\n\t\t\t\tinitial = false\n\t\t\t\treturn current\n\t\t\t},\n\t\t\toptions,\n\t\t\thost,\n\t\t)\n\t}\n\treturn start(setup, host, options, true)\n}\n"],"mappings":";;;;;AAIA,MAAM,0BAAU,IAAI,QAAsC;AAC1D,MAAM,2BAAW,IAAI,QAA6B;AAClD,MAAM,SAAS;CAAC;CAAS;CAAU;AAAO;AAC1C,MAAM,aAAa,CAAC;;AAGpB,SAAgB,cAAc,SAAuC;CACpE,IAAI,UAAU,QAAQ,IAAI,OAAO;CACjC,IAAI,CAAC,SAAS;EACb,WAAW,UAAU;GACpB,MAAM,SAAS,MAAM;GACrB,MAAM,UACL,QAAQ,cAAc,cACrB,QAAQ,cAAc,WACtB,CAAC,0BAA0B,KAAK,OAAO,IAAI;GAC7C,IAAI,MAAM,UAAU,UAAU,UAAU,WACvC,QAAQ,KAAK,MAAM,eAAe,KAAK;EACzC;EACA,QAAQ,IAAI,SAAS,OAAO;CAC7B;CACA,OAAO;AACR;AAEA,SAAgB,aAAa,SAAkB,OAA8B;CAC5E,IACC,QAAQ,cAAc,WACtB,QAAQ,SAAS,YACjB,OAAO,UAAU,YACjB,QAAQ,UAAU,MAClB,OAAO,QAAQ,KAAK,MAAM,OAE1B;CACD,IAAI,QAAQ,UAAU,OAAO,KAAK,GAAG,QAAQ,QAAQ,OAAO,KAAK;CACjE,IAAI,QAAQ,cAAc,UAAU;EACnC,MAAM,SAAS;EACf,IAAI,OAAO,gBAAgB,GAAG;GAC7B,MAAM,QAAQ,CAAC,GAAG,OAAO,OAAO,CAAC,CAAC,MAAM,WAAW,CAAC,OAAO,QAAQ;GACnE,IAAI,OAAO,MAAM,WAAW;EAC7B;CACD;AACD;AAEA,SAAS,eAAe,SAAwB;CAC/C,SAAS,IAAI,OAAO,CAAC,GAAG;CACxB,IAAI,QAAQ,cAAc,WAAW,QAAQ,SAAS,SAAS;CAC/D,MAAM,QAAQ;CACd,KAAK,MAAM,Q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B,OACf,OACA,MACA,UAAuB,CAAC,GACd;CAET,OAAO,SACL,MAAM,WAAW,MAAM,OAAO,MAAM,MAAM,OAAO,MAAM,GACxD,SACA,IACD;AAEF;AACA,SAAgB,QACf,OACA,MACA,UAAuB,CAAC,GACd;CACe;EACxB,IAAI,UAAU;EACd,OAAO,SACL,MAAM,WAAW;GACjB,MAAM,UAAU,MAAM,OAAO,MAAM,MAAM,SAAS,MAAM;GACxD,UAAU;GACV,OAAO;EACR,GACA,SACA,IACD;CACD;AAED"}
@@ -1,5 +1,5 @@
1
- import { D as within, f as onMount, h as reportScopeError } from "./core-DrUd8x25.js";
2
1
  import { autoUpdate, computePosition } from "@floating-ui/dom";
2
+ import { D as within, f as onMount, h as reportScopeError } from "./core-D1FWUMMC.js";
3
3
  // src/floating.ts
4
4
  const allowed = /* @__PURE__ */ new Set([
5
5
  `reference`,
@@ -1,5 +1,5 @@
1
- import { p as owner, u as onCleanup } from "./core-DrUd8x25.js";
2
1
  import { IMPLICIT } from "atom.io/internal";
2
+ import { p as owner, u as onCleanup } from "./core-D1FWUMMC.js";
3
3
  // src/hot.ts
4
4
  function createHotRuntime() {
5
5
  const components = /* @__PURE__ */ new Map();
@@ -1,4 +1,4 @@
1
- import { _ as scopeCapabilities, c as isPresent } from "./core-DD2giR6E.js";
1
+ import { _ as scopeCapabilities, c as isPresent } from "./core-D1FWUMMC.js";
2
2
  import { packCanonical } from "atom.io/foundations/canonical";
3
3
  // src/capabilities.ts
4
4
  function capabilityNamespace(key) {
@@ -118,4 +118,4 @@ function identifyChildren(output, duplicate = `spa: duplicate key`) {
118
118
  }
119
119
  export { validateCapabilities as a, capabilityProps as i, trackKeys as n, capabilityNamespace as r, identifyChildren as t };
120
120
 
121
- //# sourceMappingURL=identity-ByJswZtF.js.map
121
+ //# sourceMappingURL=identity-DWHH6jbd.js.map