@adobe/data 0.9.5 → 0.9.6

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 (240) hide show
  1. package/ecs/database/create-plugin-cryos-pattern.test.d.ts +3 -0
  2. package/ecs/database/create-plugin-cryos-pattern.test.js +83 -0
  3. package/ecs/database/create-plugin-cryos-pattern.test.js.map +1 -0
  4. package/ecs/database/create-plugin-graphics.test.d.ts +93 -0
  5. package/ecs/database/create-plugin-graphics.test.js +135 -0
  6. package/ecs/database/create-plugin-graphics.test.js.map +1 -0
  7. package/ecs/database/create-plugin-type.type-test.js +563 -0
  8. package/ecs/database/create-plugin-type.type-test.js.map +1 -0
  9. package/ecs/database/create-plugin-type.type.test.js +563 -0
  10. package/ecs/database/create-plugin-type.type.test.js.map +1 -0
  11. package/ecs/database/database.d.ts +6 -1
  12. package/ecs/database/database.js.map +1 -1
  13. package/ecs/database/experimental-action-types.js +275 -0
  14. package/ecs/database/experimental-action-types.js.map +1 -0
  15. package/ecs/database/from-plugin.type-test.js +180 -0
  16. package/ecs/database/from-plugin.type-test.js.map +1 -0
  17. package/ecs/database/plugin-types.js +5 -0
  18. package/ecs/database/plugin-types.js.map +1 -0
  19. package/ecs/database/type-investigation.test.js +54 -0
  20. package/ecs/database/type-investigation.test.js.map +1 -0
  21. package/ecs/store/core/create-core.test.js +21 -0
  22. package/ecs/store/core/create-core.test.js.map +1 -1
  23. package/package.json +1 -1
  24. package/tsconfig.tsbuildinfo +1 -1
  25. package/typed-buffer/create-array-buffer.js +10 -0
  26. package/typed-buffer/create-array-buffer.js.map +1 -1
  27. package/typed-buffer/create-array-buffer.test.js +50 -0
  28. package/typed-buffer/create-array-buffer.test.js.map +1 -1
  29. package/typed-buffer/create-const-buffer.js +3 -0
  30. package/typed-buffer/create-const-buffer.js.map +1 -1
  31. package/typed-buffer/create-const-buffer.test.js +24 -0
  32. package/typed-buffer/create-const-buffer.test.js.map +1 -1
  33. package/typed-buffer/create-number-buffer.js +4 -0
  34. package/typed-buffer/create-number-buffer.js.map +1 -1
  35. package/typed-buffer/create-number-buffer.test.js +38 -0
  36. package/typed-buffer/create-number-buffer.test.js.map +1 -1
  37. package/typed-buffer/create-struct-buffer.js +11 -0
  38. package/typed-buffer/create-struct-buffer.js.map +1 -1
  39. package/typed-buffer/create-struct-buffer.test.js +60 -0
  40. package/typed-buffer/create-struct-buffer.test.js.map +1 -1
  41. package/typed-buffer/typed-buffer.d.ts +2 -0
  42. package/typed-buffer/typed-buffer.js.map +1 -1
  43. package/assembly/package.json +0 -1
  44. package/blob/package.json +0 -1
  45. package/cache/package.json +0 -1
  46. package/debug-type-test.js +0 -12
  47. package/debug-type-test.js.map +0 -1
  48. package/ecs/database/archetype-type-safety-test.d.ts +0 -21
  49. package/ecs/database/archetype-type-safety-test.js +0 -36
  50. package/ecs/database/archetype-type-safety-test.js.map +0 -1
  51. package/ecs/database/create-database-schema-test.js +0 -150
  52. package/ecs/database/create-database-schema-test.js.map +0 -1
  53. package/ecs/database/create-plugin-v2.d.ts +0 -79
  54. package/ecs/database/create-plugin-v2.js +0 -68
  55. package/ecs/database/create-plugin-v2.js.map +0 -1
  56. package/ecs/database/create-plugin-v2.test.js +0 -362
  57. package/ecs/database/create-plugin-v2.test.js.map +0 -1
  58. package/ecs/database/create-plugin.OLD.d.ts +0 -138
  59. package/ecs/database/create-plugin.OLD.js +0 -59
  60. package/ecs/database/create-plugin.OLD.js.map +0 -1
  61. package/ecs/database/database-with-systems.test.js +0 -292
  62. package/ecs/database/database-with-systems.test.js.map +0 -1
  63. package/ecs/database/database.plugin.create.test.OLD.js +0 -601
  64. package/ecs/database/database.plugin.create.test.OLD.js.map +0 -1
  65. package/ecs/database/database.plugin.create.test.js +0 -321
  66. package/ecs/database/database.plugin.create.test.js.map +0 -1
  67. package/ecs/database/database.plugin.test.d.ts +0 -1
  68. package/ecs/database/database.plugin.test.js +0 -90
  69. package/ecs/database/database.plugin.test.js.map +0 -1
  70. package/ecs/database/database.test copy.d.ts +0 -1
  71. package/ecs/database/database.test copy.js +0 -199
  72. package/ecs/database/database.test copy.js.map +0 -1
  73. package/ecs/database/multi-param-inference-poc.test.d.ts +0 -1
  74. package/ecs/database/multi-param-inference-poc.test.js +0 -96
  75. package/ecs/database/multi-param-inference-poc.test.js.map +0 -1
  76. package/ecs/database/old-plugin-create-with-dependencies-array.d.ts +0 -61
  77. package/ecs/database/old-plugin-create-with-dependencies-array.js +0 -76
  78. package/ecs/database/old-plugin-create-with-dependencies-array.js.map +0 -1
  79. package/ecs/database/overload-inference-poc.test.d.ts +0 -1
  80. package/ecs/database/overload-inference-poc.test.js +0 -109
  81. package/ecs/database/overload-inference-poc.test.js.map +0 -1
  82. package/ecs/database/schedule-type-check-demo.d.ts +0 -10
  83. package/ecs/database/schedule-type-check-demo.js +0 -71
  84. package/ecs/database/schedule-type-check-demo.js.map +0 -1
  85. package/ecs/database/test-archetype-validation.d.ts +0 -9
  86. package/ecs/database/test-archetype-validation.js +0 -14
  87. package/ecs/database/test-archetype-validation.js.map +0 -1
  88. package/ecs/database/test-exactkeys.d.ts +0 -1
  89. package/ecs/database/test-exactkeys.js +0 -17
  90. package/ecs/database/test-exactkeys.js.map +0 -1
  91. package/ecs/database/transactional-store/coalesce-transactions.test.js +0 -433
  92. package/ecs/database/transactional-store/coalesce-transactions.test.js.map +0 -1
  93. package/ecs/database/type-inference-demo.d.ts +0 -75
  94. package/ecs/database/type-inference-demo.js +0 -73
  95. package/ecs/database/type-inference-demo.js.map +0 -1
  96. package/ecs/database/type-inference-poc.test.d.ts +0 -1
  97. package/ecs/database/type-inference-poc.test.js +0 -73
  98. package/ecs/database/type-inference-poc.test.js.map +0 -1
  99. package/ecs/package.json +0 -1
  100. package/ecs/plugins/scheduler/create-scheduler-plugin.d.ts +0 -8
  101. package/ecs/plugins/scheduler/create-scheduler-plugin.js +0 -54
  102. package/ecs/plugins/scheduler/create-scheduler-plugin.js.map +0 -1
  103. package/ecs/plugins/scheduler/create-scheduler-plugin.test.d.ts +0 -1
  104. package/ecs/plugins/scheduler/create-scheduler-plugin.test.js +0 -198
  105. package/ecs/plugins/scheduler/create-scheduler-plugin.test.js.map +0 -1
  106. package/ecs/plugins/scheduler/type-inference-test.d.ts +0 -1
  107. package/ecs/plugins/scheduler/type-inference-test.js +0 -2
  108. package/ecs/plugins/scheduler/type-inference-test.js.map +0 -1
  109. package/ecs/store/entity-functions.d.ts +0 -7
  110. package/ecs/store/entity-functions.js +0 -2
  111. package/ecs/store/entity-functions.js.map +0 -1
  112. package/ecs/store/functions.d.ts +0 -2
  113. package/ecs/store/functions.js +0 -2
  114. package/ecs/store/functions.js.map +0 -1
  115. package/ecs/system/system-declaration.d.ts +0 -7
  116. package/ecs/system/system-declaration.js +0 -23
  117. package/ecs/system/system-declaration.js.map +0 -1
  118. package/ecs/system/system-declarations.d.ts +0 -4
  119. package/ecs/system/system-declarations.js +0 -23
  120. package/ecs/system/system-declarations.js.map +0 -1
  121. package/ecs/system/system-factory/public/create copy.d.ts +0 -12
  122. package/ecs/system/system-factory/public/create copy.js +0 -8
  123. package/ecs/system/system-factory/public/create copy.js.map +0 -1
  124. package/ecs/system/system-factory/public/create.d.ts +0 -12
  125. package/ecs/system/system-factory/public/create.js +0 -8
  126. package/ecs/system/system-factory/public/create.js.map +0 -1
  127. package/ecs/system/system-factory/public/create.test.d.ts +0 -1
  128. package/ecs/system/system-factory/public/create.test.js +0 -42
  129. package/ecs/system/system-factory/public/create.test.js.map +0 -1
  130. package/ecs/system/system-factory/public/index.d.ts +0 -1
  131. package/ecs/system/system-factory/public/index.js +0 -2
  132. package/ecs/system/system-factory/public/index.js.map +0 -1
  133. package/ecs/system/system-factory/system-factory.d.ts +0 -17
  134. package/ecs/system/system-factory/system-factory.js +0 -23
  135. package/ecs/system/system-factory/system-factory.js.map +0 -1
  136. package/ecs/system/system-factory.d.ts +0 -9
  137. package/ecs/system/system-factory.js +0 -23
  138. package/ecs/system/system-factory.js.map +0 -1
  139. package/ecs/system/system-interface.d.ts +0 -5
  140. package/ecs/system/system-interface.js +0 -2
  141. package/ecs/system/system-interface.js.map +0 -1
  142. package/ecs/system/system.d.ts +0 -4
  143. package/ecs/system/system.js +0 -23
  144. package/ecs/system/system.js.map +0 -1
  145. package/ecs/system/systems-type.d.ts +0 -2
  146. package/ecs/system/systems-type.js +0 -2
  147. package/ecs/system/systems-type.js.map +0 -1
  148. package/ecs/system/systems.d.ts +0 -2
  149. package/ecs/system/systems.js +0 -23
  150. package/ecs/system/systems.js.map +0 -1
  151. package/ecs/system/world-schema/public/create.d.ts +0 -12
  152. package/ecs/system/world-schema/public/create.js +0 -8
  153. package/ecs/system/world-schema/public/create.js.map +0 -1
  154. package/ecs/system/world-schema/public/create.test.d.ts +0 -1
  155. package/ecs/system/world-schema/public/create.test.js +0 -42
  156. package/ecs/system/world-schema/public/create.test.js.map +0 -1
  157. package/ecs/system/world-schema/public/index.d.ts +0 -1
  158. package/ecs/system/world-schema/public/index.js +0 -2
  159. package/ecs/system/world-schema/public/index.js.map +0 -1
  160. package/ecs/system/world-schema/system-factory.d.ts +0 -17
  161. package/ecs/system/world-schema/system-factory.js +0 -23
  162. package/ecs/system/world-schema/system-factory.js.map +0 -1
  163. package/ecs/world/calculate-system-order.d.ts +0 -18
  164. package/ecs/world/calculate-system-order.js +0 -113
  165. package/ecs/world/calculate-system-order.js.map +0 -1
  166. package/ecs/world/calculate-system-order.test.d.ts +0 -1
  167. package/ecs/world/calculate-system-order.test.js +0 -168
  168. package/ecs/world/calculate-system-order.test.js.map +0 -1
  169. package/ecs/world/create-world-schema-test.d.ts +0 -1
  170. package/ecs/world/create-world-schema-test.js +0 -294
  171. package/ecs/world/create-world-schema-test.js.map +0 -1
  172. package/ecs/world/create-world-type-test.d.ts +0 -1
  173. package/ecs/world/create-world-type-test.js +0 -129
  174. package/ecs/world/create-world-type-test.js.map +0 -1
  175. package/ecs/world/create-world.d.ts +0 -19
  176. package/ecs/world/create-world.js +0 -80
  177. package/ecs/world/create-world.js.map +0 -1
  178. package/ecs/world/create-world.test.d.ts +0 -1
  179. package/ecs/world/create-world.test.js +0 -292
  180. package/ecs/world/create-world.test.js.map +0 -1
  181. package/ecs/world/public/world-schema/public/create.d.ts +0 -12
  182. package/ecs/world/public/world-schema/public/create.js +0 -8
  183. package/ecs/world/public/world-schema/public/create.js.map +0 -1
  184. package/ecs/world/public/world-schema/public/create.test.d.ts +0 -1
  185. package/ecs/world/public/world-schema/public/create.test.js +0 -42
  186. package/ecs/world/public/world-schema/public/create.test.js.map +0 -1
  187. package/ecs/world/public/world-schema/public/index.d.ts +0 -1
  188. package/ecs/world/public/world-schema/public/index.js +0 -2
  189. package/ecs/world/public/world-schema/public/index.js.map +0 -1
  190. package/ecs/world/public/world-schema/world-schema.d.ts +0 -17
  191. package/ecs/world/public/world-schema/world-schema.js +0 -23
  192. package/ecs/world/public/world-schema/world-schema.js.map +0 -1
  193. package/ecs/world/system-declaration.d.ts +0 -1
  194. package/ecs/world/system-declaration.js +0 -23
  195. package/ecs/world/system-declaration.js.map +0 -1
  196. package/ecs/world/system-schedule-typing-test.d.ts +0 -1
  197. package/ecs/world/system-schedule-typing-test.js +0 -83
  198. package/ecs/world/system-schedule-typing-test.js.map +0 -1
  199. package/ecs/world/world-schema/public/create.d.ts +0 -12
  200. package/ecs/world/world-schema/public/create.js +0 -10
  201. package/ecs/world/world-schema/public/create.js.map +0 -1
  202. package/ecs/world/world-schema/public/create.test.d.ts +0 -1
  203. package/ecs/world/world-schema/public/create.test.js +0 -41
  204. package/ecs/world/world-schema/public/create.test.js.map +0 -1
  205. package/ecs/world/world-schema/public/index.d.ts +0 -1
  206. package/ecs/world/world-schema/public/index.js +0 -2
  207. package/ecs/world/world-schema/public/index.js.map +0 -1
  208. package/ecs/world/world-schema/system-factory.d.ts +0 -17
  209. package/ecs/world/world-schema/system-factory.js +0 -23
  210. package/ecs/world/world-schema/system-factory.js.map +0 -1
  211. package/ecs/world/world-schema/world-schema.d.ts +0 -19
  212. package/ecs/world/world-schema/world-schema.js +0 -23
  213. package/ecs/world/world-schema/world-schema.js.map +0 -1
  214. package/ecs/world/world.d.ts +0 -86
  215. package/ecs/world/world.js +0 -81
  216. package/ecs/world/world.js.map +0 -1
  217. package/ecs/world/world.test.d.ts +0 -1
  218. package/ecs/world/world.test.js +0 -176
  219. package/ecs/world/world.test.js.map +0 -1
  220. package/functions/package.json +0 -1
  221. package/lit/elements/application-element copy.d.ts +0 -9
  222. package/lit/elements/application-element copy.js +0 -62
  223. package/lit/elements/application-element copy.js.map +0 -1
  224. package/lit/package.json +0 -1
  225. package/math/package.json +0 -1
  226. package/observe/package.json +0 -1
  227. package/old-ecs/package.json +0 -1
  228. package/perftest/package.json +0 -1
  229. package/samples/package.json +0 -1
  230. package/schema/package.json +0 -1
  231. package/service/package.json +0 -1
  232. package/table/package.json +0 -1
  233. package/typed-buffer/package.json +0 -1
  234. package/types/package.json +0 -1
  235. /package/{debug-type-test.d.ts → ecs/database/create-plugin-type.type-test.d.ts} +0 -0
  236. /package/ecs/database/{create-database-schema-test.d.ts → create-plugin-type.type.test.d.ts} +0 -0
  237. /package/ecs/database/{create-plugin-v2.test.d.ts → experimental-action-types.d.ts} +0 -0
  238. /package/ecs/database/{database-with-systems.test.d.ts → from-plugin.type-test.d.ts} +0 -0
  239. /package/ecs/database/{database.plugin.create.test.OLD.d.ts → plugin-types.d.ts} +0 -0
  240. /package/ecs/database/{database.plugin.create.test.d.ts → type-investigation.test.d.ts} +0 -0
@@ -1,23 +0,0 @@
1
- /*MIT License
2
-
3
- © Copyright 2025 Adobe. All rights reserved.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.*/
22
- export * as SystemFactory from "./public/index.js";
23
- //# sourceMappingURL=system-factory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"system-factory.js","sourceRoot":"","sources":["../../../../src/ecs/system/system-factory/system-factory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAQX,OAAO,KAAK,aAAa,MAAM,mBAAmB,CAAC"}
@@ -1,9 +0,0 @@
1
- import { FromSchemas } from "../../schema/index.js";
2
- import { StringKeyof } from "../../types/types.js";
3
- import { ArchetypeComponents, ComponentSchemas, Database, ResourceSchemas } from "../index.js";
4
- import { ActionDeclarations, ToActionFunctions } from "../store/action-functions.js";
5
- import { Systems } from "./systems.js";
6
- export interface SystemFactory<C extends ComponentSchemas, R extends ResourceSchemas, A extends ArchetypeComponents<StringKeyof<C>>, TD extends ActionDeclarations<FromSchemas<C>, FromSchemas<R>, A>, S extends string> {
7
- schema: Database.Schema<C, R, A, TD>;
8
- create(db: Database<FromSchemas<C>, FromSchemas<R>, A, ToActionFunctions<TD>>): Systems<S>;
9
- }
@@ -1,23 +0,0 @@
1
- /*MIT License
2
-
3
- © Copyright 2025 Adobe. All rights reserved.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.*/
22
- export {};
23
- //# sourceMappingURL=system-factory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"system-factory.js","sourceRoot":"","sources":["../../../src/ecs/system/system-factory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW"}
@@ -1,5 +0,0 @@
1
- export interface System {
2
- execute(): void;
3
- readonly after?: readonly string[];
4
- readonly before?: readonly string[];
5
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=system-interface.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"system-interface.js","sourceRoot":"","sources":["../../../src/ecs/system/system-interface.ts"],"names":[],"mappings":""}
@@ -1,4 +0,0 @@
1
- export interface SystemDeclaration {
2
- readonly after?: readonly string[];
3
- readonly before?: readonly string[];
4
- }
@@ -1,23 +0,0 @@
1
- /*MIT License
2
-
3
- © Copyright 2025 Adobe. All rights reserved.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.*/
22
- export {};
23
- //# sourceMappingURL=system.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"system.js","sourceRoot":"","sources":["../../../src/ecs/system/system.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW"}
@@ -1,2 +0,0 @@
1
- import { System } from "./system-interface.js";
2
- export type Systems<S extends string> = Record<S, System>;
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=systems-type.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"systems-type.js","sourceRoot":"","sources":["../../../src/ecs/system/systems-type.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import { SystemDeclaration } from "./system-declaration.js";
2
- export type Systems<S extends string> = Record<S, SystemDeclaration>;
@@ -1,23 +0,0 @@
1
- /*MIT License
2
-
3
- © Copyright 2025 Adobe. All rights reserved.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.*/
22
- export {};
23
- //# sourceMappingURL=systems.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"systems.js","sourceRoot":"","sources":["../../../src/ecs/system/systems.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW"}
@@ -1,12 +0,0 @@
1
- import { FromSchemas } from "../../../../schema/from-schemas.js";
2
- import { StringKeyof } from "../../../../types/types.js";
3
- import { ComponentSchemas } from "../../../component-schemas.js";
4
- import { ArchetypeComponents, Database } from "../../../index.js";
5
- import { ResourceSchemas } from "../../../resource-schemas.js";
6
- import { ActionDeclarations, ToActionFunctions } from "../../../store/action-functions.js";
7
- import { SystemDeclarations, SystemFunctions } from "../system-factory.js";
8
- export declare function create<C extends ComponentSchemas, R extends ResourceSchemas, A extends ArchetypeComponents<StringKeyof<C>>, T extends ActionDeclarations<FromSchemas<C>, FromSchemas<R>, A>, S extends string>(schema: Database.Schema<C, R, A, T>, systems: SystemDeclarations<S>, create: (db: Database<FromSchemas<C>, FromSchemas<R>, A, ToActionFunctions<T>>) => SystemFunctions<S>): {
9
- readonly schema: Database.Schema<C, R, A, T>;
10
- readonly systems: SystemDeclarations<S>;
11
- readonly create: (db: Database<FromSchemas<C>, FromSchemas<R>, A, ToActionFunctions<T>>) => SystemFunctions<S>;
12
- };
@@ -1,8 +0,0 @@
1
- export function create(schema, systems, create) {
2
- return {
3
- schema,
4
- systems,
5
- create,
6
- };
7
- }
8
- //# sourceMappingURL=create.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../../src/ecs/system/world-schema/public/create.ts"],"names":[],"mappings":"AASA,MAAM,UAAU,MAAM,CAOlB,MAAmC,EACnC,OAA8B,EAC9B,MAAqG;IAErG,OAAO;QACH,MAAM;QACN,OAAO;QACP,MAAM;KACuC,CAAC;AACtD,CAAC"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,42 +0,0 @@
1
- import { Vec3 } from "../../../../math/index.js";
2
- import { Time } from "../../../../schema/index.js";
3
- import { Database } from "../../../index.js";
4
- import { create } from "./create.js";
5
- import { describe, expect, it } from "vitest";
6
- describe("create", () => {
7
- it("should create a system factory", () => {
8
- const graphics = create(Database.Schema.create({
9
- components: {
10
- position: Vec3.schema,
11
- velocity: Vec3.schema,
12
- },
13
- resources: {
14
- time: Time.schema,
15
- },
16
- archetypes: {
17
- Position: ["position"],
18
- },
19
- transactions: {
20
- createPosition(store) {
21
- return store.archetypes.Position.insert({
22
- position: [1, 2, 3],
23
- });
24
- }
25
- }
26
- }), {
27
- update: { name: "update" },
28
- render: { name: "render" },
29
- }, (db) => ({
30
- update: () => {
31
- },
32
- render: () => {
33
- },
34
- }));
35
- expect(graphics.schema).toBeDefined();
36
- expect(graphics.systems).toBeDefined();
37
- expect(graphics.create).toBeDefined();
38
- expect(graphics.systems.render.name).toBe("render");
39
- expect(graphics.systems.update.name).toBe("update");
40
- });
41
- });
42
- //# sourceMappingURL=create.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create.test.js","sourceRoot":"","sources":["../../../../../src/ecs/system/world-schema/public/create.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,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CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC;QAEtC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACpD,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- export * from "./create.js";
@@ -1,2 +0,0 @@
1
- export * from "./create.js";
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ecs/system/world-schema/public/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAC"}
@@ -1,17 +0,0 @@
1
- import { FromSchemas } from "../../../schema/index.js";
2
- import { StringKeyof } from "../../../types/types.js";
3
- import { ArchetypeComponents, ComponentSchemas, Database, ResourceSchemas } from "../../index.js";
4
- import { ActionDeclarations, ToActionFunctions } from "../../store/action-functions.js";
5
- import { SystemDeclaration } from "../system-declaration.js";
6
- export * as SystemFactory from "./public/index.js";
7
- export type SystemDeclarations<S extends string> = {
8
- readonly [K in S]: SystemDeclaration<K>;
9
- };
10
- export type SystemFunctions<S extends string> = {
11
- readonly [K in S]: () => void;
12
- };
13
- export interface SystemFactory<C extends ComponentSchemas = never, R extends ResourceSchemas = never, A extends ArchetypeComponents<StringKeyof<C>> = never, T extends ActionDeclarations<FromSchemas<C>, FromSchemas<R>, A> = never, S extends string = never> {
14
- schema: Database.Schema<C, R, A, T>;
15
- systems: SystemDeclarations<S>;
16
- create(db: Database<FromSchemas<C>, FromSchemas<R>, A, ToActionFunctions<T>>): SystemFunctions<S>;
17
- }
@@ -1,23 +0,0 @@
1
- /*MIT License
2
-
3
- © Copyright 2025 Adobe. All rights reserved.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.*/
22
- export * as SystemFactory from "./public/index.js";
23
- //# sourceMappingURL=system-factory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"system-factory.js","sourceRoot":"","sources":["../../../../src/ecs/system/world-schema/system-factory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAQX,OAAO,KAAK,aAAa,MAAM,mBAAmB,CAAC"}
@@ -1,18 +0,0 @@
1
- type SystemDeclaration = {
2
- readonly create: (...args: any[]) => any;
3
- readonly schedule?: {
4
- readonly before?: readonly string[];
5
- readonly after?: readonly string[];
6
- };
7
- };
8
- /**
9
- * Calculates the execution order for systems based on their scheduling constraints.
10
- * Returns a 2D array where each sub-array represents a tier of systems that can
11
- * execute in parallel.
12
- *
13
- * @param systems - Object mapping system names to their declarations
14
- * @returns Array of tiers, where each tier is an array of system names that can run in parallel
15
- * @throws Error if circular dependencies are detected
16
- */
17
- export declare const calculateSystemOrder: <S extends string>(systems: { readonly [K in S]: SystemDeclaration; }) => S[][];
18
- export {};
@@ -1,113 +0,0 @@
1
- /*MIT License
2
-
3
- © Copyright 2025 Adobe. All rights reserved.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.*/
22
- /**
23
- * Calculates the execution order for systems based on their scheduling constraints.
24
- * Returns a 2D array where each sub-array represents a tier of systems that can
25
- * execute in parallel.
26
- *
27
- * @param systems - Object mapping system names to their declarations
28
- * @returns Array of tiers, where each tier is an array of system names that can run in parallel
29
- * @throws Error if circular dependencies are detected
30
- */
31
- export const calculateSystemOrder = (systems) => {
32
- const systemNames = Object.keys(systems);
33
- if (systemNames.length === 0) {
34
- return [];
35
- }
36
- // Build dependency graph: dependsOn[system] = set of systems that must run before it
37
- const dependsOn = new Map();
38
- for (const name of systemNames) {
39
- dependsOn.set(name, new Set());
40
- }
41
- // Process scheduling constraints
42
- for (const name of systemNames) {
43
- const system = systems[name];
44
- const schedule = system.schedule;
45
- if (schedule?.after) {
46
- for (const dep of schedule.after) {
47
- dependsOn.get(name).add(dep);
48
- }
49
- }
50
- if (schedule?.before) {
51
- for (const dependent of schedule.before) {
52
- dependsOn.get(dependent).add(name);
53
- }
54
- }
55
- }
56
- // Topological sort with tier grouping
57
- const tiers = [];
58
- const processed = new Set();
59
- const inProgress = new Set();
60
- const detectCycle = (node, visited, stack) => {
61
- if (stack.has(node)) {
62
- return true;
63
- }
64
- if (visited.has(node)) {
65
- return false;
66
- }
67
- visited.add(node);
68
- stack.add(node);
69
- const deps = dependsOn.get(node);
70
- for (const dep of deps) {
71
- if (detectCycle(dep, visited, stack)) {
72
- return true;
73
- }
74
- }
75
- stack.delete(node);
76
- return false;
77
- };
78
- // Check for cycles
79
- const visited = new Set();
80
- const stack = new Set();
81
- for (const name of systemNames) {
82
- if (detectCycle(name, visited, stack)) {
83
- throw new Error("Circular dependency detected in system scheduling");
84
- }
85
- }
86
- // Build tiers
87
- while (processed.size < systemNames.length) {
88
- const currentTier = [];
89
- for (const name of systemNames) {
90
- if (processed.has(name)) {
91
- continue;
92
- }
93
- // Check if all dependencies are processed
94
- const deps = dependsOn.get(name);
95
- const allDepsProcessed = Array.from(deps).every(dep => processed.has(dep));
96
- if (allDepsProcessed) {
97
- currentTier.push(name);
98
- }
99
- }
100
- if (currentTier.length === 0) {
101
- // Should never happen if cycle detection works
102
- throw new Error("Unable to resolve system dependencies");
103
- }
104
- // Sort tier alphabetically for deterministic output
105
- currentTier.sort();
106
- tiers.push(currentTier);
107
- for (const name of currentTier) {
108
- processed.add(name);
109
- }
110
- }
111
- return tiers;
112
- };
113
- //# sourceMappingURL=calculate-system-order.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"calculate-system-order.js","sourceRoot":"","sources":["../../../src/ecs/world/calculate-system-order.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAUX;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAChC,OAAiD,EAC5C,EAAE;IACP,MAAM,WAAW,GAAG,M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AAK,CAAC,GAAG,CAAC,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;YAE3E,IAAI,gBAAgB,EAAE,CAAC;gBACnB,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC3B,CAAC;QACL,CAAC;QAED,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC3B,+CAA+C;YAC/C,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;QAC7D,CAAC;QAED,oDAAoD;QACpD,WAAW,CAAC,IAAI,EAAE,CAAC;QACnB,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAExB,KAAK,MAAM,IAAI,IAAI,WAAW,EAAE,CAAC;YAC7B,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACxB,CAAC;IACL,CAAC;IAED,OAAO,KAAK,CAAC;AACjB,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,168 +0,0 @@
1
- /*MIT License
2
-
3
- © Copyright 2025 Adobe. All rights reserved.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.*/
22
- import { assert } from "riteway/vitest";
23
- import { describe, test, expect } from "vitest";
24
- import { calculateSystemOrder } from "./calculate-system-order.js";
25
- describe("calculateSystemOrder", () => {
26
- test("empty systems object", async () => {
27
- const systems = {};
28
- const actual = calculateSystemOrder(systems);
29
- const expected = [];
30
- await assert({
31
- given: "empty systems object",
32
- should: "return empty order array",
33
- actual,
34
- expected,
35
- });
36
- });
37
- test("single system with no constraints", async () => {
38
- const systems = {
39
- renderSystem: { create: () => () => { } },
40
- };
41
- const actual = calculateSystemOrder(systems);
42
- const expected = [["renderSystem"]];
43
- await assert({
44
- given: "single system with no constraints",
45
- should: "return single tier with that system",
46
- actual,
47
- expected,
48
- });
49
- });
50
- test("multiple systems with no constraints", async () => {
51
- const systems = {
52
- inputSystem: { create: () => () => { } },
53
- physicsSystem: { create: () => () => { } },
54
- renderSystem: { create: () => () => { } },
55
- };
56
- const actual = calculateSystemOrder(systems);
57
- const expected = [["inputSystem", "physicsSystem", "renderSystem"]];
58
- await assert({
59
- given: "multiple systems with no constraints",
60
- should: "return single tier with all systems in parallel",
61
- actual,
62
- expected,
63
- });
64
- });
65
- test("render system scheduled after physics", async () => {
66
- const systems = {
67
- physicsSystem: { create: () => () => { } },
68
- renderSystem: {
69
- create: () => () => { },
70
- schedule: { after: ["physicsSystem"] }
71
- },
72
- };
73
- const actual = calculateSystemOrder(systems);
74
- const expected = [["physicsSystem"], ["renderSystem"]];
75
- await assert({
76
- given: "render system scheduled after physics",
77
- should: "return physics in first tier, render in second",
78
- actual,
79
- expected,
80
- });
81
- });
82
- test("physics system scheduled before render", async () => {
83
- const systems = {
84
- physicsSystem: {
85
- create: () => () => { },
86
- schedule: { before: ["renderSystem"] }
87
- },
88
- renderSystem: { create: () => () => { } },
89
- };
90
- const actual = calculateSystemOrder(systems);
91
- const expected = [["physicsSystem"], ["renderSystem"]];
92
- await assert({
93
- given: "physics system scheduled before render",
94
- should: "return physics in first tier, render in second",
95
- actual,
96
- expected,
97
- });
98
- });
99
- test("complex dependency graph with parallel systems", async () => {
100
- const systems = {
101
- inputSystem: { create: () => () => { } },
102
- physicsSystem: {
103
- create: () => () => { },
104
- schedule: { after: ["inputSystem"] }
105
- },
106
- aiSystem: {
107
- create: () => () => { },
108
- schedule: { after: ["inputSystem"] }
109
- },
110
- renderSystem: {
111
- create: () => () => { },
112
- schedule: { after: ["physicsSystem", "aiSystem"] }
113
- },
114
- };
115
- const actual = calculateSystemOrder(systems);
116
- const expected = [
117
- ["inputSystem"],
118
- ["aiSystem", "physicsSystem"],
119
- ["renderSystem"]
120
- ];
121
- await assert({
122
- given: "complex dependency graph with parallel systems",
123
- should: "return correct multi-tier execution order with alphabetical sorting within tiers",
124
- actual,
125
- expected,
126
- });
127
- });
128
- test("greedy scheduling with mixed independent and dependent systems", async () => {
129
- const systems = {
130
- systemA: { create: () => () => { } }, // No dependencies
131
- systemB: {
132
- create: () => () => { },
133
- schedule: { after: ["systemA"] } // Depends on A
134
- },
135
- systemC: { create: () => () => { } }, // Independent! Should run in tier 0
136
- systemD: {
137
- create: () => () => { },
138
- schedule: { after: ["systemB"] } // Depends on B
139
- },
140
- };
141
- const actual = calculateSystemOrder(systems);
142
- const expected = [
143
- ["systemA", "systemC"], // Both independent, run together ASAP
144
- ["systemB"], // Runs after A
145
- ["systemD"] // Runs after B
146
- ];
147
- await assert({
148
- given: "mixed independent and dependent systems",
149
- should: "schedule independent systems in earliest tier (greedy scheduling)",
150
- actual,
151
- expected,
152
- });
153
- });
154
- test("circular dependency between systems", () => {
155
- const systems = {
156
- systemA: {
157
- create: () => () => { },
158
- schedule: { after: ["systemB"] }
159
- },
160
- systemB: {
161
- create: () => () => { },
162
- schedule: { after: ["systemA"] }
163
- },
164
- };
165
- expect(() => calculateSystemOrder(systems)).toThrow("Circular dependency detected in system scheduling");
166
- });
167
- });
168
- //# sourceMappingURL=calculate-system-order.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"calculate-system-order.test.js","sourceRoot":"","sources":["../../../src/ecs/world/calculate-system-order.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IAElC,IAAI,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACpC,MAAM,OAAO,GAAG,EAAE,CAAC;QACnB,MAAM,MAAM,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAC7C,MAAM,QAAQ,GAAe,EAAE,CAAC;QAChC,MAAM,MAAM,CAAC;YACT,KAAK,EAAE,sBAAsB;YAC7B,MAAM,EAAE,0BAA0B;YAClC,MAAM;YACN,QAAQ;SACX,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,mCAAmC,EAAE,KAAK,IAAI,EAAE;QACjD,MAAM,OAAO,GAAG;YACZ,YAAY,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE;SAC5C,CAAC;QACF,MAAM,MAAM,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAC7C,MAAM,QAAQ,GAAG,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC;QACpC,MAAM,MAAM,CAAC;YACT,KAAK,EAAE,mCAAmC;YAC1C,MAAM,EAAE,qCAAqC;YAC7C,MAAM;YACN,QAAQ;SACX,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,sCAAsC,EAAE,KAAK,IAAI,EAAE;QACpD,MAAM,OAAO,GAAG;YACZ,WAAW,E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