@ifc-lite/export 4.13.3 → 5.0.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 (342) hide show
  1. package/dist/affected-set.d.ts.map +1 -1
  2. package/dist/affected-set.js +9 -2
  3. package/dist/affected-set.js.map +1 -1
  4. package/dist/anonymize-export.js +2 -2
  5. package/dist/anonymize-export.js.map +1 -1
  6. package/dist/anonymize-scrub.js +3 -3
  7. package/dist/anonymize-scrub.js.map +1 -1
  8. package/dist/appearance-dependencies.js +1 -1
  9. package/dist/appearance-dependencies.js.map +1 -1
  10. package/dist/attribute-real-slots.js +1 -1
  11. package/dist/attribute-real-slots.js.map +1 -1
  12. package/dist/attribute-slot-types.d.ts.map +1 -1
  13. package/dist/attribute-slot-types.js +22 -14
  14. package/dist/attribute-slot-types.js.map +1 -1
  15. package/dist/authored-resource-cleanup.js +1 -1
  16. package/dist/authored-resource-cleanup.js.map +1 -1
  17. package/dist/declared-property-type.d.ts.map +1 -1
  18. package/dist/declared-property-type.js +5 -4
  19. package/dist/declared-property-type.js.map +1 -1
  20. package/dist/edit-ownership.d.ts +8 -0
  21. package/dist/edit-ownership.d.ts.map +1 -1
  22. package/dist/edit-ownership.js +58 -44
  23. package/dist/edit-ownership.js.map +1 -1
  24. package/dist/effective-index-created-rows.d.ts +22 -0
  25. package/dist/effective-index-created-rows.d.ts.map +1 -0
  26. package/dist/effective-index-created-rows.js +48 -0
  27. package/dist/effective-index-created-rows.js.map +1 -0
  28. package/dist/effective-index.d.ts.map +1 -1
  29. package/dist/effective-index.js +4 -3
  30. package/dist/effective-index.js.map +1 -1
  31. package/dist/effective-source-record.js +1 -1
  32. package/dist/effective-source-record.js.map +1 -1
  33. package/dist/entity-subgraph.d.ts +6 -2
  34. package/dist/entity-subgraph.d.ts.map +1 -1
  35. package/dist/entity-subgraph.js +70 -5
  36. package/dist/entity-subgraph.js.map +1 -1
  37. package/dist/entity-type-sets.d.ts +2 -19
  38. package/dist/entity-type-sets.d.ts.map +1 -1
  39. package/dist/entity-type-sets.js +14 -4
  40. package/dist/entity-type-sets.js.map +1 -1
  41. package/dist/georef-closure.d.ts +12 -0
  42. package/dist/georef-closure.d.ts.map +1 -1
  43. package/dist/georef-closure.js +3 -1
  44. package/dist/georef-closure.js.map +1 -1
  45. package/dist/ifc4-registry.d.ts +14 -0
  46. package/dist/ifc4-registry.d.ts.map +1 -0
  47. package/dist/ifc4-registry.js +22 -0
  48. package/dist/ifc4-registry.js.map +1 -0
  49. package/dist/ifc5-effective-rows.js +1 -1
  50. package/dist/ifc5-effective-rows.js.map +1 -1
  51. package/dist/ifc5-exporter.d.ts.map +1 -1
  52. package/dist/ifc5-exporter.js +3 -10
  53. package/dist/ifc5-exporter.js.map +1 -1
  54. package/dist/ifc5-tree-scope.js +2 -2
  55. package/dist/ifc5-tree-scope.js.map +1 -1
  56. package/dist/index.d.ts +8 -2
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/index.js +8 -2
  59. package/dist/index.js.map +1 -1
  60. package/dist/lod0-generator.d.ts.map +1 -1
  61. package/dist/lod0-generator.js +14 -8
  62. package/dist/lod0-generator.js.map +1 -1
  63. package/dist/merged-bake.d.ts +32 -0
  64. package/dist/merged-bake.d.ts.map +1 -0
  65. package/dist/merged-bake.js +120 -0
  66. package/dist/merged-bake.js.map +1 -0
  67. package/dist/merged-context.d.ts +49 -6
  68. package/dist/merged-context.d.ts.map +1 -1
  69. package/dist/merged-context.js +165 -53
  70. package/dist/merged-context.js.map +1 -1
  71. package/dist/merged-exporter.d.ts +7 -14
  72. package/dist/merged-exporter.d.ts.map +1 -1
  73. package/dist/merged-exporter.js +48 -113
  74. package/dist/merged-exporter.js.map +1 -1
  75. package/dist/merged-georef-normalize.d.ts +54 -0
  76. package/dist/merged-georef-normalize.d.ts.map +1 -0
  77. package/dist/merged-georef-normalize.js +260 -0
  78. package/dist/merged-georef-normalize.js.map +1 -0
  79. package/dist/merged-project-contexts.d.ts +12 -0
  80. package/dist/merged-project-contexts.d.ts.map +1 -0
  81. package/dist/merged-project-contexts.js +56 -0
  82. package/dist/merged-project-contexts.js.map +1 -0
  83. package/dist/merged-remap.d.ts +2 -0
  84. package/dist/merged-remap.d.ts.map +1 -1
  85. package/dist/merged-remap.js +10 -0
  86. package/dist/merged-remap.js.map +1 -1
  87. package/dist/merged-subcontext.d.ts +22 -0
  88. package/dist/merged-subcontext.d.ts.map +1 -1
  89. package/dist/merged-subcontext.js +14 -18
  90. package/dist/merged-subcontext.js.map +1 -1
  91. package/dist/nonrel-positional-ref-narrowing.js +6 -6
  92. package/dist/nonrel-positional-ref-narrowing.js.map +1 -1
  93. package/dist/nonrel-ref-list-types.d.ts +4 -4
  94. package/dist/nonrel-ref-list-types.d.ts.map +1 -1
  95. package/dist/nonrel-ref-list-types.js +19 -7
  96. package/dist/nonrel-ref-list-types.js.map +1 -1
  97. package/dist/parquet-created-entity-rows.js +1 -1
  98. package/dist/parquet-created-entity-rows.js.map +1 -1
  99. package/dist/parquet-relationship-rows.js +1 -1
  100. package/dist/parquet-relationship-rows.js.map +1 -1
  101. package/dist/reference-collector.d.ts.map +1 -1
  102. package/dist/reference-collector.js +2 -2
  103. package/dist/reference-collector.js.map +1 -1
  104. package/dist/registry-entity-names.d.ts +6 -2
  105. package/dist/registry-entity-names.d.ts.map +1 -1
  106. package/dist/registry-entity-names.js +10 -2
  107. package/dist/registry-entity-names.js.map +1 -1
  108. package/dist/relationship-slot-bounds.js +4 -4
  109. package/dist/relationship-slot-bounds.js.map +1 -1
  110. package/dist/remesh-context-roots.d.ts +13 -6
  111. package/dist/remesh-context-roots.d.ts.map +1 -1
  112. package/dist/remesh-context-roots.js +51 -22
  113. package/dist/remesh-context-roots.js.map +1 -1
  114. package/dist/renumber-step-ids.d.ts +43 -0
  115. package/dist/renumber-step-ids.d.ts.map +1 -0
  116. package/dist/renumber-step-ids.js +237 -0
  117. package/dist/renumber-step-ids.js.map +1 -0
  118. package/dist/retype.d.ts.map +1 -1
  119. package/dist/retype.js +23 -12
  120. package/dist/retype.js.map +1 -1
  121. package/dist/schema-conversion-description.d.ts +6 -0
  122. package/dist/schema-conversion-description.d.ts.map +1 -0
  123. package/dist/schema-conversion-description.js +25 -0
  124. package/dist/schema-conversion-description.js.map +1 -0
  125. package/dist/schema-conversion-loss-report.d.ts +20 -34
  126. package/dist/schema-conversion-loss-report.d.ts.map +1 -1
  127. package/dist/schema-conversion-loss-report.js +177 -14
  128. package/dist/schema-conversion-loss-report.js.map +1 -1
  129. package/dist/schema-converter-attr-maps.d.ts +51 -0
  130. package/dist/schema-converter-attr-maps.d.ts.map +1 -0
  131. package/dist/schema-converter-attr-maps.js +142 -0
  132. package/dist/schema-converter-attr-maps.js.map +1 -0
  133. package/dist/schema-converter-attr-remap.d.ts +8 -0
  134. package/dist/schema-converter-attr-remap.d.ts.map +1 -1
  135. package/dist/schema-converter-attr-remap.js +15 -1
  136. package/dist/schema-converter-attr-remap.js.map +1 -1
  137. package/dist/schema-converter-document-links.d.ts +23 -0
  138. package/dist/schema-converter-document-links.d.ts.map +1 -0
  139. package/dist/schema-converter-document-links.js +146 -0
  140. package/dist/schema-converter-document-links.js.map +1 -0
  141. package/dist/schema-converter-enums.d.ts +13 -1
  142. package/dist/schema-converter-enums.d.ts.map +1 -1
  143. package/dist/schema-converter-enums.js +30 -4
  144. package/dist/schema-converter-enums.js.map +1 -1
  145. package/dist/schema-converter-ifc4-slots.d.ts +4 -3
  146. package/dist/schema-converter-ifc4-slots.d.ts.map +1 -1
  147. package/dist/schema-converter-ifc4-slots.js +4 -3
  148. package/dist/schema-converter-ifc4-slots.js.map +1 -1
  149. package/dist/schema-converter-renames.d.ts +17 -0
  150. package/dist/schema-converter-renames.d.ts.map +1 -1
  151. package/dist/schema-converter-renames.js +34 -2
  152. package/dist/schema-converter-renames.js.map +1 -1
  153. package/dist/schema-converter-retyped.d.ts +17 -0
  154. package/dist/schema-converter-retyped.d.ts.map +1 -0
  155. package/dist/schema-converter-retyped.js +68 -0
  156. package/dist/schema-converter-retyped.js.map +1 -0
  157. package/dist/schema-converter-structural-axes.d.ts +55 -0
  158. package/dist/schema-converter-structural-axes.d.ts.map +1 -0
  159. package/dist/schema-converter-structural-axes.js +378 -0
  160. package/dist/schema-converter-structural-axes.js.map +1 -0
  161. package/dist/schema-converter-structural-carriers.d.ts +76 -0
  162. package/dist/schema-converter-structural-carriers.d.ts.map +1 -0
  163. package/dist/schema-converter-structural-carriers.js +330 -0
  164. package/dist/schema-converter-structural-carriers.js.map +1 -0
  165. package/dist/schema-converter-structural-diagnostics.d.ts +64 -0
  166. package/dist/schema-converter-structural-diagnostics.d.ts.map +1 -0
  167. package/dist/schema-converter-structural-diagnostics.js +219 -0
  168. package/dist/schema-converter-structural-diagnostics.js.map +1 -0
  169. package/dist/schema-converter-structural-links.d.ts +21 -0
  170. package/dist/schema-converter-structural-links.d.ts.map +1 -0
  171. package/dist/schema-converter-structural-links.js +38 -0
  172. package/dist/schema-converter-structural-links.js.map +1 -0
  173. package/dist/schema-converter-structural-source.d.ts +76 -0
  174. package/dist/schema-converter-structural-source.d.ts.map +1 -0
  175. package/dist/schema-converter-structural-source.js +197 -0
  176. package/dist/schema-converter-structural-source.js.map +1 -0
  177. package/dist/schema-converter-structural-thickness.d.ts +33 -0
  178. package/dist/schema-converter-structural-thickness.d.ts.map +1 -0
  179. package/dist/schema-converter-structural-thickness.js +155 -0
  180. package/dist/schema-converter-structural-thickness.js.map +1 -0
  181. package/dist/schema-converter-structural-varying.d.ts +50 -0
  182. package/dist/schema-converter-structural-varying.d.ts.map +1 -0
  183. package/dist/schema-converter-structural-varying.js +170 -0
  184. package/dist/schema-converter-structural-varying.js.map +1 -0
  185. package/dist/schema-converter-structural.d.ts +8 -0
  186. package/dist/schema-converter-structural.d.ts.map +1 -0
  187. package/dist/schema-converter-structural.js +81 -0
  188. package/dist/schema-converter-structural.js.map +1 -0
  189. package/dist/schema-converter-userdefined-label.d.ts +8 -0
  190. package/dist/schema-converter-userdefined-label.d.ts.map +1 -0
  191. package/dist/schema-converter-userdefined-label.js +60 -0
  192. package/dist/schema-converter-userdefined-label.js.map +1 -0
  193. package/dist/schema-converter-userdefined.d.ts +15 -0
  194. package/dist/schema-converter-userdefined.d.ts.map +1 -0
  195. package/dist/schema-converter-userdefined.js +59 -0
  196. package/dist/schema-converter-userdefined.js.map +1 -0
  197. package/dist/schema-converter-value-forms.d.ts +12 -0
  198. package/dist/schema-converter-value-forms.d.ts.map +1 -0
  199. package/dist/schema-converter-value-forms.js +188 -0
  200. package/dist/schema-converter-value-forms.js.map +1 -0
  201. package/dist/schema-converter.d.ts +2 -8
  202. package/dist/schema-converter.d.ts.map +1 -1
  203. package/dist/schema-converter.js +57 -68
  204. package/dist/schema-converter.js.map +1 -1
  205. package/dist/schema-enum-policy.d.ts +5 -1
  206. package/dist/schema-enum-policy.d.ts.map +1 -1
  207. package/dist/schema-enum-policy.js +21 -1
  208. package/dist/schema-enum-policy.js.map +1 -1
  209. package/dist/schema-grid-frames.d.ts +19 -0
  210. package/dist/schema-grid-frames.d.ts.map +1 -0
  211. package/dist/schema-grid-frames.js +84 -0
  212. package/dist/schema-grid-frames.js.map +1 -0
  213. package/dist/schema-ifc2x3-placements.d.ts +12 -0
  214. package/dist/schema-ifc2x3-placements.d.ts.map +1 -0
  215. package/dist/schema-ifc2x3-placements.js +297 -0
  216. package/dist/schema-ifc2x3-placements.js.map +1 -0
  217. package/dist/schema-ifc2x3-records.d.ts +58 -0
  218. package/dist/schema-ifc2x3-records.d.ts.map +1 -0
  219. package/dist/schema-ifc2x3-records.js +179 -0
  220. package/dist/schema-ifc2x3-records.js.map +1 -0
  221. package/dist/schema-style-flatten.d.ts +7 -2
  222. package/dist/schema-style-flatten.d.ts.map +1 -1
  223. package/dist/schema-style-flatten.js +34 -2
  224. package/dist/schema-style-flatten.js.map +1 -1
  225. package/dist/schema-value-form-policy.d.ts +129 -0
  226. package/dist/schema-value-form-policy.d.ts.map +1 -0
  227. package/dist/schema-value-form-policy.js +222 -0
  228. package/dist/schema-value-form-policy.js.map +1 -0
  229. package/dist/section-export.d.ts.map +1 -1
  230. package/dist/section-export.js +3 -2
  231. package/dist/section-export.js.map +1 -1
  232. package/dist/select-qualification.d.ts.map +1 -1
  233. package/dist/select-qualification.js +6 -5
  234. package/dist/select-qualification.js.map +1 -1
  235. package/dist/step-collection.d.ts.map +1 -1
  236. package/dist/step-collection.js +5 -0
  237. package/dist/step-collection.js.map +1 -1
  238. package/dist/step-comment-skip.d.ts +8 -0
  239. package/dist/step-comment-skip.d.ts.map +1 -1
  240. package/dist/step-comment-skip.js +28 -0
  241. package/dist/step-comment-skip.js.map +1 -1
  242. package/dist/step-coordinate-options.d.ts +15 -0
  243. package/dist/step-coordinate-options.d.ts.map +1 -1
  244. package/dist/step-coordinate-options.js +13 -1
  245. package/dist/step-coordinate-options.js.map +1 -1
  246. package/dist/step-derived-quantities.d.ts +23 -0
  247. package/dist/step-derived-quantities.d.ts.map +1 -0
  248. package/dist/step-derived-quantities.js +50 -0
  249. package/dist/step-derived-quantities.js.map +1 -0
  250. package/dist/step-export-types.d.ts +2 -1
  251. package/dist/step-export-types.d.ts.map +1 -1
  252. package/dist/step-export-types.js.map +1 -1
  253. package/dist/step-exporter.d.ts +0 -6
  254. package/dist/step-exporter.d.ts.map +1 -1
  255. package/dist/step-exporter.js +11 -7
  256. package/dist/step-exporter.js.map +1 -1
  257. package/dist/step-georeferencing.d.ts +2 -0
  258. package/dist/step-georeferencing.d.ts.map +1 -1
  259. package/dist/step-georeferencing.js +122 -46
  260. package/dist/step-georeferencing.js.map +1 -1
  261. package/dist/step-header.d.ts.map +1 -1
  262. package/dist/step-header.js +4 -1
  263. package/dist/step-header.js.map +1 -1
  264. package/dist/step-internal-pset-ids.d.ts +7 -0
  265. package/dist/step-internal-pset-ids.d.ts.map +1 -0
  266. package/dist/step-internal-pset-ids.js +25 -0
  267. package/dist/step-internal-pset-ids.js.map +1 -0
  268. package/dist/step-map-unit-normalization.d.ts.map +1 -1
  269. package/dist/step-map-unit-normalization.js +10 -3
  270. package/dist/step-map-unit-normalization.js.map +1 -1
  271. package/dist/step-map-unit.d.ts +8 -1
  272. package/dist/step-map-unit.d.ts.map +1 -1
  273. package/dist/step-map-unit.js +13 -5
  274. package/dist/step-map-unit.js.map +1 -1
  275. package/dist/step-native-set-record.d.ts +2 -0
  276. package/dist/step-native-set-record.d.ts.map +1 -1
  277. package/dist/step-native-set-record.js +10 -0
  278. package/dist/step-native-set-record.js.map +1 -1
  279. package/dist/step-omission-predicates.d.ts.map +1 -1
  280. package/dist/step-omission-predicates.js +1 -0
  281. package/dist/step-omission-predicates.js.map +1 -1
  282. package/dist/step-overlay-entities.d.ts +0 -35
  283. package/dist/step-overlay-entities.d.ts.map +1 -1
  284. package/dist/step-overlay-entities.js +40 -4
  285. package/dist/step-overlay-entities.js.map +1 -1
  286. package/dist/step-overlay-property-base.d.ts +13 -0
  287. package/dist/step-overlay-property-base.d.ts.map +1 -0
  288. package/dist/step-overlay-property-base.js +30 -0
  289. package/dist/step-overlay-property-base.js.map +1 -0
  290. package/dist/step-pass-builder.d.ts.map +1 -1
  291. package/dist/step-pass-builder.js +13 -0
  292. package/dist/step-pass-builder.js.map +1 -1
  293. package/dist/step-property-set-collection.d.ts.map +1 -1
  294. package/dist/step-property-set-collection.js +7 -2
  295. package/dist/step-property-set-collection.js.map +1 -1
  296. package/dist/step-property-set-generators.d.ts.map +1 -1
  297. package/dist/step-property-set-generators.js +8 -4
  298. package/dist/step-property-set-generators.js.map +1 -1
  299. package/dist/step-property-set-index.js +1 -1
  300. package/dist/step-property-set-index.js.map +1 -1
  301. package/dist/step-property-set-readers.d.ts.map +1 -1
  302. package/dist/step-property-set-readers.js +6 -5
  303. package/dist/step-property-set-readers.js.map +1 -1
  304. package/dist/step-pset-copy-on-write.d.ts.map +1 -1
  305. package/dist/step-pset-copy-on-write.js +9 -7
  306. package/dist/step-pset-copy-on-write.js.map +1 -1
  307. package/dist/step-record-frame.d.ts +5 -3
  308. package/dist/step-record-frame.d.ts.map +1 -1
  309. package/dist/step-record-frame.js +12 -8
  310. package/dist/step-record-frame.js.map +1 -1
  311. package/dist/step-ref-scan.d.ts +7 -0
  312. package/dist/step-ref-scan.d.ts.map +1 -1
  313. package/dist/step-ref-scan.js +24 -3
  314. package/dist/step-ref-scan.js.map +1 -1
  315. package/dist/step-serialization.d.ts +13 -1
  316. package/dist/step-serialization.d.ts.map +1 -1
  317. package/dist/step-serialization.js +29 -2
  318. package/dist/step-serialization.js.map +1 -1
  319. package/dist/step-shared-atom-retention.js +1 -1
  320. package/dist/step-shared-atom-retention.js.map +1 -1
  321. package/dist/step-slot-grammar.d.ts +2 -0
  322. package/dist/step-slot-grammar.d.ts.map +1 -1
  323. package/dist/step-slot-grammar.js +5 -0
  324. package/dist/step-slot-grammar.js.map +1 -1
  325. package/dist/step-source-iteration.d.ts.map +1 -1
  326. package/dist/step-source-iteration.js +7 -2
  327. package/dist/step-source-iteration.js.map +1 -1
  328. package/dist/subset-entity-reader.d.ts.map +1 -1
  329. package/dist/subset-entity-reader.js +15 -8
  330. package/dist/subset-entity-reader.js.map +1 -1
  331. package/dist/subset-roots.d.ts +4 -14
  332. package/dist/subset-roots.d.ts.map +1 -1
  333. package/dist/subset-roots.js +14 -4
  334. package/dist/subset-roots.js.map +1 -1
  335. package/dist/unit-normalize.d.ts.map +1 -1
  336. package/dist/unit-normalize.js +4 -3
  337. package/dist/unit-normalize.js.map +1 -1
  338. package/dist/viewer-georef-scale.d.ts +14 -0
  339. package/dist/viewer-georef-scale.d.ts.map +1 -0
  340. package/dist/viewer-georef-scale.js +20 -0
  341. package/dist/viewer-georef-scale.js.map +1 -0
  342. package/package.json +43 -10
@@ -0,0 +1,50 @@
1
+ import type { SourceRecords, StructuralRewrite } from './schema-converter-structural-source.js';
2
+ /** Why the downgrade refuses a file: a record it does not convert names a configuration it converts, or a record it passes through as it is names any configuration. */
3
+ export declare const SHARED_CONFIGURATION = "IFCSTRUCTURALLOADCONFIGURATION shared with a non-converted referrer has no representation in IFC2X3";
4
+ /** The IFC4 action an IFC2X3 varying action converts to. */
5
+ export declare const varyingTarget: (ifc2x3: string) => string | undefined;
6
+ /**
7
+ * Converts varying actions in both directions, and only those that convert
8
+ * back: one test (`convertible`) decides both, so a configuration this writes
9
+ * on the way up is one the way down consumes. It reads the source store (the
10
+ * shape aspects, the load types and, on the way down, the configurations) and
11
+ * takes fresh express ids on the way up, so only an unedited full export arms it.
12
+ */
13
+ export declare class StructuralVarying {
14
+ /** The exporter's express-id allocator, shared with every other record it appends. */
15
+ ids: (() => number) | null;
16
+ private readonly pending;
17
+ private mode;
18
+ private source?;
19
+ /** IFC4 IfcStructuralLoadConfiguration id -> its values. */
20
+ private readonly configs;
21
+ /** IfcProductDefinitionShape id -> the IfcShapeAspects naming it as PartOfProductDefinitionShape. */
22
+ private readonly aspects;
23
+ fromSource(source: SourceRecords, from: string, to: string): void;
24
+ /** Rust scan_ifc4 keeps configurations referenced by any record that is not converted.
25
+ * They have no IFC2X3 form, so refuse the export instead of silently proxying a referrer.
26
+ */
27
+ private checkSharedConfigurations;
28
+ /** The target record body for a varying action of either schema, or undefined. */
29
+ rewrite(id: number, entity: string, args: readonly string[], carried: ReadonlySet<string>): StructuralRewrite | undefined;
30
+ /** IfcStructuralLoadConfiguration records written so far, to append after the source records. */
31
+ added(): string[];
32
+ /**
33
+ * The shape aspect locating `loads` when both schemas hold the action: the
34
+ * one aspect of its representation (and `location`, when IFC2X3 names one),
35
+ * enough loads, all of one type that the IFC2X3 WR61 admits.
36
+ */
37
+ private convertible;
38
+ /**
39
+ * IFC2X3 -> IFC4, when this prepass is armed: whether this IFC2X3 varying
40
+ * action stays unconverted (no IFC4 entity holds it then). False when unarmed.
41
+ */
42
+ staysUnconverted(entity: string, args: readonly string[]): boolean;
43
+ /** Armed for IFC2X3 -> IFC4, with the exporter's id allocator. */
44
+ private get upgrading();
45
+ /** The kind and loads of an IFC2X3 varying action `toIfc4` converts, or undefined. */
46
+ private upgradeLoads;
47
+ private toIfc4;
48
+ private toIfc2x3;
49
+ }
50
+ //# sourceMappingURL=schema-converter-structural-varying.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-converter-structural-varying.d.ts","sourceRoot":"","sources":["../src/schema-converter-structural-varying.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAqBhG,wKAAwK;AACxK,eAAO,MAAM,oBAAoB,wGAAwG,CAAC;AAO1I,4DAA4D;AAC5D,eAAO,MAAM,aAAa,GAAI,QAAQ,MAAM,KAAG,MAAM,GAAG,SAAyD,CAAC;AAElH;;;;;;GAMG;AACH,qBAAa,iBAAiB;IAC5B,sFAAsF;IACtF,GAAG,EAAE,CAAC,MAAM,MAAM,CAAC,GAAG,IAAI,CAAQ;IAClC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgB;IACxC,OAAO,CAAC,IAAI,CAAwC;IACpD,OAAO,CAAC,MAAM,CAAC,CAAgB;IAC/B,4DAA4D;IAC5D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA+B;IACvD,qGAAqG;IACrG,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgE;IAExF,UAAU,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI;IAwBjE;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAmBjC,kFAAkF;IAClF,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,iBAAiB,GAAG,SAAS;IAIzH,iGAAiG;IACjG,KAAK,IAAI,MAAM,EAAE;IAEjB;;;;OAIG;IACH,OAAO,CAAC,WAAW;IAQnB;;;OAGG;IACH,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO;IAIlE,kEAAkE;IAClE,OAAO,KAAK,SAAS,GAA6D;IAElF,sFAAsF;IACtF,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,MAAM;IAYd,OAAO,CAAC,QAAQ;CAiBjB"}
@@ -0,0 +1,170 @@
1
+ /* SPDX-License-Identifier: MPL-2.0 */
2
+ /** Matches rust/export/src/schema_structural_varying.rs (#9668). */
3
+ import { destabilizingUnknown } from './schema-converter-structural.js';
4
+ import { listItems } from './schema-converter-structural-axes.js';
5
+ import { refId } from './schema-ifc2x3-records.js';
6
+ import { holdsValue, withoutComments } from './step-comment-skip.js';
7
+ import { referencesAnyExpressId } from './step-ref-scan.js';
8
+ /**
9
+ * IFC2X3's varying actions and the IFC4 actions they become. IFC4 dropped
10
+ * IfcStructuralLinearActionVarying and IfcStructuralPlanarActionVarying
11
+ * (IFC2X3_TC1.exp:7312, :7427). It holds several load values as an
12
+ * IfcStructuralCurveAction or IfcStructuralSurfaceAction whose AppliedLoad is an
13
+ * IfcStructuralLoadConfiguration (IFC4_ADD2_TC1.exp:9399, :9625, :9470).
14
+ * `first` is what the IFC2X3 supertype's WR61 admits as AppliedLoad
15
+ * (IFC2X3_TC1.exp:7301 and IfcStructuralPlanarAction); both directions take
16
+ * only loads that all share one of those types. `min` is the size of
17
+ * VaryingAppliedLoads (LIST [2:?] linear, [3:?] planar). `spread` is the IFC4
18
+ * PredefinedTypes a downgrade takes: values at locations, linear in between
19
+ * (IFC4_ADD2_TC1.exp:2308, :2330), which is what the IFC2X3 varying action holds.
20
+ * SINUS, PARABOLA, DISCRETE, ISOCONTOUR and the rest keep their previous handling.
21
+ */
22
+ const KINDS = [
23
+ { ifc2x3: 'IFCSTRUCTURALLINEARACTIONVARYING', ifc4: 'IFCSTRUCTURALCURVEACTION', first: ['IFCSTRUCTURALLOADLINEARFORCE', 'IFCSTRUCTURALLOADTEMPERATURE'], min: 2, spread: ['.NOTDEFINED.', '.LINEAR.', '.POLYGONAL.'] },
24
+ { ifc2x3: 'IFCSTRUCTURALPLANARACTIONVARYING', ifc4: 'IFCSTRUCTURALSURFACEACTION', first: ['IFCSTRUCTURALLOADPLANARFORCE', 'IFCSTRUCTURALLOADTEMPERATURE'], min: 3, spread: ['.NOTDEFINED.', '.BILINEAR.'] },
25
+ ];
26
+ /** Why the downgrade refuses a file: a record it does not convert names a configuration it converts, or a record it passes through as it is names any configuration. */
27
+ export const SHARED_CONFIGURATION = 'IFCSTRUCTURALLOADCONFIGURATION shared with a non-converted referrer has no representation in IFC2X3';
28
+ const FROM_IFC2X3 = 'an IFC2X3 varying action is written as an IFC4 curve or surface action with PredefinedType NOTDEFINED and an IfcStructuralLoadConfiguration holding its loads without Locations; the IfcShapeAspect of its representation keeps the locations';
29
+ const TO_IFC2X3 = 'an IFC4 curve or surface action with an IfcStructuralLoadConfiguration is written as an IFC2X3 varying action, its locations taken from the one IfcShapeAspect of its representation; the configuration Name, Locations and the action PredefinedType have no slot in IFC2X3';
30
+ /** The IFC4 action an IFC2X3 varying action converts to. */
31
+ export const varyingTarget = (ifc2x3) => KINDS.find((k) => k.ifc2x3 === ifc2x3)?.ifc4;
32
+ /**
33
+ * Converts varying actions in both directions, and only those that convert
34
+ * back: one test (`convertible`) decides both, so a configuration this writes
35
+ * on the way up is one the way down consumes. It reads the source store (the
36
+ * shape aspects, the load types and, on the way down, the configurations) and
37
+ * takes fresh express ids on the way up, so only an unedited full export arms it.
38
+ */
39
+ export class StructuralVarying {
40
+ /** The exporter's express-id allocator, shared with every other record it appends. */
41
+ ids = null;
42
+ pending = [];
43
+ mode = null;
44
+ source;
45
+ /** IFC4 IfcStructuralLoadConfiguration id -> its values. */
46
+ configs = new Map();
47
+ /** IfcProductDefinitionShape id -> the IfcShapeAspects naming it as PartOfProductDefinitionShape. */
48
+ aspects = new Map();
49
+ fromSource(source, from, to) {
50
+ const mode = from === 'IFC2X3' && to === 'IFC4' ? 'upgrade' : from === 'IFC4' && to === 'IFC2X3' ? 'downgrade' : null;
51
+ const present = (types) => types.some((type) => source.ids(type).length > 0);
52
+ const work = mode === 'upgrade' ? present(KINDS.map((k) => k.ifc2x3))
53
+ // With no action to convert, a downgrade still checks what names a configuration.
54
+ : mode === 'downgrade' && present(['IFCSTRUCTURALLOADCONFIGURATION']);
55
+ if (!work)
56
+ return;
57
+ for (const id of source.ids('IFCSHAPEASPECT')) {
58
+ const args = source.slots(id);
59
+ const shape = refId(args?.[4]);
60
+ if (shape === null)
61
+ continue;
62
+ const list = this.aspects.get(shape) ?? [];
63
+ list.push({ id, representations: listItems(args?.[0] ?? '')?.length ?? -1 });
64
+ this.aspects.set(shape, list);
65
+ }
66
+ for (const id of mode === 'downgrade' ? source.ids('IFCSTRUCTURALLOADCONFIGURATION') : []) {
67
+ const values = listItems(source.slots(id)?.[1] ?? '')?.map(refId);
68
+ if (values?.length && values.every((v) => v !== null))
69
+ this.configs.set(id, values);
70
+ }
71
+ this.mode = mode;
72
+ this.source = source;
73
+ if (mode === 'downgrade')
74
+ this.checkSharedConfigurations(source);
75
+ }
76
+ /** Rust scan_ifc4 keeps configurations referenced by any record that is not converted.
77
+ * They have no IFC2X3 form, so refuse the export instead of silently proxying a referrer.
78
+ */
79
+ checkSharedConfigurations(source) {
80
+ const candidates = new Set();
81
+ const consumed = new Set();
82
+ const configs = new Set(this.configs.keys());
83
+ for (const { ifc4 } of KINDS) {
84
+ for (const id of source.ids(ifc4)) {
85
+ const args = source.slots(id);
86
+ if (!args || args.some((a, i) => i !== 7 && referencesAnyExpressId(a, configs)))
87
+ continue;
88
+ if (this.toIfc2x3(id, ifc4, args)) {
89
+ candidates.add(id);
90
+ consumed.add(refId(args[7]));
91
+ }
92
+ }
93
+ }
94
+ for (const { id } of source.naming(consumed)) {
95
+ if (!candidates.has(id))
96
+ throw new Error(SHARED_CONFIGURATION);
97
+ }
98
+ }
99
+ /** The target record body for a varying action of either schema, or undefined. */
100
+ rewrite(id, entity, args, carried) {
101
+ return this.mode === 'upgrade' ? this.toIfc4(entity, args, carried) : this.mode === 'downgrade' ? this.toIfc2x3(id, entity, args) : undefined;
102
+ }
103
+ /** IfcStructuralLoadConfiguration records written so far, to append after the source records. */
104
+ added() { return this.pending.splice(0); }
105
+ /**
106
+ * The shape aspect locating `loads` when both schemas hold the action: the
107
+ * one aspect of its representation (and `location`, when IFC2X3 names one),
108
+ * enough loads, all of one type that the IFC2X3 WR61 admits.
109
+ */
110
+ convertible(kind, representation, loads, location) {
111
+ const found = this.aspects.get(refId(representation) ?? -1);
112
+ if (found?.length !== 1 || (location !== undefined && found[0].id !== location) || loads.length < kind.min || found[0].representations !== loads.length)
113
+ return undefined;
114
+ const type = this.source?.type(loads[0]) ?? '';
115
+ const first = kind.first;
116
+ return first.includes(type) && loads.every((l) => this.source?.type(l) === type) ? found[0].id : undefined;
117
+ }
118
+ /**
119
+ * IFC2X3 -> IFC4, when this prepass is armed: whether this IFC2X3 varying
120
+ * action stays unconverted (no IFC4 entity holds it then). False when unarmed.
121
+ */
122
+ staysUnconverted(entity, args) {
123
+ return this.upgrading && KINDS.some((k) => k.ifc2x3 === entity) && !this.upgradeLoads(entity, args);
124
+ }
125
+ /** Armed for IFC2X3 -> IFC4, with the exporter's id allocator. */
126
+ get upgrading() { return this.mode === 'upgrade' && !!this.ids; }
127
+ /** The kind and loads of an IFC2X3 varying action `toIfc4` converts, or undefined. */
128
+ upgradeLoads(entity, args) {
129
+ const kind = KINDS.find((k) => k.ifc2x3 === entity);
130
+ if (!this.upgrading || !kind || args.length !== 14)
131
+ return undefined;
132
+ const loads = [args[7], ...(listItems(args[13]) ?? [])].map(refId);
133
+ return this.convertible(kind, args[6], loads, refId(args[12])) === undefined ? undefined : { kind, loads };
134
+ }
135
+ toIfc4(entity, args, carried) {
136
+ const found = this.upgradeLoads(entity, args);
137
+ if (!found)
138
+ return undefined;
139
+ const { kind, loads } = found;
140
+ const id = this.ids();
141
+ this.pending.push(`#${id}=IFCSTRUCTURALLOADCONFIGURATION($,(${loads.map((l) => `#${l}`).join(',')}),$);`);
142
+ const losses = [FROM_IFC2X3];
143
+ // A CausedBy IFC4 holds as a 'Causes' relationship (`StructuralCarriers.noteCause`) is not lost.
144
+ if (holdsValue(args[10]) && !carried.has('CausedBy'))
145
+ losses.push(`${entity}.CausedBy has no slot in IFC4; its value is omitted`);
146
+ return { body: `${kind.ifc4}(${[...args.slice(0, 7), `#${id}`, args[8], args[9], args[11], '.NOTDEFINED.'].join(',')})`, losses };
147
+ }
148
+ toIfc2x3(id, entity, args) {
149
+ const kind = KINDS.find((k) => k.ifc4 === entity);
150
+ if (!kind || args.length !== 12)
151
+ return undefined;
152
+ const predefined = args[11].trim().toUpperCase();
153
+ if (!kind.spread.includes(predefined))
154
+ return undefined;
155
+ const config = refId(args[7]) ?? -1;
156
+ const values = this.configs.get(config);
157
+ if (!values)
158
+ return undefined;
159
+ const aspect = this.convertible(kind, args[6], values);
160
+ if (aspect === undefined)
161
+ return undefined;
162
+ const [first, ...rest] = values.map((v) => `#${v}`);
163
+ // `inspect` reports this for the records it sees; a rewritten one skips it.
164
+ const losses = [TO_IFC2X3, ...(withoutComments(args[9]) === '$' ? [destabilizingUnknown(entity)] : [])];
165
+ // The upgrade writes the same loads and PredefinedType NOTDEFINED (`toIfc4`).
166
+ const restored = [[config, ['Values']], ...(predefined === '.NOTDEFINED.' ? [[id, ['PredefinedType']]] : [])];
167
+ return { body: `${kind.ifc2x3}(${[...args.slice(0, 7), first, args[8], args[9], '$', args[10], `#${aspect}`, `(${rest.join(',')})`].join(',')})`, losses, restored };
168
+ }
169
+ }
170
+ //# sourceMappingURL=schema-converter-structural-varying.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-converter-structural-varying.js","sourceRoot":"","sources":["../src/schema-converter-structural-varying.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,oEAAoE;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,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IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;QACvD,IAAI,MAAM,KAAK,SAAS;YAAE,OAAO,SAAS,CAAC;QAC3C,MAAM,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACpD,4EAA4E;QAC5E,MAAM,MAAM,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACxG,8EAA8E;QAC9E,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,CAAU,EAAE,GAAG,CAAC,UAAU,KAAK,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,gBAAgB,CAAC,CAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAChI,OAAO,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,CAAC,EAAE,IAAI,MAAM,EAAE,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;IACvK,CAAC;CACF"}
@@ -0,0 +1,8 @@
1
+ /** IFC2X3's stiffness fields keep their position and units in IFC4 and IFC4X3. */
2
+ export declare function isStructuralStiffnessConversion(entity: string, from: string, to: string): boolean;
3
+ /** The loss reported when IFC2X3's required DestabilizingLoad is written as .F. for an unknown value. */
4
+ export declare const destabilizingUnknown: (entity: string) => string;
5
+ /** One target policy shared by rewriting, preview and diagnostics. */
6
+ export declare function isStructuralAssignmentConversion(entity: string, from: string, to: string): boolean;
7
+ export declare function structuralAttributes(entity: string, args: readonly string[], from: string, to: string): string | null;
8
+ //# sourceMappingURL=schema-converter-structural.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-converter-structural.d.ts","sourceRoot":"","sources":["../src/schema-converter-structural.ts"],"names":[],"mappings":"AAuBA,kFAAkF;AAClF,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAGjG;AAED,yGAAyG;AACzG,eAAO,MAAM,oBAAoB,GAAI,QAAQ,MAAM,KAAG,MAA4G,CAAC;AAEnK,sEAAsE;AACtE,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAElG;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAiCrH"}
@@ -0,0 +1,81 @@
1
+ /* SPDX-License-Identifier: MPL-2.0 */
2
+ /** Browser adapter for rust/export/src/schema_structural.rs (#9668). */
3
+ import { parseStepNumber, skipStepTrivia } from './step-slot-grammar.js';
4
+ import { readStepSlots } from './step-argument-parser.js';
5
+ import { getSchemaRegistryForVersion } from '@ifc-lite/parser';
6
+ function scalarEquals(token, value) {
7
+ const start = skipStepTrivia(token, 0);
8
+ return start >= 0 && token.slice(start, start + value.length).toUpperCase() === value.toUpperCase()
9
+ && skipStepTrivia(token, start + value.length) === token.length;
10
+ }
11
+ function stiffnessType(entity, index) {
12
+ if (entity === 'IFCBOUNDARYNODECONDITIONWARPING' && index === 7)
13
+ return 'IFCWARPINGMOMENTMEASURE';
14
+ if (index < 1 || index > 6)
15
+ return null;
16
+ if (entity === 'IFCBOUNDARYNODECONDITION' || entity === 'IFCBOUNDARYNODECONDITIONWARPING')
17
+ return index <= 3 ? 'IFCLINEARSTIFFNESSMEASURE' : 'IFCROTATIONALSTIFFNESSMEASURE';
18
+ if (entity === 'IFCBOUNDARYEDGECONDITION')
19
+ return index <= 3 ? 'IFCMODULUSOFLINEARSUBGRADEREACTIONMEASURE' : 'IFCMODULUSOFROTATIONALSUBGRADEREACTIONMEASURE';
20
+ if (entity === 'IFCBOUNDARYFACECONDITION' && index <= 3)
21
+ return 'IFCMODULUSOFSUBGRADEREACTIONMEASURE';
22
+ return null;
23
+ }
24
+ /** IFC2X3's stiffness fields keep their position and units in IFC4 and IFC4X3. */
25
+ export function isStructuralStiffnessConversion(entity, from, to) {
26
+ const other = from === 'IFC2X3' ? to : to === 'IFC2X3' ? from : undefined;
27
+ return (other === 'IFC4' || other === 'IFC4X3') && stiffnessType(entity, 1) !== null;
28
+ }
29
+ /** The loss reported when IFC2X3's required DestabilizingLoad is written as .F. for an unknown value. */
30
+ export const destabilizingUnknown = (entity) => `${entity}.DestabilizingLoad is unknown; IFC2X3 requires a boolean, so the writer substitutes .F.`;
31
+ /** One target policy shared by rewriting, preview and diagnostics. */
32
+ export function isStructuralAssignmentConversion(entity, from, to) {
33
+ return entity === 'IFCRELCONNECTSSTRUCTURALELEMENT' && from === 'IFC2X3' && ['IFC4', 'IFC4X3', 'IFC5'].includes(to);
34
+ }
35
+ export function structuralAttributes(entity, args, from, to) {
36
+ if (isStructuralAssignmentConversion(entity, from, to) && args.length === 6) {
37
+ // IFC4's analytical assignment retains both objects, but changes relationship kind.
38
+ return `${args.slice(0, 4).join(',')},(${args[5]}),$,${args[4]}`;
39
+ }
40
+ if (isStructuralStiffnessConversion(entity, from, to)) {
41
+ const values = [...args];
42
+ for (let i = 1; i < values.length; i++) {
43
+ const measure = stiffnessType(entity, i), token = values[i].trim();
44
+ if (!measure || scalarEquals(token, '$'))
45
+ continue;
46
+ if (from === 'IFC2X3') {
47
+ // IFC2X3's -1 sentinel means rigid. Zero retains its measure encoding.
48
+ values[i] = parseStepNumber(token) === -1 ? 'IFCBOOLEAN(.T.)' : `${measure}(${token})`;
49
+ }
50
+ else {
51
+ const typed = readStepSlots(`#0=${token};`);
52
+ if (!typed || typed.slots.length !== 1)
53
+ return null;
54
+ if (typed.type === 'IFCBOOLEAN') {
55
+ if (scalarEquals(typed.slots[0], '.T.'))
56
+ values[i] = '-1.';
57
+ else if (scalarEquals(typed.slots[0], '.F.'))
58
+ values[i] = '0.';
59
+ else
60
+ return null;
61
+ }
62
+ else if (typed.type === measure)
63
+ values[i] = typed.slots[0];
64
+ else
65
+ return null;
66
+ }
67
+ }
68
+ return values.join(',');
69
+ }
70
+ if (!((from === 'IFC2X3' && to === 'IFC4') || (from === 'IFC4' && to === 'IFC2X3')))
71
+ return null;
72
+ if (entity !== 'IFCSTRUCTURALLINEARACTION' && entity !== 'IFCSTRUCTURALPLANARACTION')
73
+ return null;
74
+ const name = entity === 'IFCSTRUCTURALLINEARACTION' ? 'IfcStructuralLinearAction' : 'IfcStructuralPlanarAction';
75
+ const slots = (schema) => getSchemaRegistryForVersion(schema).entities[name]?.allAttributes?.map(a => a.name);
76
+ const src = slots(from), tgt = slots(to);
77
+ if (!src || !tgt)
78
+ return null;
79
+ return tgt.map(name => args[src.indexOf(name)] ?? (name === 'PredefinedType' ? '.CONST.' : '$')).join(',');
80
+ }
81
+ //# sourceMappingURL=schema-converter-structural.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-converter-structural.js","sourceRoot":"","sources":["../src/schema-converter-structural.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,wEAAwE;AACxE,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACzE,OA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AAK,MAAM,IAAI,EAAE,KAAK,QAAQ,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IACjG,IAAI,MAAM,KAAK,2BAA2B,IAAI,MAAM,KAAK,2BAA2B;QAAE,OAAO,IAAI,CAAC;IAClG,MAAM,IAAI,GAAG,MAAM,KAAK,2BAA2B,CAAC,CAAC,CAAC,2BAA2B,CAAC,CAAC,CAAC,2BAA2B,CAAC;IAChH,MAAM,KAAK,GAAG,CAAC,MAAyB,EAAE,EAAE,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,aAAa,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACjI,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC;IACzC,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;IAC9B,OAAO,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,gBAAgB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7G,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { type IfcSchemaVersion } from './schema-converter.js';
2
+ /** True when `slot` is `token` (any case) with only whitespace and comments around it. */
3
+ export declare function isToken(slot: string | undefined, token: string): boolean;
4
+ /** No value: `$`, `*` or nothing, comments aside. A missing slot is not unset. */
5
+ export declare const isUnset: (slot: string | undefined) => boolean;
6
+ /** `converted`, written from `source` between the schemas, with the label carried. */
7
+ export declare function carryUserDefinedLabel(source: string, converted: string | null, fromSchema: IfcSchemaVersion, toSchema: IfcSchemaVersion): string | null;
8
+ //# sourceMappingURL=schema-converter-userdefined-label.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-converter-userdefined-label.d.ts","sourceRoot":"","sources":["../src/schema-converter-userdefined-label.ts"],"names":[],"mappings":"AAcA,OAAO,EAAiB,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAO7E,0FAA0F;AAC1F,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAIxE;AAED,kFAAkF;AAClF,eAAO,MAAM,OAAO,GAAI,MAAM,MAAM,GAAG,SAAS,YAC0C,CAAC;AAE3F,sFAAsF;AACtF,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,EAAE,UAAU,EAAE,gBAAgB,EAAE,QAAQ,EAAE,gBAAgB,GAAG,MAAM,GAAG,IAAI,CA0BvJ"}
@@ -0,0 +1,60 @@
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
+ * The label of a `.USERDEFINED.` type across IFC2X3 and IFC4 (#10824).
6
+ * IFC2X3 kept it in a type-specific attribute (`UserDefinedControlType`,
7
+ * `UserDefinedProcedureType`, `UserDefinedFunction`); IFC4 keeps it in
8
+ * `ObjectType`. An upgrade writes the IFC2X3 label into an unset `ObjectType`;
9
+ * a downgrade writes `ObjectType` into the unset IFC2X3 label. A set
10
+ * `ObjectType` is kept. Twin of Rust `schema_userdefined_label.rs`.
11
+ */
12
+ import { LABEL_CARRIES } from './schema-enum-policy.js';
13
+ import { attrNameTable } from './schema-converter.js';
14
+ import { readStepSlots } from './step-argument-parser.js';
15
+ import { skipStepTrivia } from './step-slot-grammar.js';
16
+ import { stepRecordHead } from './step-record-frame.js';
17
+ const ifc4Like = (s) => s === 'IFC4' || s === 'IFC4X3';
18
+ /** True when `slot` is `token` (any case) with only whitespace and comments around it. */
19
+ export function isToken(slot, token) {
20
+ const start = slot === undefined ? -1 : skipStepTrivia(slot, 0);
21
+ return start !== -1 && slot.slice(start, start + token.length).toUpperCase() === token
22
+ && skipStepTrivia(slot, start + token.length) === slot.length;
23
+ }
24
+ /** No value: `$`, `*` or nothing, comments aside. A missing slot is not unset. */
25
+ export const isUnset = (slot) => slot !== undefined
26
+ && (isToken(slot, '$') || isToken(slot, '*') || skipStepTrivia(slot, 0) === slot.length);
27
+ /** `converted`, written from `source` between the schemas, with the label carried. */
28
+ export function carryUserDefinedLabel(source, converted, fromSchema, toSchema) {
29
+ const up = fromSchema === 'IFC2X3' && ifc4Like(toSchema);
30
+ if (converted === null || (!up && !(toSchema === 'IFC2X3' && ifc4Like(fromSchema))))
31
+ return converted;
32
+ // The head names the type; most records stop here.
33
+ const head = stepRecordHead(converted);
34
+ const type = head ? converted.slice(head.typeStart, head.typeEnd).toUpperCase() : '';
35
+ const carry = LABEL_CARRIES.find((c) => type === (up ? c[1] : c[0]));
36
+ const record = carry ? readStepSlots(converted) : null;
37
+ if (!carry || !record)
38
+ return converted;
39
+ const [ifc2x3, ifc4, kind, label] = carry;
40
+ const at = (schema, t, name) => attrNameTable(schema)?.get(t)?.indexOf(name) ?? -1;
41
+ const out = [...record.slots];
42
+ if (up) {
43
+ const ot = at(toSchema, ifc4, 'ObjectType');
44
+ // `convertRecord` also accepts a record without its ';'.
45
+ const src = (readStepSlots(source) ?? readStepSlots(`${source};`))?.slots;
46
+ const value = src?.[at(fromSchema, ifc2x3, label)];
47
+ if (!src || !isToken(src[at(fromSchema, ifc2x3, kind)], '.USERDEFINED.') || value === undefined || isUnset(value) || !isUnset(out[ot]))
48
+ return converted;
49
+ out[ot] = value;
50
+ }
51
+ else {
52
+ const ot = at(toSchema, ifc2x3, 'ObjectType');
53
+ const l = at(toSchema, ifc2x3, label);
54
+ if (!isToken(out[at(toSchema, ifc2x3, kind)], '.USERDEFINED.') || !isUnset(out[l]) || out[ot] === undefined || isUnset(out[ot]))
55
+ return converted;
56
+ out[l] = out[ot];
57
+ }
58
+ return `${record.prefix}${out.join(',')}${record.suffix}`;
59
+ }
60
+ //# sourceMappingURL=schema-converter-userdefined-label.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-converter-userdefined-label.js","sourceRoot":"","sources":["../src/schema-converter-userdefined-label.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;GAOG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAyB,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,CAAC,CAAmB,EAAE,EAAE,CAAC,CAAC,KAAK,MAAM,IAAI,CAAC,KAAK,QAAQ,CAAC;AAEzE,0FAA0F;AAC1F,MAAM,UAAU,OAAO,CAAC,IAAwB,EAAE,KAAa;IAC7D,MAAM,KAAK,GAAG,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAChE,OAAO,KAAK,KAAK,CAAC,CAAC,IAAI,IAAK,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,KAAK,KAAK;WAClF,cAAc,CAAC,IAAK,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,IAAK,CAAC,MAAM,CAAC;AACpE,CAAC;AAED,kFAAkF;AAClF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,IAAwB,EAAE,EAAE,CAAC,IAAI,KAAK,SAAS;OAClE,CAAC,OAAO,CAAC,IAAI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CAAC,KAAK,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAAE,OAAO,SAAS,CAAC;QAClJ,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC;IACnB,CAAC;IACD,OAAO,GAAG,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;AAC5D,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The `.USERDEFINED.` rule of a PredefinedType (#10780): IFC4's
3
+ * `CorrectPredefinedType` (and many IFC2X3 WHERE rules) allow `.USERDEFINED.`
4
+ * only with the entity's label attribute set. A converted record that breaks
5
+ * it is reported, not repaired: the converter does not invent a label.
6
+ * Every non-abstract entity with both attributes has the rule except the
7
+ * {@link EXEMPT_AT} ones. Twin of Rust `schema_userdefined.rs`; both are held
8
+ * to `rust/export/tests/fixtures/schema_userdefined_rules.json`.
9
+ */
10
+ import type { SchemaVersionWithRegistry } from '@ifc-lite/parser';
11
+ /** `[enum index, label index]` when `entityType` has the rule in `schema`. */
12
+ export declare function userDefinedRule(schema: SchemaVersionWithRegistry, entityType: string): readonly [number, number] | undefined;
13
+ /** True when converted `args` under `rule` say `.USERDEFINED.` and leave the label unset. */
14
+ export declare function breaksUserDefinedRule(args: readonly string[], [predefined, label]: readonly [number, number]): boolean;
15
+ //# sourceMappingURL=schema-converter-userdefined.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-converter-userdefined.d.ts","sourceRoot":"","sources":["../src/schema-converter-userdefined.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AA0ClE,8EAA8E;AAC9E,wBAAgB,eAAe,CAAC,MAAM,EAAE,yBAAyB,EAAE,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAW5H;AAED,6FAA6F;AAC7F,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,CAAC,UAAU,EAAE,KAAK,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAItH"}
@@ -0,0 +1,59 @@
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 { attrNameTable } from './schema-converter.js';
5
+ import { LABEL_CARRIES } from './schema-enum-policy.js';
6
+ import { isToken, isUnset } from './schema-converter-userdefined-label.js';
7
+ const LABELS = ['ObjectType', 'ElementType', 'ProcessType', 'ResourceType'];
8
+ /**
9
+ * The entities with both attributes but no USERDEFINED rule, per schema, as
10
+ * base-36 positions in that schema's {@link candidates} (every registry entity
11
+ * with both attributes, abstract ones included). The viewer loads this module
12
+ * eagerly, and the names would cost about 1.8 KB (#10780 perf ratchet); the
13
+ * Rust twin keeps the names. The test checks every candidate against the
14
+ * shared fixture's names and prints the encoding to paste here when a
15
+ * registry change moves a position.
16
+ */
17
+ const EXEMPT_AT = {
18
+ IFC2X3: '0 4 5 7 9 a d g j l m o s t u v w x 13 14 1a 1b 1c 1d 1e 1g 1k 1l 1m 1n 1q 1r 1s 1t 1v 1x 1y 1z 20 21 22 23 24 25 26 29 2a 2f 2g',
19
+ IFC4: '0 m 1o 1p 22 23 24 25 26 30 3j 3q 49 4a 4d 4e 4q 4r 7b 7c',
20
+ IFC4X3: '0 b c 1x 1y 2g 3g 41 4a 59 5a 5m 63',
21
+ };
22
+ /** True for an attribute list with PredefinedType and a label attribute. */
23
+ const candidate = (names) => names.includes('PredefinedType') && names.some((a) => LABELS.includes(a));
24
+ /** The entity names of `schema` that are {@link candidate}s, sorted. */
25
+ function candidates(schema) {
26
+ return [...(attrNameTable(schema) ?? [])].filter(([, n]) => candidate(n)).map(([t]) => t).sort();
27
+ }
28
+ const EXEMPT_SETS = new Map();
29
+ function exempt(schema) {
30
+ let set = EXEMPT_SETS.get(schema);
31
+ if (!set) {
32
+ const names = candidates(schema);
33
+ set = new Set(EXEMPT_AT[schema].split(' ').map((at) => names[parseInt(at, 36)]));
34
+ EXEMPT_SETS.set(schema, set);
35
+ }
36
+ return set;
37
+ }
38
+ /** `[enum index, label index]` when `entityType` has the rule in `schema`. */
39
+ export function userDefinedRule(schema, entityType) {
40
+ const names = attrNameTable(schema)?.get(entityType);
41
+ if (!names)
42
+ return undefined;
43
+ const pair = schema === 'IFC2X3' ? LABEL_CARRIES.find(([type]) => type === entityType) : undefined;
44
+ if (pair) {
45
+ const enumIndex = names.indexOf(pair[2]);
46
+ const labelIndex = names.indexOf(pair[3]);
47
+ return enumIndex >= 0 && labelIndex >= 0 ? [enumIndex, labelIndex] : undefined;
48
+ }
49
+ if (!candidate(names) || exempt(schema).has(entityType))
50
+ return undefined;
51
+ return [names.indexOf('PredefinedType'), names.findIndex((n) => LABELS.includes(n))];
52
+ }
53
+ /** True when converted `args` under `rule` say `.USERDEFINED.` and leave the label unset. */
54
+ export function breaksUserDefinedRule(args, [predefined, label]) {
55
+ return args.length > Math.max(predefined, label)
56
+ && isToken(args[predefined], '.USERDEFINED.')
57
+ && isUnset(args[label]);
58
+ }
59
+ //# sourceMappingURL=schema-converter-userdefined.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-converter-userdefined.js","sourceRoot":"","sources":["../src/schema-converter-userdefined.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAa/D,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,yCAAyC,CAAC;AAE3E,MAAM,MAAM,GAAsB,CAAC,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,CAAC,CAAC;AAE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,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,eAAe,CAAC;WAC1C,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;AAC5B,CAAC"}
@@ -0,0 +1,12 @@
1
+ /** Value-form reconciliation for one export: rewrites, and names what it dropped. */
2
+ export declare class ValueForms {
3
+ /** Per `TYPE.Attribute`: values dropped, and those that left a required slot `$`. */
4
+ private readonly dropped;
5
+ private readonly emptied;
6
+ /** `line`, already converted from `from` to `to`, with every slot in a form the target accepts. */
7
+ apply(line: string, from: string, to: string): string;
8
+ private count;
9
+ /** One warning per kind, naming every slot a value was dropped from (#10847). */
10
+ warnings(): string[];
11
+ }
12
+ //# sourceMappingURL=schema-converter-value-forms.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-converter-value-forms.d.ts","sourceRoot":"","sources":["../src/schema-converter-value-forms.ts"],"names":[],"mappings":"AAgJA,qFAAqF;AACrF,qBAAa,UAAU;IACrB,qFAAqF;IACrF,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA6B;IACrD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA6B;IAErD,mGAAmG;IACnG,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM;IAsCrD,OAAO,CAAC,KAAK;IAIb,iFAAiF;IACjF,QAAQ,IAAI,MAAM,EAAE;CAUrB"}