@ifc-lite/create 3.2.0 → 5.1.0

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 (426) hide show
  1. package/README.md +43 -0
  2. package/dist/in-store/align-boxes.d.ts +38 -0
  3. package/dist/in-store/align-boxes.d.ts.map +1 -0
  4. package/dist/in-store/align-boxes.js +97 -0
  5. package/dist/in-store/align-boxes.js.map +1 -0
  6. package/dist/in-store/anchor.d.ts.map +1 -1
  7. package/dist/in-store/anchor.js +13 -2
  8. package/dist/in-store/anchor.js.map +1 -1
  9. package/dist/in-store/auto-space-detect.d.ts +1 -1
  10. package/dist/in-store/auto-space-detect.js +1 -1
  11. package/dist/in-store/beam.d.ts +10 -1
  12. package/dist/in-store/beam.d.ts.map +1 -1
  13. package/dist/in-store/beam.js +17 -35
  14. package/dist/in-store/beam.js.map +1 -1
  15. package/dist/in-store/column.d.ts +10 -1
  16. package/dist/in-store/column.d.ts.map +1 -1
  17. package/dist/in-store/column.js +23 -22
  18. package/dist/in-store/column.js.map +1 -1
  19. package/dist/in-store/copy-array.d.ts +17 -0
  20. package/dist/in-store/copy-array.d.ts.map +1 -0
  21. package/dist/in-store/copy-array.js +47 -0
  22. package/dist/in-store/copy-array.js.map +1 -0
  23. package/dist/in-store/copy-batch.d.ts +27 -0
  24. package/dist/in-store/copy-batch.d.ts.map +1 -0
  25. package/dist/in-store/copy-batch.js +101 -0
  26. package/dist/in-store/copy-batch.js.map +1 -0
  27. package/dist/in-store/copy-dependent-walk.d.ts +27 -0
  28. package/dist/in-store/copy-dependent-walk.d.ts.map +1 -0
  29. package/dist/in-store/copy-dependent-walk.js +61 -0
  30. package/dist/in-store/copy-dependent-walk.js.map +1 -0
  31. package/dist/in-store/copy-frame.d.ts +53 -0
  32. package/dist/in-store/copy-frame.d.ts.map +1 -0
  33. package/dist/in-store/copy-frame.js +112 -0
  34. package/dist/in-store/copy-frame.js.map +1 -0
  35. package/dist/in-store/copy-product.d.ts +76 -0
  36. package/dist/in-store/copy-product.d.ts.map +1 -0
  37. package/dist/in-store/copy-product.js +318 -0
  38. package/dist/in-store/copy-product.js.map +1 -0
  39. package/dist/in-store/curtain-wall.d.ts +87 -0
  40. package/dist/in-store/curtain-wall.d.ts.map +1 -0
  41. package/dist/in-store/curtain-wall.js +237 -0
  42. package/dist/in-store/curtain-wall.js.map +1 -0
  43. package/dist/in-store/edit/effective-mutation-view.d.ts +6 -0
  44. package/dist/in-store/edit/effective-mutation-view.d.ts.map +1 -0
  45. package/dist/in-store/edit/effective-mutation-view.js +45 -0
  46. package/dist/in-store/edit/effective-mutation-view.js.map +1 -0
  47. package/dist/in-store/edit/effective-storey.d.ts +13 -0
  48. package/dist/in-store/edit/effective-storey.d.ts.map +1 -0
  49. package/dist/in-store/edit/effective-storey.js +36 -0
  50. package/dist/in-store/edit/effective-storey.js.map +1 -0
  51. package/dist/in-store/edit/effective-storeys.d.ts +9 -0
  52. package/dist/in-store/edit/effective-storeys.d.ts.map +1 -0
  53. package/dist/in-store/edit/effective-storeys.js +16 -0
  54. package/dist/in-store/edit/effective-storeys.js.map +1 -0
  55. package/dist/in-store/edit/hosted-opening-refit.d.ts +29 -0
  56. package/dist/in-store/edit/hosted-opening-refit.d.ts.map +1 -0
  57. package/dist/in-store/edit/hosted-opening-refit.js +168 -0
  58. package/dist/in-store/edit/hosted-opening-refit.js.map +1 -0
  59. package/dist/in-store/edit/length-unit-scale.d.ts +24 -0
  60. package/dist/in-store/edit/length-unit-scale.d.ts.map +1 -0
  61. package/dist/in-store/edit/length-unit-scale.js +37 -0
  62. package/dist/in-store/edit/length-unit-scale.js.map +1 -0
  63. package/dist/in-store/edit/linear-element-edit.d.ts +131 -0
  64. package/dist/in-store/edit/linear-element-edit.d.ts.map +1 -0
  65. package/dist/in-store/edit/linear-element-edit.js +259 -0
  66. package/dist/in-store/edit/linear-element-edit.js.map +1 -0
  67. package/dist/in-store/edit/metadata-clone-effective.d.ts +5 -0
  68. package/dist/in-store/edit/metadata-clone-effective.d.ts.map +1 -0
  69. package/dist/in-store/edit/metadata-clone-effective.js +47 -0
  70. package/dist/in-store/edit/metadata-clone-effective.js.map +1 -0
  71. package/dist/in-store/edit/metadata-clone.d.ts +40 -0
  72. package/dist/in-store/edit/metadata-clone.d.ts.map +1 -0
  73. package/dist/in-store/edit/metadata-clone.js +107 -0
  74. package/dist/in-store/edit/metadata-clone.js.map +1 -0
  75. package/dist/in-store/edit/placement-core.d.ts +140 -0
  76. package/dist/in-store/edit/placement-core.d.ts.map +1 -0
  77. package/dist/in-store/edit/placement-core.js +317 -0
  78. package/dist/in-store/edit/placement-core.js.map +1 -0
  79. package/dist/in-store/edit/polygon-clip.d.ts +58 -0
  80. package/dist/in-store/edit/polygon-clip.d.ts.map +1 -0
  81. package/dist/in-store/edit/polygon-clip.js +153 -0
  82. package/dist/in-store/edit/polygon-clip.js.map +1 -0
  83. package/dist/in-store/edit/read-profile.d.ts +6 -0
  84. package/dist/in-store/edit/read-profile.d.ts.map +1 -0
  85. package/dist/in-store/edit/read-profile.js +95 -0
  86. package/dist/in-store/edit/read-profile.js.map +1 -0
  87. package/dist/in-store/edit/slab-edit-frame.d.ts +40 -0
  88. package/dist/in-store/edit/slab-edit-frame.d.ts.map +1 -0
  89. package/dist/in-store/edit/slab-edit-frame.js +146 -0
  90. package/dist/in-store/edit/slab-edit-frame.js.map +1 -0
  91. package/dist/in-store/edit/slab-edit.d.ts +112 -0
  92. package/dist/in-store/edit/slab-edit.d.ts.map +1 -0
  93. package/dist/in-store/edit/slab-edit.js +275 -0
  94. package/dist/in-store/edit/slab-edit.js.map +1 -0
  95. package/dist/in-store/edit/slab-opening-carry.d.ts +10 -0
  96. package/dist/in-store/edit/slab-opening-carry.d.ts.map +1 -0
  97. package/dist/in-store/edit/slab-opening-carry.js +65 -0
  98. package/dist/in-store/edit/slab-opening-carry.js.map +1 -0
  99. package/dist/in-store/edit/split-guid.d.ts +29 -0
  100. package/dist/in-store/edit/split-guid.d.ts.map +1 -0
  101. package/dist/in-store/edit/split-guid.js +64 -0
  102. package/dist/in-store/edit/split-guid.js.map +1 -0
  103. package/dist/in-store/edit/split-target.d.ts +90 -0
  104. package/dist/in-store/edit/split-target.d.ts.map +1 -0
  105. package/dist/in-store/edit/split-target.js +116 -0
  106. package/dist/in-store/edit/split-target.js.map +1 -0
  107. package/dist/in-store/edit/target.d.ts +8 -0
  108. package/dist/in-store/edit/target.d.ts.map +1 -0
  109. package/dist/in-store/edit/target.js +5 -0
  110. package/dist/in-store/edit/target.js.map +1 -0
  111. package/dist/in-store/edit/trim-extend-geometry.d.ts +99 -0
  112. package/dist/in-store/edit/trim-extend-geometry.d.ts.map +1 -0
  113. package/dist/in-store/edit/trim-extend-geometry.js +105 -0
  114. package/dist/in-store/edit/trim-extend-geometry.js.map +1 -0
  115. package/dist/in-store/edit/wall-axis-edit.d.ts +16 -0
  116. package/dist/in-store/edit/wall-axis-edit.d.ts.map +1 -0
  117. package/dist/in-store/edit/wall-axis-edit.js +40 -0
  118. package/dist/in-store/edit/wall-axis-edit.js.map +1 -0
  119. package/dist/in-store/edit/wall-edit.d.ts +157 -0
  120. package/dist/in-store/edit/wall-edit.d.ts.map +1 -0
  121. package/dist/in-store/edit/wall-edit.js +276 -0
  122. package/dist/in-store/edit/wall-edit.js.map +1 -0
  123. package/dist/in-store/edit/wall-hosted-cuts.d.ts +35 -0
  124. package/dist/in-store/edit/wall-hosted-cuts.d.ts.map +1 -0
  125. package/dist/in-store/edit/wall-hosted-cuts.js +27 -0
  126. package/dist/in-store/edit/wall-hosted-cuts.js.map +1 -0
  127. package/dist/in-store/edit/wall-opening-reassign.d.ts +18 -0
  128. package/dist/in-store/edit/wall-opening-reassign.d.ts.map +1 -0
  129. package/dist/in-store/edit/wall-opening-reassign.js +50 -0
  130. package/dist/in-store/edit/wall-opening-reassign.js.map +1 -0
  131. package/dist/in-store/element-align.d.ts +13 -0
  132. package/dist/in-store/element-align.d.ts.map +1 -0
  133. package/dist/in-store/element-align.js +90 -0
  134. package/dist/in-store/element-align.js.map +1 -0
  135. package/dist/in-store/element-replacement.d.ts +26 -0
  136. package/dist/in-store/element-replacement.d.ts.map +1 -0
  137. package/dist/in-store/element-replacement.js +68 -0
  138. package/dist/in-store/element-replacement.js.map +1 -0
  139. package/dist/in-store/element-size-edit.d.ts +40 -0
  140. package/dist/in-store/element-size-edit.d.ts.map +1 -0
  141. package/dist/in-store/element-size-edit.js +103 -0
  142. package/dist/in-store/element-size-edit.js.map +1 -0
  143. package/dist/in-store/element-split-axis.d.ts +6 -0
  144. package/dist/in-store/element-split-axis.d.ts.map +1 -0
  145. package/dist/in-store/element-split-axis.js +87 -0
  146. package/dist/in-store/element-split-axis.js.map +1 -0
  147. package/dist/in-store/element-split-joined.d.ts +13 -0
  148. package/dist/in-store/element-split-joined.d.ts.map +1 -0
  149. package/dist/in-store/element-split-joined.js +74 -0
  150. package/dist/in-store/element-split-joined.js.map +1 -0
  151. package/dist/in-store/element-split-placement.d.ts +19 -0
  152. package/dist/in-store/element-split-placement.d.ts.map +1 -0
  153. package/dist/in-store/element-split-placement.js +48 -0
  154. package/dist/in-store/element-split-placement.js.map +1 -0
  155. package/dist/in-store/element-split-slab.d.ts +19 -0
  156. package/dist/in-store/element-split-slab.d.ts.map +1 -0
  157. package/dist/in-store/element-split-slab.js +86 -0
  158. package/dist/in-store/element-split-slab.js.map +1 -0
  159. package/dist/in-store/element-split.d.ts +49 -0
  160. package/dist/in-store/element-split.d.ts.map +1 -0
  161. package/dist/in-store/element-split.js +52 -0
  162. package/dist/in-store/element-split.js.map +1 -0
  163. package/dist/in-store/element-transform-edit.d.ts +33 -0
  164. package/dist/in-store/element-transform-edit.d.ts.map +1 -0
  165. package/dist/in-store/element-transform-edit.js +97 -0
  166. package/dist/in-store/element-transform-edit.js.map +1 -0
  167. package/dist/in-store/element-transform-frames.d.ts +58 -0
  168. package/dist/in-store/element-transform-frames.d.ts.map +1 -0
  169. package/dist/in-store/element-transform-frames.js +110 -0
  170. package/dist/in-store/element-transform-frames.js.map +1 -0
  171. package/dist/in-store/element-transform-joins.d.ts +4 -0
  172. package/dist/in-store/element-transform-joins.d.ts.map +1 -0
  173. package/dist/in-store/element-transform-joins.js +62 -0
  174. package/dist/in-store/element-transform-joins.js.map +1 -0
  175. package/dist/in-store/element-transform-plan.d.ts +38 -0
  176. package/dist/in-store/element-transform-plan.d.ts.map +1 -0
  177. package/dist/in-store/element-transform-plan.js +115 -0
  178. package/dist/in-store/element-transform-plan.js.map +1 -0
  179. package/dist/in-store/element-trim-extend.d.ts +25 -0
  180. package/dist/in-store/element-trim-extend.d.ts.map +1 -0
  181. package/dist/in-store/element-trim-extend.js +97 -0
  182. package/dist/in-store/element-trim-extend.js.map +1 -0
  183. package/dist/in-store/extract-grids.d.ts +36 -0
  184. package/dist/in-store/extract-grids.d.ts.map +1 -0
  185. package/dist/in-store/extract-grids.js +220 -0
  186. package/dist/in-store/extract-grids.js.map +1 -0
  187. package/dist/in-store/extract-walls.d.ts +12 -23
  188. package/dist/in-store/extract-walls.d.ts.map +1 -1
  189. package/dist/in-store/extract-walls.js +6 -69
  190. package/dist/in-store/extract-walls.js.map +1 -1
  191. package/dist/in-store/generate-spaces.d.ts +1 -1
  192. package/dist/in-store/grid-column.d.ts +23 -0
  193. package/dist/in-store/grid-column.d.ts.map +1 -0
  194. package/dist/in-store/grid-column.js +73 -0
  195. package/dist/in-store/grid-column.js.map +1 -0
  196. package/dist/in-store/grid-intersection-read.d.ts +10 -0
  197. package/dist/in-store/grid-intersection-read.d.ts.map +1 -0
  198. package/dist/in-store/grid-intersection-read.js +45 -0
  199. package/dist/in-store/grid-intersection-read.js.map +1 -0
  200. package/dist/in-store/grid.d.ts +124 -0
  201. package/dist/in-store/grid.d.ts.map +1 -0
  202. package/dist/in-store/grid.js +204 -0
  203. package/dist/in-store/grid.js.map +1 -0
  204. package/dist/in-store/group-evidence.d.ts +49 -0
  205. package/dist/in-store/group-evidence.d.ts.map +1 -0
  206. package/dist/in-store/group-evidence.js +111 -0
  207. package/dist/in-store/group-evidence.js.map +1 -0
  208. package/dist/in-store/group-graph.d.ts +51 -0
  209. package/dist/in-store/group-graph.d.ts.map +1 -0
  210. package/dist/in-store/group-graph.js +213 -0
  211. package/dist/in-store/group-graph.js.map +1 -0
  212. package/dist/in-store/group.d.ts +34 -0
  213. package/dist/in-store/group.d.ts.map +1 -0
  214. package/dist/in-store/group.js +181 -0
  215. package/dist/in-store/group.js.map +1 -0
  216. package/dist/in-store/host-geometry-frame.d.ts +48 -0
  217. package/dist/in-store/host-geometry-frame.d.ts.map +1 -0
  218. package/dist/in-store/host-geometry-frame.js +190 -0
  219. package/dist/in-store/host-geometry-frame.js.map +1 -0
  220. package/dist/in-store/hosted-element-edit.d.ts +29 -0
  221. package/dist/in-store/hosted-element-edit.d.ts.map +1 -0
  222. package/dist/in-store/hosted-element-edit.js +120 -0
  223. package/dist/in-store/hosted-element-edit.js.map +1 -0
  224. package/dist/in-store/hosted-element.d.ts +41 -0
  225. package/dist/in-store/hosted-element.d.ts.map +1 -0
  226. package/dist/in-store/hosted-element.js +124 -0
  227. package/dist/in-store/hosted-element.js.map +1 -0
  228. package/dist/in-store/hosted-fill-read.d.ts +56 -0
  229. package/dist/in-store/hosted-fill-read.d.ts.map +1 -0
  230. package/dist/in-store/hosted-fill-read.js +197 -0
  231. package/dist/in-store/hosted-fill-read.js.map +1 -0
  232. package/dist/in-store/hosted-global-id.d.ts +8 -0
  233. package/dist/in-store/hosted-global-id.d.ts.map +1 -0
  234. package/dist/in-store/hosted-global-id.js +53 -0
  235. package/dist/in-store/hosted-global-id.js.map +1 -0
  236. package/dist/in-store/hosted-placement-edit.d.ts +30 -0
  237. package/dist/in-store/hosted-placement-edit.d.ts.map +1 -0
  238. package/dist/in-store/hosted-placement-edit.js +123 -0
  239. package/dist/in-store/hosted-placement-edit.js.map +1 -0
  240. package/dist/in-store/hosted-scale-chain.d.ts +12 -0
  241. package/dist/in-store/hosted-scale-chain.d.ts.map +1 -0
  242. package/dist/in-store/hosted-scale-chain.js +74 -0
  243. package/dist/in-store/hosted-scale-chain.js.map +1 -0
  244. package/dist/in-store/hosted-shape-edit.d.ts +9 -0
  245. package/dist/in-store/hosted-shape-edit.d.ts.map +1 -0
  246. package/dist/in-store/hosted-shape-edit.js +79 -0
  247. package/dist/in-store/hosted-shape-edit.js.map +1 -0
  248. package/dist/in-store/index.d.ts +66 -0
  249. package/dist/in-store/index.d.ts.map +1 -0
  250. package/dist/in-store/index.js +71 -0
  251. package/dist/in-store/index.js.map +1 -0
  252. package/dist/in-store/linear-profile-frame.d.ts +10 -0
  253. package/dist/in-store/linear-profile-frame.d.ts.map +1 -0
  254. package/dist/in-store/linear-profile-frame.js +17 -0
  255. package/dist/in-store/linear-profile-frame.js.map +1 -0
  256. package/dist/in-store/material.d.ts.map +1 -1
  257. package/dist/in-store/material.js +17 -6
  258. package/dist/in-store/material.js.map +1 -1
  259. package/dist/in-store/member.d.ts +8 -2
  260. package/dist/in-store/member.d.ts.map +1 -1
  261. package/dist/in-store/member.js +15 -21
  262. package/dist/in-store/member.js.map +1 -1
  263. package/dist/in-store/ordinary-element.d.ts +47 -0
  264. package/dist/in-store/ordinary-element.d.ts.map +1 -0
  265. package/dist/in-store/ordinary-element.js +38 -0
  266. package/dist/in-store/ordinary-element.js.map +1 -0
  267. package/dist/in-store/placement-frame.d.ts +15 -5
  268. package/dist/in-store/placement-frame.d.ts.map +1 -1
  269. package/dist/in-store/placement-frame.js +25 -36
  270. package/dist/in-store/placement-frame.js.map +1 -1
  271. package/dist/in-store/profile.d.ts +141 -0
  272. package/dist/in-store/profile.d.ts.map +1 -0
  273. package/dist/in-store/profile.js +174 -0
  274. package/dist/in-store/profile.js.map +1 -0
  275. package/dist/in-store/railing.d.ts +65 -0
  276. package/dist/in-store/railing.d.ts.map +1 -0
  277. package/dist/in-store/railing.js +112 -0
  278. package/dist/in-store/railing.js.map +1 -0
  279. package/dist/in-store/rel-connects-path.d.ts +43 -0
  280. package/dist/in-store/rel-connects-path.d.ts.map +1 -0
  281. package/dist/in-store/rel-connects-path.js +65 -0
  282. package/dist/in-store/rel-connects-path.js.map +1 -0
  283. package/dist/in-store/resolve-anchor.d.ts +3 -2
  284. package/dist/in-store/resolve-anchor.d.ts.map +1 -1
  285. package/dist/in-store/resolve-anchor.js +7 -5
  286. package/dist/in-store/resolve-anchor.js.map +1 -1
  287. package/dist/in-store/resolve-host.d.ts +12 -1
  288. package/dist/in-store/resolve-host.d.ts.map +1 -1
  289. package/dist/in-store/resolve-host.js +169 -85
  290. package/dist/in-store/resolve-host.js.map +1 -1
  291. package/dist/in-store/resolve-relations.d.ts +3 -1
  292. package/dist/in-store/resolve-relations.d.ts.map +1 -1
  293. package/dist/in-store/resolve-relations.js +8 -3
  294. package/dist/in-store/resolve-relations.js.map +1 -1
  295. package/dist/in-store/resolve-source.d.ts.map +1 -1
  296. package/dist/in-store/resolve-source.js +39 -59
  297. package/dist/in-store/resolve-source.js.map +1 -1
  298. package/dist/in-store/room-candidates.d.ts +58 -0
  299. package/dist/in-store/room-candidates.d.ts.map +1 -0
  300. package/dist/in-store/room-candidates.js +135 -0
  301. package/dist/in-store/room-candidates.js.map +1 -0
  302. package/dist/in-store/room-creation-plan.d.ts +16 -0
  303. package/dist/in-store/room-creation-plan.d.ts.map +1 -0
  304. package/dist/in-store/room-creation-plan.js +28 -0
  305. package/dist/in-store/room-creation-plan.js.map +1 -0
  306. package/dist/in-store/room-floor-height.d.ts +24 -0
  307. package/dist/in-store/room-floor-height.d.ts.map +1 -0
  308. package/dist/in-store/room-floor-height.js +32 -0
  309. package/dist/in-store/room-floor-height.js.map +1 -0
  310. package/dist/in-store/room-footprint-native.d.ts +19 -0
  311. package/dist/in-store/room-footprint-native.d.ts.map +1 -0
  312. package/dist/in-store/room-footprint-native.js +117 -0
  313. package/dist/in-store/room-footprint-native.js.map +1 -0
  314. package/dist/in-store/room-layout-cache.d.ts +23 -0
  315. package/dist/in-store/room-layout-cache.d.ts.map +1 -0
  316. package/dist/in-store/room-layout-cache.js +84 -0
  317. package/dist/in-store/room-layout-cache.js.map +1 -0
  318. package/dist/in-store/room-layout-core.d.ts +68 -0
  319. package/dist/in-store/room-layout-core.d.ts.map +1 -0
  320. package/dist/in-store/room-layout-core.js +153 -0
  321. package/dist/in-store/room-layout-core.js.map +1 -0
  322. package/dist/in-store/room-population.d.ts +5 -0
  323. package/dist/in-store/room-population.d.ts.map +1 -0
  324. package/dist/in-store/room-population.js +28 -0
  325. package/dist/in-store/room-population.js.map +1 -0
  326. package/dist/in-store/room-space-meshes.d.ts +15 -0
  327. package/dist/in-store/room-space-meshes.d.ts.map +1 -0
  328. package/dist/in-store/room-space-meshes.js +38 -0
  329. package/dist/in-store/room-space-meshes.js.map +1 -0
  330. package/dist/in-store/room-store.d.ts +55 -0
  331. package/dist/in-store/room-store.d.ts.map +1 -0
  332. package/dist/in-store/room-store.js +173 -0
  333. package/dist/in-store/room-store.js.map +1 -0
  334. package/dist/in-store/room-storey-elevation.d.ts +5 -0
  335. package/dist/in-store/room-storey-elevation.d.ts.map +1 -0
  336. package/dist/in-store/room-storey-elevation.js +42 -0
  337. package/dist/in-store/room-storey-elevation.js.map +1 -0
  338. package/dist/in-store/room-storey-frame.d.ts +47 -0
  339. package/dist/in-store/room-storey-frame.d.ts.map +1 -0
  340. package/dist/in-store/room-storey-frame.js +48 -0
  341. package/dist/in-store/room-storey-frame.js.map +1 -0
  342. package/dist/in-store/room-wall-rects.d.ts +117 -0
  343. package/dist/in-store/room-wall-rects.d.ts.map +1 -0
  344. package/dist/in-store/room-wall-rects.js +157 -0
  345. package/dist/in-store/room-wall-rects.js.map +1 -0
  346. package/dist/in-store/schema-attributes.d.ts +8 -3
  347. package/dist/in-store/schema-attributes.d.ts.map +1 -1
  348. package/dist/in-store/schema-attributes.js +18 -9
  349. package/dist/in-store/schema-attributes.js.map +1 -1
  350. package/dist/in-store/slab.d.ts.map +1 -1
  351. package/dist/in-store/slab.js +1 -4
  352. package/dist/in-store/slab.js.map +1 -1
  353. package/dist/in-store/space-footprints.d.ts +55 -0
  354. package/dist/in-store/space-footprints.d.ts.map +1 -0
  355. package/dist/in-store/space-footprints.js +260 -0
  356. package/dist/in-store/space-footprints.js.map +1 -0
  357. package/dist/in-store/space.d.ts.map +1 -1
  358. package/dist/in-store/space.js +15 -3
  359. package/dist/in-store/space.js.map +1 -1
  360. package/dist/in-store/spatial-children.d.ts +1 -1
  361. package/dist/in-store/spatial-children.js +1 -1
  362. package/dist/in-store/stair-edit.d.ts +24 -0
  363. package/dist/in-store/stair-edit.d.ts.map +1 -0
  364. package/dist/in-store/stair-edit.js +190 -0
  365. package/dist/in-store/stair-edit.js.map +1 -0
  366. package/dist/in-store/stair-removal.d.ts +17 -0
  367. package/dist/in-store/stair-removal.d.ts.map +1 -0
  368. package/dist/in-store/stair-removal.js +134 -0
  369. package/dist/in-store/stair-removal.js.map +1 -0
  370. package/dist/in-store/stair.d.ts +58 -0
  371. package/dist/in-store/stair.d.ts.map +1 -0
  372. package/dist/in-store/stair.js +156 -0
  373. package/dist/in-store/stair.js.map +1 -0
  374. package/dist/in-store/storey-plan-frame.d.ts +2 -1
  375. package/dist/in-store/storey-plan-frame.d.ts.map +1 -1
  376. package/dist/in-store/storey-plan-frame.js +20 -11
  377. package/dist/in-store/storey-plan-frame.js.map +1 -1
  378. package/dist/in-store/storey-reassignment-plan.d.ts +53 -0
  379. package/dist/in-store/storey-reassignment-plan.d.ts.map +1 -0
  380. package/dist/in-store/storey-reassignment-plan.js +237 -0
  381. package/dist/in-store/storey-reassignment-plan.js.map +1 -0
  382. package/dist/in-store/storey-reassignment.d.ts +8 -0
  383. package/dist/in-store/storey-reassignment.d.ts.map +1 -0
  384. package/dist/in-store/storey-reassignment.js +52 -0
  385. package/dist/in-store/storey-reassignment.js.map +1 -0
  386. package/dist/in-store/trim-extend-plan.d.ts +27 -0
  387. package/dist/in-store/trim-extend-plan.d.ts.map +1 -0
  388. package/dist/in-store/trim-extend-plan.js +49 -0
  389. package/dist/in-store/trim-extend-plan.js.map +1 -0
  390. package/dist/in-store/wall-join-apply.d.ts +74 -0
  391. package/dist/in-store/wall-join-apply.d.ts.map +1 -0
  392. package/dist/in-store/wall-join-apply.js +137 -0
  393. package/dist/in-store/wall-join-apply.js.map +1 -0
  394. package/dist/in-store/wall-join-edit.d.ts +53 -0
  395. package/dist/in-store/wall-join-edit.d.ts.map +1 -0
  396. package/dist/in-store/wall-join-edit.js +251 -0
  397. package/dist/in-store/wall-join-edit.js.map +1 -0
  398. package/dist/in-store/wall-join-read.d.ts +60 -0
  399. package/dist/in-store/wall-join-read.d.ts.map +1 -0
  400. package/dist/in-store/wall-join-read.js +230 -0
  401. package/dist/in-store/wall-join-read.js.map +1 -0
  402. package/dist/in-store/wall-join.d.ts +122 -0
  403. package/dist/in-store/wall-join.d.ts.map +1 -0
  404. package/dist/in-store/wall-join.js +231 -0
  405. package/dist/in-store/wall-join.js.map +1 -0
  406. package/dist/in-store/wall-opening-fit.d.ts +11 -0
  407. package/dist/in-store/wall-opening-fit.d.ts.map +1 -0
  408. package/dist/in-store/wall-opening-fit.js +27 -0
  409. package/dist/in-store/wall-opening-fit.js.map +1 -0
  410. package/dist/in-store/wall-section-edit.d.ts +16 -0
  411. package/dist/in-store/wall-section-edit.d.ts.map +1 -0
  412. package/dist/in-store/wall-section-edit.js +75 -0
  413. package/dist/in-store/wall-section-edit.js.map +1 -0
  414. package/dist/in-store/wall-size-edit.d.ts +29 -0
  415. package/dist/in-store/wall-size-edit.d.ts.map +1 -0
  416. package/dist/in-store/wall-size-edit.js +65 -0
  417. package/dist/in-store/wall-size-edit.js.map +1 -0
  418. package/dist/in-store/wall.d.ts +32 -0
  419. package/dist/in-store/wall.d.ts.map +1 -1
  420. package/dist/in-store/wall.js +77 -13
  421. package/dist/in-store/wall.js.map +1 -1
  422. package/dist/index.d.ts +25 -38
  423. package/dist/index.d.ts.map +1 -1
  424. package/dist/index.js +25 -40
  425. package/dist/index.js.map +1 -1
  426. package/package.json +9 -8
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hosted-fill-read.d.ts","sourceRoot":"","sources":["../../src/in-store/hosted-fill-read.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAa/D,MAAM,WAAW,aAAa;IAC5B,sGAAsG;IACtG,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,4DAA4D;IAC5D,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACzB;AAQD;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,YAAY,EACnB,aAAa,EAAE,MAAM,EACrB,eAAe,EAAE,MAAM,EACvB,IAAI,CAAC,EAAE,mBAAmB,GAAG,IAAI,GAChC,aAAa,GAAG,IAAI,CAatB;AA6CD,MAAM,WAAW,cAAc;IAC7B,4EAA4E;IAC5E,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,4FAA4F;IAC5F,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,0FAA0F;IAC1F,eAAe,EAAE,MAAM,CAAC;IACxB,6CAA6C;IAC7C,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,4GAA4G;IAC5G,MAAM,EAAE,MAAM,CAAC;IACf,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAC;CACd;AAUD;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,MAAM,EACjB,IAAI,CAAC,EAAE,mBAAmB,GAAG,IAAI,GAChC,cAAc,GAAG,IAAI,CAyBvB;AAED;;oEAEoE;AACpE,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,mBAAmB,GAAG,IAAI,GACtF,WAAW,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC,CAoB5C"}
@@ -0,0 +1,197 @@
1
+ /* This Source Code Form is subject to the terms of the Mozilla Public
2
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
+ /**
5
+ * Live reads for wall-hosted openings, doors and windows (#6232): the host
6
+ * wall's frame on its storey, and where an opening sits in its host.
7
+ *
8
+ * `addOpeningToStore` places the opening relative to the host's
9
+ * IfcLocalPlacement with its Location at `[Offset, …, Sill]` in the host's
10
+ * frame, and `addHostedDoorToStore` / `addHostedWindowToStore` place the
11
+ * filling relative to the opening. So a placing gesture needs the host's
12
+ * frame to turn a cursor into `Offset`, and an edit of Offset or Sill is one
13
+ * write to the opening's Location point: the filling follows it.
14
+ *
15
+ * Every read goes through the mutation overlay, so a wall or opening authored
16
+ * this session reads like one from the file, and a deleted one is gone.
17
+ */
18
+ import { EntityExtractor } from '@ifc-lite/parser';
19
+ import { fromNativeLength } from './anchor.js';
20
+ import { safeLengthUnitScale } from './length-unit-scale.js';
21
+ import { frameInStoreyFrame, numericAttr, readEntity, readVec3, storeyPlacementChain, } from './placement-frame.js';
22
+ import { AnchorEntityReader } from './resolve-anchor.js';
23
+ function lengthScale(store, context) {
24
+ return store.source && store.source.byteLength > 0
25
+ ? safeLengthUnitScale(store.source, store.entityIndex, context) ?? 1
26
+ : 1;
27
+ }
28
+ /**
29
+ * The host's placement frame on storey `storeyExpressId`, composed through
30
+ * every `PlacementRelTo` hop the same way the storey's wall axes are
31
+ * (`extractWallSegmentsForStorey`), so a point read against one lines up
32
+ * with the other. Null when the host has no readable placement.
33
+ */
34
+ export function hostPlanFrame(store, hostExpressId, storeyExpressId, view) {
35
+ if (!store.source || store.source.byteLength === 0)
36
+ return null;
37
+ const extractor = new EntityExtractor(store.source);
38
+ const overlay = view ?? undefined;
39
+ const host = readEntity(store, extractor, overlay, hostExpressId);
40
+ const placementId = host ? numericAttr(host.attributes[5]) : null;
41
+ if (placementId === null)
42
+ return null;
43
+ const chain = storeyPlacementChain(store, extractor, overlay, storeyExpressId);
44
+ const frame = frameInStoreyFrame(store, extractor, overlay, placementId, chain);
45
+ if (!frame)
46
+ return null;
47
+ const z = heightAboveStorey(store, extractor, overlay, placementId, chain);
48
+ const k = lengthScale(store, 'hostPlanFrame');
49
+ return { origin: [frame.origin[0] * k, frame.origin[1] * k, z * k], axisX: [frame.axisX[0], frame.axisX[1]] };
50
+ }
51
+ /** One placement's own Location z (in its parent's frame), 0 when unreadable. */
52
+ function ownZ(store, extractor, overlay, placementId) {
53
+ const placement = readEntity(store, extractor, overlay, placementId);
54
+ const axisId = placement ? numericAttr(placement.attributes[1]) : null;
55
+ const axis = axisId === null ? null : readEntity(store, extractor, overlay, axisId);
56
+ const pointId = axis ? numericAttr(axis.attributes[0]) : null;
57
+ const point = pointId === null ? null : readEntity(store, extractor, overlay, pointId);
58
+ return (point && readVec3(point.attributes[0])?.[2]) ?? 0;
59
+ }
60
+ /**
61
+ * Native-unit height of `placementId` above the storey's placement: the z of
62
+ * every hop up to where the walk meets the storey's own chain, minus the
63
+ * storey's hops above that point. Upright placements only (a wall's), like
64
+ * the planar frames it goes with.
65
+ */
66
+ function heightAboveStorey(store, extractor, overlay, placementId, chain) {
67
+ let z = 0;
68
+ const seen = new Set();
69
+ let id = placementId;
70
+ while (id !== null && !seen.has(id) && !chain?.has(id)) {
71
+ seen.add(id);
72
+ z += ownZ(store, extractor, overlay, id);
73
+ const placement = readEntity(store, extractor, overlay, id);
74
+ id = placement ? numericAttr(placement.attributes[0]) : null;
75
+ }
76
+ if (!chain)
77
+ return z;
78
+ // Joined the storey's chain `hops` above its own placement (or ran out at the root).
79
+ const hops = id !== null && chain.has(id) ? chain.get(id) : id === null ? chain.size : 0;
80
+ let walked = 0;
81
+ for (const storeyHop of chain.keys()) {
82
+ if (walked++ >= hops)
83
+ break;
84
+ z -= ownZ(store, extractor, overlay, storeyHop);
85
+ }
86
+ return z;
87
+ }
88
+ function refId(value) {
89
+ if (typeof value === 'number' && Number.isInteger(value) && value > 0)
90
+ return value;
91
+ if (typeof value === 'string' && /^#[1-9][0-9]*$/.test(value))
92
+ return Number(value.slice(1));
93
+ return null;
94
+ }
95
+ const OPENING_TYPES = new Set(['IFCOPENINGELEMENT', 'IFCOPENINGSTANDARDCASE']);
96
+ /**
97
+ * Where an opening, or the door or window filling one, sits in its host.
98
+ * Null when `expressId` is neither, when it has no live host, or when the
99
+ * opening is not placed relative to its host (an absolutely placed opening
100
+ * has no offset along the wall to edit).
101
+ */
102
+ export function readHostedFill(store, expressId, view) {
103
+ const reader = new AnchorEntityReader(store, view);
104
+ const self = reader.entity(expressId);
105
+ if (!self)
106
+ return null;
107
+ // IfcRelFillsElement: RelatingOpeningElement(4), RelatedBuildingElement(5).
108
+ let openingId = OPENING_TYPES.has(self.type.toUpperCase()) ? expressId : null;
109
+ let fillingId = null;
110
+ for (const relId of reader.ids('IFCRELFILLSELEMENT')) {
111
+ const rel = reader.entity(relId);
112
+ if (!rel)
113
+ continue;
114
+ const opening = refId(rel.attributes[4]);
115
+ const filling = refId(rel.attributes[5]);
116
+ if (openingId === null && filling === expressId) {
117
+ openingId = opening;
118
+ fillingId = expressId;
119
+ break;
120
+ }
121
+ if (openingId !== null && opening === openingId && filling !== null && reader.entity(filling)) {
122
+ fillingId = filling;
123
+ break;
124
+ }
125
+ }
126
+ if (openingId === null)
127
+ return null;
128
+ // IfcRelVoidsElement: RelatingBuildingElement(4), RelatedOpeningElement(5).
129
+ let hostId = null;
130
+ for (const relId of reader.ids('IFCRELVOIDSELEMENT')) {
131
+ const rel = reader.entity(relId);
132
+ if (rel && refId(rel.attributes[5]) === openingId) {
133
+ hostId = refId(rel.attributes[4]);
134
+ break;
135
+ }
136
+ }
137
+ return readOpeningInHost(reader, lengthScale(store, 'readHostedFill'), openingId, hostId, fillingId);
138
+ }
139
+ /** Package-private batch reader: one relation walk for any number of cuts.
140
+ * Reuses the single-read placement contract; source relations are indexed
141
+ * before the atomic writer starts moving any occurrence (#6232). */
142
+ export function readHostedOpeningBatch(store, openingIds, view) {
143
+ const result = new Map();
144
+ if (openingIds.size === 0)
145
+ return result;
146
+ const reader = new AnchorEntityReader(store, view), hosts = new Map(), fills = new Map();
147
+ for (const id of reader.ids('IFCRELVOIDSELEMENT')) {
148
+ const rel = reader.entity(id), openingId = rel ? refId(rel.attributes[5]) : null;
149
+ if (openingId !== null && openingIds.has(openingId) && !hosts.has(openingId))
150
+ hosts.set(openingId, refId(rel.attributes[4]));
151
+ }
152
+ for (const id of reader.ids('IFCRELFILLSELEMENT')) {
153
+ const rel = reader.entity(id), openingId = rel ? refId(rel.attributes[4]) : null;
154
+ const fillingId = rel ? refId(rel.attributes[5]) : null;
155
+ if (openingId !== null && openingIds.has(openingId) && !fills.has(openingId) && fillingId !== null && reader.entity(fillingId))
156
+ fills.set(openingId, fillingId);
157
+ }
158
+ const scale = lengthScale(store, 'readHostedFill');
159
+ for (const openingId of openingIds) {
160
+ const type = reader.entity(openingId)?.type.toUpperCase();
161
+ result.set(openingId, type && OPENING_TYPES.has(type)
162
+ ? readOpeningInHost(reader, scale, openingId, hosts.get(openingId) ?? null, fills.get(openingId) ?? null) : null);
163
+ }
164
+ return result;
165
+ }
166
+ function readOpeningInHost(reader, scale, openingId, hostId, fillingId) {
167
+ const host = hostId === null ? null : reader.entity(hostId);
168
+ const opening = reader.entity(openingId);
169
+ if (hostId === null || !host || !opening)
170
+ return null;
171
+ const hostPlacement = refId(host.attributes[5]);
172
+ const placementId = refId(opening.attributes[5]);
173
+ const placement = placementId === null ? null : reader.entity(placementId);
174
+ if (!placement || hostPlacement === null || refId(placement.attributes[0]) !== hostPlacement)
175
+ return null;
176
+ const axisId = refId(placement.attributes[1]);
177
+ const axis = axisId === null ? null : reader.entity(axisId);
178
+ const locationPointId = axis ? refId(axis.attributes[0]) : null;
179
+ const point = locationPointId === null ? null : reader.entity(locationPointId);
180
+ const coords = point?.attributes[0];
181
+ if (locationPointId === null || !Array.isArray(coords))
182
+ return null;
183
+ const location = [0, 1, 2].map((i) => (typeof coords[i] === 'number' ? coords[i] : 0));
184
+ if (!location.every(Number.isFinite))
185
+ return null;
186
+ const unit = { lengthUnitScale: scale };
187
+ return {
188
+ hostId,
189
+ openingId,
190
+ fillingId,
191
+ locationPointId,
192
+ location,
193
+ offset: fromNativeLength(unit, location[0]),
194
+ sill: fromNativeLength(unit, location[2]),
195
+ };
196
+ }
197
+ //# sourceMappingURL=hosted-fill-read.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hosted-fill-read.js","sourceRoot":"","sources":["../../src/in-store/hosted-fill-read.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,eAAe,EAAqB,MAAM,kBAAkB,CAAC;AAEtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,UAAU,EACV,QAAQ,EACR,oBAAoB,GAErB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AASzD,SAAS,WAAW,CAAC,KAAmB,EAAE,OAAe;IACvD,OAAO,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,UAAU,GAAG,CAAC;QAChD,CAAC,CAAC,mBAAmB,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC;QACpE,CAAC,CAAC,CAAC,CAAC;AACR,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAC3B,KAAmB,EACnB,aAAqB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 +1,8 @@
1
+ /** #6232 / #6539: immutable source ownership is indexed once on demand;
2
+ * effective ownership is always rechecked through the live overlay. */
3
+ import { type IfcDataStore } from '@ifc-lite/parser';
4
+ import { type MutablePropertyView } from '@ifc-lite/mutations';
5
+ /** A deleted, renamed or retyped original owner does not reserve its old
6
+ * GUID. Live named/positional overrides and creations can introduce an owner. */
7
+ export declare function assertHostedGlobalIdAvailable(store: IfcDataStore, view: MutablePropertyView, globalId: string): void;
8
+ //# sourceMappingURL=hosted-global-id.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hosted-global-id.d.ts","sourceRoot":"","sources":["../../src/in-store/hosted-global-id.ts"],"names":[],"mappings":"AAIA;uEACuE;AACvE,OAAO,EAA8B,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACjF,OAAO,EAA6B,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAsC1F;iFACiF;AACjF,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAYpH"}
@@ -0,0 +1,53 @@
1
+ /* This Source Code Form is subject to the terms of the Mozilla Public
2
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
+ /** #6232 / #6539: immutable source ownership is indexed once on demand;
5
+ * effective ownership is always rechecked through the live overlay. */
6
+ import { getAttributeNamesForSchema } from '@ifc-lite/parser';
7
+ import { iterateEffectiveEntityIds } from '@ifc-lite/mutations';
8
+ import { AnchorEntityReader } from './resolve-anchor.js';
9
+ const indices = new WeakMap();
10
+ function sourceOwners(store) {
11
+ const cached = indices.get(store);
12
+ // @raw-entity-enumeration-ok Cache identity compares the immutable source index; effective ownership is rechecked below.
13
+ if (cached?.entities === store.entities && cached.byId === store.entityIndex.byId && cached.schema === store.schemaVersion) {
14
+ return cached.owners;
15
+ }
16
+ // The display table's GlobalId index omits relationship GUIDs. Index ALL
17
+ // schema-declared IfcRoot classes, never unrelated points/geometry records.
18
+ // @raw-entity-enumeration-ok Source class keys seed the immutable IfcRoot GUID index; live retypes and creations are checked separately.
19
+ const rootTypes = [...store.entityIndex.byType.keys()].filter(type => getAttributeNamesForSchema(type, store.schemaVersion)[0] === 'GlobalId');
20
+ const reader = new AnchorEntityReader(store, null);
21
+ const owners = new Map();
22
+ // An empty type filter means every entity to the canonical iterator.
23
+ const roots = rootTypes.length ? iterateEffectiveEntityIds(store, null, rootTypes) : [];
24
+ for (const { expressId } of roots) {
25
+ const guid = reader.entity(expressId)?.attributes[0];
26
+ if (typeof guid !== 'string')
27
+ continue;
28
+ const ids = owners.get(guid);
29
+ if (ids)
30
+ ids.push(expressId);
31
+ else
32
+ owners.set(guid, [expressId]);
33
+ }
34
+ // @raw-entity-enumeration-ok Retain source-index identity only for cache invalidation, never as live session membership.
35
+ indices.set(store, { entities: store.entities, byId: store.entityIndex.byId, schema: store.schemaVersion, owners });
36
+ return owners;
37
+ }
38
+ /** A deleted, renamed or retyped original owner does not reserve its old
39
+ * GUID. Live named/positional overrides and creations can introduce an owner. */
40
+ export function assertHostedGlobalIdAvailable(store, view, globalId) {
41
+ const candidates = new Set([
42
+ ...(sourceOwners(store).get(globalId) ?? []),
43
+ ...view.getAttributeOverrideEntityIds(),
44
+ ]);
45
+ const reader = new AnchorEntityReader(store, view);
46
+ for (const { expressId } of iterateEffectiveEntityIds(store, view, undefined, candidates)) {
47
+ const entity = reader.entity(expressId);
48
+ if (entity?.names[0] === 'GlobalId' && entity.attributes[0] === globalId) {
49
+ throw new Error(`GlobalId '${globalId}' is already used by #${expressId}`);
50
+ }
51
+ }
52
+ }
53
+ //# sourceMappingURL=hosted-global-id.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hosted-global-id.js","sourceRoot":"","sources":["../../src/in-store/hosted-global-id.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;uEACuE;AACvE,OAAO,EAAE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AS,EAAE,CAAC,CAAC;QAC7E,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,30 @@
1
+ /** One fresh-placement writer for hosted moves and host reanchoring (#6232).
2
+ * Source Location/RelativePlacement records can be shared across hosts. */
3
+ import type { IfcDataStore } from '@ifc-lite/parser';
4
+ import type { StoreEditor } from '@ifc-lite/mutations';
5
+ import { AnchorEntityReader } from './resolve-anchor.js';
6
+ import { type HostedFillRead } from './hosted-fill-read.js';
7
+ import { type Vec3 } from './host-geometry-frame.js';
8
+ /** A fresh placement prevents a shared source Location/RelativePlacement
9
+ * from moving another occurrence. A filling directly follows its opening. */
10
+ export declare function moveHostedOpeningPlacement(reader: AnchorEntityReader, editor: StoreEditor, read: HostedFillRead, next: Vec3, targetHostId?: number): void;
11
+ export interface HostedOpeningReassignment {
12
+ readonly openingId: number;
13
+ readonly hostId: number;
14
+ /** Opening origin in the target host frame, in native file units. */
15
+ readonly location: Vec3;
16
+ }
17
+ /** Apply a validated split/rehost plan atomically. Every opening, filling and
18
+ * void relation keeps its identity; only the selected occurrence receives
19
+ * fresh placements and its void relation's host changes. Source placement
20
+ * records stay untouched. The caller decides the final host/fit for all cuts;
21
+ * this batch never validates against intermediate single-move positions. */
22
+ export declare function reassignHostedOpeningsInStore(store: IfcDataStore, editor: StoreEditor, sourceHostId: number, moves: readonly HostedOpeningReassignment[]): void;
23
+ /** Reanchor every opening after a host-origin translation. `shift` is the
24
+ * host's origin displacement in its own frame, in native file units. The
25
+ * caller validates the final host body before changing its placement.
26
+ * Reanchor the whole batch without applying single-move fit/overlap checks
27
+ * to transient positions; the cuts keep their relative positions and shape.
28
+ * Unreadable cuts or placements refuse with no surviving writes. */
29
+ export declare function reanchorHostedOpeningsInStore(store: IfcDataStore, editor: StoreEditor, hostId: number, shift: Vec3): void;
30
+ //# sourceMappingURL=hosted-placement-edit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hosted-placement-edit.d.ts","sourceRoot":"","sources":["../../src/in-store/hosted-placement-edit.ts"],"names":[],"mappings":"AAIA;2EAC2E;AAC3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAA0B,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACpF,OAAO,EAAsC,KAAK,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAIzF;6EAC6E;AAC7E,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,kBAAkB,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,SAAc,GAAG,IAAI,CA0C9J;AAED,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,qEAAqE;IACrE,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC;CACzB;AAED;;;;4EAI4E;AAC5E,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,yBAAyB,EAAE,GAC1G,IAAI,CA8BN;AAED;;;;;oEAKoE;AACpE,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,GACpE,IAAI,CAYN"}
@@ -0,0 +1,123 @@
1
+ /* This Source Code Form is subject to the terms of the Mozilla Public
2
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
+ import { AnchorEntityReader } from './resolve-anchor.js';
5
+ import { readHostOpeningExtents } from './hosted-element.js';
6
+ import { readHostedOpeningBatch } from './hosted-fill-read.js';
7
+ import { axis3d, placementInAncestor, refId } from './host-geometry-frame.js';
8
+ const ref = (id) => `#${id}`;
9
+ /** A fresh placement prevents a shared source Location/RelativePlacement
10
+ * from moving another occurrence. A filling directly follows its opening. */
11
+ export function moveHostedOpeningPlacement(reader, editor, read, next, targetHostId = read.hostId) {
12
+ if (next.length !== 3 || !next.every(Number.isFinite))
13
+ throw new Error('The opening location must contain three finite native lengths');
14
+ const opening = reader.entity(read.openingId);
15
+ const oldPlacementId = refId(opening.attributes[5]);
16
+ const oldPlacement = oldPlacementId === null ? null : reader.entity(oldPlacementId);
17
+ const oldAxisId = oldPlacement ? refId(oldPlacement.attributes[1]) : null;
18
+ const oldAxis = oldAxisId === null ? null : reader.entity(oldAxisId);
19
+ const parent = oldPlacement ? refId(oldPlacement.attributes[0]) : null;
20
+ const host = reader.entity(read.hostId);
21
+ const hostPlacement = host ? refId(host.attributes[5]) : null;
22
+ if (!oldAxis || parent === null || hostPlacement !== parent || oldPlacementId === null
23
+ || !placementInAncestor(reader, oldPlacementId, parent))
24
+ throw new Error('The opening placement cannot be edited safely');
25
+ const targetHost = reader.entity(targetHostId);
26
+ const targetPlacementId = targetHost ? refId(targetHost.attributes[5]) : null;
27
+ const targetPlacement = targetPlacementId === null ? null : reader.entity(targetPlacementId);
28
+ const targetAxisId = targetPlacement ? refId(targetPlacement.attributes[1]) : null;
29
+ const targetAxis = targetAxisId === null ? null : reader.entity(targetAxisId);
30
+ if (!targetPlacement || targetPlacement.type.toUpperCase() !== 'IFCLOCALPLACEMENT'
31
+ || targetAxisId === null || targetAxis?.type.toUpperCase() !== 'IFCAXIS2PLACEMENT3D'
32
+ || !axis3d(reader, targetAxisId))
33
+ throw new Error('The target host placement cannot be edited safely');
34
+ const direction = (value) => {
35
+ if (value === null || value === undefined)
36
+ return null;
37
+ const id = refId(value);
38
+ if (id === null)
39
+ throw new Error('An unreadable placement direction is refused');
40
+ return ref(id);
41
+ };
42
+ const point = editor.addEntity('IfcCartesianPoint', [next]).expressId;
43
+ const axis = editor.addEntity('IfcAxis2Placement3D', [ref(point), direction(oldAxis.attributes[1]), direction(oldAxis.attributes[2])]).expressId;
44
+ const placement = editor.addEntity('IfcLocalPlacement', [ref(targetPlacementId), ref(axis)]).expressId;
45
+ if (read.fillingId !== null) {
46
+ const filling = reader.entity(read.fillingId);
47
+ const fillingPlacementId = refId(filling.attributes[5]);
48
+ const fillingPlacement = fillingPlacementId === null ? null : reader.entity(fillingPlacementId);
49
+ const fillingAxis = fillingPlacement ? refId(fillingPlacement.attributes[1]) : null;
50
+ if (!fillingPlacement || refId(fillingPlacement.attributes[0]) !== oldPlacementId || fillingAxis === null
51
+ || fillingPlacementId === null || !placementInAncestor(reader, fillingPlacementId, parent)) {
52
+ throw new Error('A filling not placed directly in its opening cannot be moved safely');
53
+ }
54
+ const nextFilling = editor.addEntity('IfcLocalPlacement', [ref(placement), ref(fillingAxis)]).expressId;
55
+ editor.setPositionalAttribute(read.fillingId, 5, ref(nextFilling));
56
+ }
57
+ editor.setPositionalAttribute(read.openingId, 5, ref(placement));
58
+ }
59
+ /** Apply a validated split/rehost plan atomically. Every opening, filling and
60
+ * void relation keeps its identity; only the selected occurrence receives
61
+ * fresh placements and its void relation's host changes. Source placement
62
+ * records stay untouched. The caller decides the final host/fit for all cuts;
63
+ * this batch never validates against intermediate single-move positions. */
64
+ export function reassignHostedOpeningsInStore(store, editor, sourceHostId, moves) {
65
+ if (moves.length === 0)
66
+ return;
67
+ editor.runAtomic(draft => {
68
+ const view = draft.getMutationView(), reader = new AnchorEntityReader(store, view);
69
+ const sourceRelations = new Map();
70
+ for (const id of reader.ids('IFCRELVOIDSELEMENT')) {
71
+ const rel = reader.entity(id);
72
+ if (!rel || refId(rel.attributes[4]) !== sourceHostId)
73
+ continue;
74
+ const openingId = refId(rel.attributes[5]);
75
+ if (openingId === null)
76
+ continue;
77
+ const ids = sourceRelations.get(openingId) ?? [];
78
+ ids.push(id);
79
+ sourceRelations.set(openingId, ids);
80
+ }
81
+ const seen = new Set();
82
+ const reads = readHostedOpeningBatch(store, new Set(moves.map(move => move.openingId)), view);
83
+ const plan = moves.map(move => {
84
+ if (seen.has(move.openingId))
85
+ throw new Error('An opening cannot be reassigned twice in one batch');
86
+ seen.add(move.openingId);
87
+ const read = reads.get(move.openingId);
88
+ if (!read || read.hostId !== sourceHostId)
89
+ throw new Error('The opening does not belong to the source host');
90
+ const relations = sourceRelations.get(move.openingId) ?? [];
91
+ if (relations.length !== 1)
92
+ throw new Error('An opening must have exactly one source void relationship');
93
+ return { move, read, relationId: relations[0] };
94
+ });
95
+ for (const { move, read, relationId } of plan) {
96
+ moveHostedOpeningPlacement(reader, draft, read, move.location, move.hostId);
97
+ if (move.hostId !== sourceHostId)
98
+ draft.setPositionalAttribute(relationId, 4, ref(move.hostId));
99
+ }
100
+ });
101
+ }
102
+ /** Reanchor every opening after a host-origin translation. `shift` is the
103
+ * host's origin displacement in its own frame, in native file units. The
104
+ * caller validates the final host body before changing its placement.
105
+ * Reanchor the whole batch without applying single-move fit/overlap checks
106
+ * to transient positions; the cuts keep their relative positions and shape.
107
+ * Unreadable cuts or placements refuse with no surviving writes. */
108
+ export function reanchorHostedOpeningsInStore(store, editor, hostId, shift) {
109
+ if (shift.length !== 3 || !shift.every(Number.isFinite))
110
+ throw new Error('The host displacement must contain three finite native lengths');
111
+ editor.runAtomic(draft => {
112
+ const view = draft.getMutationView(), reader = new AnchorEntityReader(store, view);
113
+ const { cuts, unreadable } = readHostOpeningExtents(store, hostId, view);
114
+ if (unreadable.length > 0)
115
+ throw new Error('Unreadable hosted cuts cannot be reanchored safely');
116
+ for (const cut of cuts) {
117
+ moveHostedOpeningPlacement(reader, draft, cut, [
118
+ cut.location[0] - shift[0], cut.location[1] - shift[1], cut.location[2] - shift[2],
119
+ ]);
120
+ }
121
+ });
122
+ }
123
+ //# sourceMappingURL=hosted-placement-edit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hosted-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AAG,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QACzE,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;QACjG,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,0BAA0B,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE;gBAC7C,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;aACnF,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,12 @@
1
+ /** #6232: repeated size commits must not grow a mapping chain until the
2
+ * canonical renderer's reference-walk bound drops the occurrence. Collapse
3
+ * only an existing anchored scale with the same rigid factorization; other
4
+ * mappings remain untouched. No source/type entity is mutated. */
5
+ import type { AnchorEntityReader } from './resolve-anchor.js';
6
+ import { type Frame3, type Vec3 } from './host-geometry-frame.js';
7
+ export declare function retainedHostedScale(reader: AnchorEntityReader, repId: number, dimension: 2 | 3, inHost: Frame3, sourceAnchor: Vec3, inverse: Frame3, localAnchor: Vec3): {
8
+ repId: number;
9
+ width: number;
10
+ height: number;
11
+ } | null;
12
+ //# sourceMappingURL=hosted-scale-chain.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hosted-scale-chain.d.ts","sourceRoot":"","sources":["../../src/in-store/hosted-scale-chain.ts"],"names":[],"mappings":"AAIA;;;kEAGkE;AAClE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAuC,KAAK,MAAM,EAAE,KAAK,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAEvG,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,EAC3D,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,GACrE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CA0DzD"}
@@ -0,0 +1,74 @@
1
+ /* This Source Code Form is subject to the terms of the Mozilla Public
2
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
+ import { axis2d, axis3d, num, pointOf, refId } from './host-geometry-frame.js';
5
+ export function retainedHostedScale(reader, repId, dimension, inHost, sourceAnchor, inverse, localAnchor) {
6
+ const rep = reader.entity(repId);
7
+ const items = rep?.attributes[3];
8
+ if (!Array.isArray(items) || items.length !== 1)
9
+ return null;
10
+ const itemId = refId(items[0]), item = itemId === null ? null : reader.entity(itemId);
11
+ if (item?.type.toUpperCase() !== 'IFCMAPPEDITEM')
12
+ return null;
13
+ const mapId = refId(item.attributes[0]), targetId = refId(item.attributes[1]);
14
+ const map = mapId === null ? null : reader.entity(mapId);
15
+ const target = targetId === null ? null : reader.entity(targetId);
16
+ if (map?.type.toUpperCase() !== 'IFCREPRESENTATIONMAP' || !target)
17
+ return null;
18
+ const originId = refId(map.attributes[0]);
19
+ const mappingOrigin = originId === null ? null : reader.entity(originId);
20
+ if (mappingOrigin?.type.toUpperCase() !== `IFCAXIS2PLACEMENT${dimension}D`)
21
+ return null;
22
+ const underlyingId = refId(map.attributes[1]);
23
+ const underlying = underlyingId === null ? null : reader.entity(underlyingId);
24
+ if (underlying?.type.toUpperCase() !== 'IFCSHAPEREPRESENTATION' || underlyingId === null
25
+ || refId(underlying.attributes[0]) !== refId(rep?.attributes[0]))
26
+ return null;
27
+ // A style or presentation layer on the wrapper itself must remain in the
28
+ // graph. Retaining that wrapper once still lets later plain scales compose.
29
+ for (const id of reader.ids('IFCSTYLEDITEM')) {
30
+ if (refId(reader.entity(id)?.attributes[0]) === itemId)
31
+ return null;
32
+ }
33
+ for (const type of ['IFCPRESENTATIONLAYERASSIGNMENT', 'IFCPRESENTATIONLAYERWITHSTYLE']) {
34
+ for (const id of reader.ids(type)) {
35
+ const assigned = reader.entity(id)?.attributes[2];
36
+ if (Array.isArray(assigned) && assigned.some(value => [itemId, repId].includes(refId(value))))
37
+ return null;
38
+ }
39
+ }
40
+ // Directions only allow floating-point normalization noise. Origins use
41
+ // a billionth of the native file unit; this is not a clipping tolerance.
42
+ const same = (a, b, epsilon) => a.length === b.length && a.every((v, i) => Math.abs(v - b[i]) <= epsilon);
43
+ const origin = pointOf(reader, target.attributes[2], 'IFCCARTESIANPOINT', dimension);
44
+ const x = pointOf(reader, target.attributes[0], 'IFCDIRECTION', dimension);
45
+ const y = pointOf(reader, target.attributes[1], 'IFCDIRECTION', dimension);
46
+ if (!origin || !x || !y || !same(origin.slice(0, dimension), localAnchor.slice(0, dimension), 1e-9)
47
+ || !same(x.slice(0, dimension), inverse.x.slice(0, dimension), 1e-12)
48
+ || !same(y.slice(0, dimension), inverse.y.slice(0, dimension), 1e-12))
49
+ return null;
50
+ const width = num(target.attributes[3]);
51
+ if (width === null || width <= 0)
52
+ return null;
53
+ if (dimension === 2) {
54
+ if (target.type.toUpperCase() !== 'IFCCARTESIANTRANSFORMATIONOPERATOR2DNONUNIFORM'
55
+ || num(target.attributes[4]) !== 1)
56
+ return null;
57
+ const source = axis2d(reader, originId);
58
+ if (!source || !same(source.o, sourceAnchor.slice(0, 2), 1e-9)
59
+ || !same(source.x, inHost.x.slice(0, 2), 1e-12))
60
+ return null;
61
+ return { repId: underlyingId, width, height: 1 };
62
+ }
63
+ const source = axis3d(reader, originId);
64
+ const z = pointOf(reader, target.attributes[4], 'IFCDIRECTION');
65
+ const height = num(target.attributes[6]);
66
+ if (target.type.toUpperCase() !== 'IFCCARTESIANTRANSFORMATIONOPERATOR3DNONUNIFORM'
67
+ || num(target.attributes[5]) !== 1 || height === null || height <= 0 || !source || !z
68
+ || !same(source.o, sourceAnchor, 1e-9) || !same(source.x, inHost.x, 1e-12)
69
+ || !same(source.y, inHost.y, 1e-12) || !same(source.z, inHost.z, 1e-12)
70
+ || !same(z, inverse.z, 1e-12))
71
+ return null;
72
+ return { repId: underlyingId, width, height };
73
+ }
74
+ //# sourceMappingURL=hosted-scale-chain.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hosted-scale-chain.js","sourceRoot":"","sources":["../../src/in-store/hosted-scale-chain.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAO/D,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAA0B,MAAM,0BAA0B,CAAC;AAEvG,MAAM,UAAU,mBAAmB,CACjC,MAA0B,EAAE,KAAa,EAAE,SAAgB,EAC3D,MAAc,EAAE,YAAkB,EAAE,OAAe,EAAE,WAAiB;IAEtE,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACjC,MAAM,KAAK,GAAG,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IACjC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC7D,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,GAAG,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACtF,IAAI,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK,eAAe;QAAE,OAAO,IAAI,CAAC;IAC9D,MAAM,KAA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AE,OAAO,IAAI,CAAC;IAC7C,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAChD,CAAC"}
@@ -0,0 +1,9 @@
1
+ /** Occurrence-only affine size edit. Source/type geometry and styles remain
2
+ * shared and immutable; each representation receives its own mapping wrapper.
3
+ * IFC mapping supports independent axis scales, including nested mappings:
4
+ * https://standards.buildingsmart.org/IFC/RELEASE/IFC4_3/HTML/lexical/IfcCartesianTransformationOperator3DnonUniform.htm */
5
+ import type { StoreEditor } from '@ifc-lite/mutations';
6
+ import type { AnchorEntityReader } from './resolve-anchor.js';
7
+ import { type Frame3, type Vec3 } from './host-geometry-frame.js';
8
+ export declare function scaleHostedShape(reader: AnchorEntityReader, editor: StoreEditor, productId: number, inHost: Frame3, hostAnchor: Vec3, widthScale: number, heightScale: number): void;
9
+ //# sourceMappingURL=hosted-shape-edit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hosted-shape-edit.d.ts","sourceRoot":"","sources":["../../src/in-store/hosted-shape-edit.ts"],"names":[],"mappings":"AAIA;;;4HAG4H;AAC5H,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAqD,KAAK,MAAM,EAAE,KAAK,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAKrH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,kBAAkB,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAClE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GACxE,IAAI,CAiEN"}