@ifc-lite/viewer 1.29.0 → 1.30.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 (80) hide show
  1. package/.turbo/turbo-build.log +32 -31
  2. package/CHANGELOG.md +58 -0
  3. package/dist/assets/{basketViewActivator-BSRgF1Hw.js → basketViewActivator-BHNb23Vw.js} +6 -6
  4. package/dist/assets/{bcf-3uE1MvcT.js → bcf-C0XZ2DSl.js} +1 -1
  5. package/dist/assets/{deflate-BLlUfw9-.js → deflate-DvvFcUtV.js} +1 -1
  6. package/dist/assets/{exporters-BL6UmxRa.js → exporters-CvORJOLn.js} +1345 -1434
  7. package/dist/assets/geometry.worker-B7X9DQQY.js +1 -0
  8. package/dist/assets/{geotiff-BydcIud8.js → geotiff-fSD_sVw_.js} +10 -10
  9. package/dist/assets/{ids-DFl74rTt.js → ids-BUOe5QQl.js} +951 -713
  10. package/dist/assets/idsValidation.worker-DEodXb0f.js +190468 -0
  11. package/dist/assets/ifc-lite_bg-CmMuB1zf.wasm +0 -0
  12. package/dist/assets/{index-BNTlm2lP.js → index-B6T42T86.js} +35235 -32937
  13. package/dist/assets/index-D0tqJL0X.css +1 -0
  14. package/dist/assets/{index.es-Bk4nLsyS.js → index.es-YGMensDM.js} +7 -7
  15. package/dist/assets/{jpeg-BvMO8-Tc.js → jpeg-0Sla88_N.js} +1 -1
  16. package/dist/assets/{jspdf.es.min-BZ_ed66E.js → jspdf.es.min-mnbLNj-p.js} +4 -4
  17. package/dist/assets/{lerc-CNnDpLpV.js → lerc-C7xUDHpL.js} +1 -1
  18. package/dist/assets/{lzw-DBaPrGGZ.js → lzw-CK480t0_.js} +1 -1
  19. package/dist/assets/{native-bridge-DFOoBvTg.js → native-bridge-sLWRanza.js} +1 -1
  20. package/dist/assets/{packbits-C7uyD2Bi.js → packbits-DcL4imYS.js} +1 -1
  21. package/dist/assets/parser.worker-BsGV6ml7.js +182 -0
  22. package/dist/assets/{pdf-DlqdjX9e.js → pdf-BARGfLmx.js} +8 -8
  23. package/dist/assets/raw-BMWh6mDy.js +1 -0
  24. package/dist/assets/{sandbox-0Z2NzeOJ.js → sandbox-BSiO04m8.js} +2801 -2609
  25. package/dist/assets/server-client-AlpWMVq9.js +741 -0
  26. package/dist/assets/{webimage-zN-oCabb.js → webimage-uy5DjZLk.js} +1 -1
  27. package/dist/assets/{xlsx-N2LbIR1G.js → xlsx-D02ho69_.js} +6 -6
  28. package/dist/assets/{zstd-Jk3QKIeb.js → zstd-DcR1TBwT.js} +1 -1
  29. package/dist/index.html +7 -7
  30. package/package.json +27 -32
  31. package/src/components/viewer/CesiumOverlay.tsx +195 -8
  32. package/src/components/viewer/IDSPanel.tsx +23 -7
  33. package/src/components/viewer/MainToolbar.tsx +31 -0
  34. package/src/components/viewer/SunSkyPanel.tsx +363 -0
  35. package/src/components/viewer/Viewport.tsx +49 -1
  36. package/src/components/viewer/ViewportContainer.tsx +20 -1
  37. package/src/components/viewer/useAnimationLoop.ts +19 -1
  38. package/src/disable-react-dev-perf-track.ts +38 -0
  39. package/src/hooks/has-entity-type.ts +33 -0
  40. package/src/hooks/ids/idsWorkerClient.ts +136 -0
  41. package/src/hooks/ingest/federationAlign.ts +1 -1
  42. package/src/hooks/ingest/pointCloudIngest.ts +22 -98
  43. package/src/hooks/ingest/viewerModelIngest.ts +8 -13
  44. package/src/hooks/useAlignmentLines3D.ts +5 -0
  45. package/src/hooks/useGridLines3D.ts +4 -0
  46. package/src/hooks/useIDS.ts +77 -13
  47. package/src/hooks/useIfcCache.ts +1 -1
  48. package/src/hooks/useIfcFederation.ts +1 -1
  49. package/src/hooks/useIfcServer.ts +1 -1
  50. package/src/hooks/useModelSelection.ts +1 -1
  51. package/src/hooks/useSolarEnvironment.ts +114 -0
  52. package/src/hooks/useSolarSweep.ts +66 -0
  53. package/src/hooks/useSymbolicAnnotations.ts +10 -0
  54. package/src/hooks/useViewerSelectors.ts +1 -1
  55. package/src/lib/geo/cesium-sun.ts +277 -0
  56. package/src/lib/geo/solar-direction.test.ts +70 -0
  57. package/src/lib/geo/solar-direction.ts +94 -0
  58. package/src/lib/lighting-presets.ts +128 -0
  59. package/src/lib/recent-files.ts +4 -24
  60. package/src/lib/solar-time.ts +55 -0
  61. package/src/main.tsx +5 -0
  62. package/src/store/index.ts +8 -0
  63. package/src/store/slices/annotationsSlice.test.ts +0 -16
  64. package/src/store/slices/cesiumSlice.ts +3 -3
  65. package/src/store/slices/dataSlice.test.ts +0 -40
  66. package/src/store/slices/environmentSlice.ts +101 -0
  67. package/src/store/slices/idsSlice.ts +6 -1
  68. package/src/store/slices/selectionSlice.test.ts +0 -43
  69. package/src/store/slices/solarSlice.ts +121 -0
  70. package/src/store/slices/visibilitySlice.test.ts +15 -45
  71. package/src/utils/loadingUtils.ts +1 -1
  72. package/src/workers/idsValidation.worker.ts +98 -0
  73. package/dist/assets/geometry.worker-DVwFYHTq.js +0 -1
  74. package/dist/assets/ifc-lite_bg-FPffpFK_.wasm +0 -0
  75. package/dist/assets/index-DpoJvkdg.css +0 -1
  76. package/dist/assets/parser.worker-U_PVhLNi.js +0 -182
  77. package/dist/assets/raw-p_2cfl6T.js +0 -1
  78. package/dist/assets/server-client-DUMy2mXg.js +0 -719
  79. package/src/components/ui/context-menu.tsx +0 -174
  80. package/src/store.ts +0 -80
@@ -1,6 +1,6 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sandbox-0Z2NzeOJ.js","assets/lens-DMnqMXpz.js"])))=>i.map(i=>d[i]);
2
- import { k as $, l as he, m as Z, n as ve, o as Ee, p as Te, q as Ie, R as be, _ as ge, t as Se, E as Ae, e as xe, a as Ce, u as A, v as N, w as Re, x as Me, y as Ne, z as _e, __tla as __tla_0 } from "./sandbox-0Z2NzeOJ.js";
3
- let g, ca, ua, pa, Pe, oa;
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sandbox-BSiO04m8.js","assets/lens-DMnqMXpz.js"])))=>i.map(i=>d[i]);
2
+ import { k as $, l as De, m as ve, n as Ue, o as ke, p as Be, q as He, R as Ye, _ as qe, t as Ge, E as Xe, e as je, a as We, u as M, v as w, w as ze, x as Ke, y as Qe, z as Je, __tla as __tla_0 } from "./sandbox-BSiO04m8.js";
3
+ let x, ja, Xa, Wa, tt, Ga;
4
4
  let __tla = Promise.all([
5
5
  (()=>{
6
6
  try {
@@ -8,74 +8,75 @@ let __tla = Promise.all([
8
8
  } catch {}
9
9
  })()
10
10
  ]).then(async ()=>{
11
- const O = "http://www.w3.org/2001/XMLSchema";
12
- g = class extends Error {
11
+ const D = "http://www.w3.org/2001/XMLSchema";
12
+ x = class extends Error {
13
13
  constructor(t, i){
14
14
  super(t), this.details = i, this.name = "IDSParseError";
15
15
  }
16
16
  };
17
- let V = typeof globalThis < "u" && typeof globalThis.DOMParser == "function" ? globalThis.DOMParser : null;
18
- V || (V = (await import("@xmldom/xmldom").then(async (m)=>{
17
+ const Ze = globalThis.process, et = !!Ze?.versions?.node;
18
+ let k = typeof globalThis < "u" && typeof globalThis.DOMParser == "function" ? globalThis.DOMParser : null;
19
+ !k && et && (k = (await import("@xmldom/xmldom").then(async (m)=>{
19
20
  await m.__tla;
20
21
  return m;
21
22
  })).DOMParser);
22
- Pe = function(e) {
23
+ tt = function(e) {
23
24
  let t = typeof e == "string" ? e : new TextDecoder().decode(e);
24
- if (t.charCodeAt(0) === 65279 && (t = t.slice(1)), !V) throw new g("No DOMParser implementation available", "Neither globalThis.DOMParser nor @xmldom/xmldom could be loaded.");
25
- const i = new V;
25
+ if (t.charCodeAt(0) === 65279 && (t = t.slice(1)), !k) throw new x("No DOMParser implementation available", "Neither globalThis.DOMParser nor @xmldom/xmldom could be loaded.");
26
+ const i = new k;
26
27
  let a;
27
28
  try {
28
29
  a = i.parseFromString(t, "text/xml");
29
30
  } catch (s) {
30
- throw new g("Failed to parse IDS XML", s instanceof Error ? s.message : String(s));
31
+ throw new x("Failed to parse IDS XML", s instanceof Error ? s.message : String(s));
31
32
  }
32
33
  const n = typeof a.querySelector == "function" ? a.querySelector("parsererror") : null;
33
- if (n) throw new g("Invalid XML format", n.textContent || void 0);
34
+ if (n) throw new x("Invalid XML format", n.textContent || void 0);
34
35
  const r = a.documentElement;
35
- if (!r) throw new g("Failed to parse IDS XML", "Parser returned a document with no root element.");
36
- if (r.localName !== "ids") throw new g(`Invalid root element: expected "ids", got "${r.localName}"`);
36
+ if (!r) throw new x("Failed to parse IDS XML", "Parser returned a document with no root element.");
37
+ if (r.localName !== "ids") throw new x(`Invalid root element: expected "ids", got "${r.localName}"`);
37
38
  return {
38
- info: $e(r),
39
- specifications: we(r),
39
+ info: it(r),
40
+ specifications: at(r),
40
41
  schemaLocation: r.getAttribute("xsi:schemaLocation") || r.getAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "schemaLocation") || void 0
41
42
  };
42
43
  };
43
- function $e(e) {
44
- const t = h(e, "info");
44
+ function it(e) {
45
+ const t = v(e, "info");
45
46
  return t ? {
46
- title: C(t, "title") || "Untitled IDS",
47
- copyright: C(t, "copyright"),
48
- version: C(t, "version"),
49
- author: C(t, "author"),
50
- date: C(t, "date"),
51
- purpose: C(t, "purpose"),
52
- milestone: C(t, "milestone"),
53
- description: C(t, "description")
47
+ title: R(t, "title") || "Untitled IDS",
48
+ copyright: R(t, "copyright"),
49
+ version: R(t, "version"),
50
+ author: R(t, "author"),
51
+ date: R(t, "date"),
52
+ purpose: R(t, "purpose"),
53
+ milestone: R(t, "milestone"),
54
+ description: R(t, "description")
54
55
  } : {
55
56
  title: "Untitled IDS"
56
57
  };
57
58
  }
58
- function we(e) {
59
- const t = h(e, "specifications");
60
- return t ? U(t, "specification").map((a, n)=>Fe(a, n)) : [];
59
+ function at(e) {
60
+ const t = v(e, "specifications");
61
+ return t ? q(t, "specification").map((a, n)=>nt(a, n)) : [];
61
62
  }
62
- function Fe(e, t) {
63
- const i = e.getAttribute("name") || `Specification ${t + 1}`, n = (e.getAttribute("ifcVersion") || "IFC4").split(/\s+/).map((f)=>Oe(f)).filter((f)=>f !== null), r = h(e, "applicability"), s = {
64
- facets: r ? Le(r) : [],
63
+ function nt(e, t) {
64
+ const i = e.getAttribute("name") || `Specification ${t + 1}`, n = (e.getAttribute("ifcVersion") || "IFC4").split(/\s+/).map((y)=>rt(y)).filter((y)=>y !== null), r = v(e, "applicability"), s = {
65
+ facets: r ? st(r) : [],
65
66
  cardinality: r?.getAttribute("cardinality") ?? void 0
66
- }, l = (r ? r.getAttribute("minOccurs") : null) ?? e.getAttribute("minOccurs"), o = (r ? r.getAttribute("maxOccurs") : null) ?? e.getAttribute("maxOccurs");
67
+ }, o = (r ? r.getAttribute("minOccurs") : null) ?? e.getAttribute("minOccurs"), l = (r ? r.getAttribute("maxOccurs") : null) ?? e.getAttribute("maxOccurs");
67
68
  let u;
68
- if (l !== null) {
69
- const f = parseInt(l, 10);
70
- Number.isFinite(f) && (u = f);
69
+ if (o !== null) {
70
+ const y = parseInt(o, 10);
71
+ Number.isFinite(y) && (u = y);
71
72
  }
72
73
  let c;
73
- if (o !== null) {
74
- const f = parseInt(o, 10);
75
- o === "unbounded" ? c = "unbounded" : Number.isFinite(f) && (c = f);
74
+ if (l !== null) {
75
+ const y = parseInt(l, 10);
76
+ l === "unbounded" ? c = "unbounded" : Number.isFinite(y) && (c = y);
76
77
  }
77
78
  u === void 0 && (r || c !== void 0) && (u = 1);
78
- const m = h(e, "requirements"), d = m ? He(m) : [];
79
+ const m = v(e, "requirements"), d = m ? ft(m) : [];
79
80
  return {
80
81
  id: e.getAttribute("identifier") || `spec-${t}`,
81
82
  name: i,
@@ -92,7 +93,7 @@ let __tla = Promise.all([
92
93
  maxOccurs: c
93
94
  };
94
95
  }
95
- function Oe(e) {
96
+ function rt(e) {
96
97
  const t = e.toUpperCase().replace(/[^A-Z0-9]/g, "");
97
98
  switch(t){
98
99
  case "IFC2X3":
@@ -106,90 +107,90 @@ let __tla = Promise.all([
106
107
  return t.startsWith("IFC4X3") ? "IFC4X3" : t.startsWith("IFC4") ? "IFC4" : t.startsWith("IFC2X3") ? "IFC2X3" : null;
107
108
  }
108
109
  }
109
- function Le(e) {
110
+ function st(e) {
110
111
  const t = [];
111
112
  for (const i of Array.from(e.children)){
112
- const a = ee(i);
113
+ const a = Ee(i);
113
114
  a && t.push(a);
114
115
  }
115
116
  return t;
116
117
  }
117
- function ee(e) {
118
+ function Ee(e) {
118
119
  switch(e.localName.toLowerCase()){
119
120
  case "entity":
120
- return te(e);
121
+ return ge(e);
121
122
  case "attribute":
122
- return Ve(e);
123
+ return ot(e);
123
124
  case "property":
124
- return De(e);
125
+ return lt(e);
125
126
  case "classification":
126
- return Ue(e);
127
+ return ut(e);
127
128
  case "material":
128
- return ke(e);
129
+ return ct(e);
129
130
  case "partof":
130
- return Be(e);
131
+ return pt(e);
131
132
  default:
132
133
  return null;
133
134
  }
134
135
  }
135
- function te(e) {
136
- const t = h(e, "name"), i = h(e, "predefinedType");
137
- if (!t) throw new g("Entity facet must have a name element");
136
+ function ge(e) {
137
+ const t = v(e, "name"), i = v(e, "predefinedType");
138
+ if (!t) throw new x("Entity facet must have a name element");
138
139
  return {
139
140
  type: "entity",
140
- name: T(t),
141
- predefinedType: i ? T(i) : void 0
141
+ name: S(t),
142
+ predefinedType: i ? S(i) : void 0
142
143
  };
143
144
  }
144
- function Ve(e) {
145
- const t = h(e, "name"), i = h(e, "value");
146
- if (!t) throw new g("Attribute facet must have a name element");
145
+ function ot(e) {
146
+ const t = v(e, "name"), i = v(e, "value");
147
+ if (!t) throw new x("Attribute facet must have a name element");
147
148
  return {
148
149
  type: "attribute",
149
- name: T(t),
150
- value: i ? T(i) : void 0
150
+ name: S(t),
151
+ value: i ? S(i) : void 0
151
152
  };
152
153
  }
153
- function De(e) {
154
- const t = h(e, "propertySet"), i = h(e, "baseName"), a = e.getAttribute("dataType"), n = h(e, "dataType"), r = h(e, "value");
155
- if (!t) throw new g("Property facet must have a propertySet element");
156
- if (!i) throw new g("Property facet must have a baseName element");
154
+ function lt(e) {
155
+ const t = v(e, "propertySet"), i = v(e, "baseName"), a = e.getAttribute("dataType"), n = v(e, "dataType"), r = v(e, "value");
156
+ if (!t) throw new x("Property facet must have a propertySet element");
157
+ if (!i) throw new x("Property facet must have a baseName element");
157
158
  let s;
158
159
  return a ? s = {
159
160
  type: "simpleValue",
160
161
  value: a
161
- } : n && (s = T(n)), {
162
+ } : n && (s = S(n)), {
162
163
  type: "property",
163
- propertySet: T(t),
164
- baseName: T(i),
164
+ propertySet: S(t),
165
+ baseName: S(i),
165
166
  dataType: s,
166
- value: r ? T(r) : void 0
167
+ value: r ? S(r) : void 0
167
168
  };
168
169
  }
169
- function Ue(e) {
170
- const t = h(e, "system"), i = h(e, "value");
170
+ function ut(e) {
171
+ const t = v(e, "system"), i = v(e, "value");
171
172
  return {
172
173
  type: "classification",
173
- system: t ? T(t) : void 0,
174
- value: i ? T(i) : void 0
174
+ system: t ? S(t) : void 0,
175
+ value: i ? S(i) : void 0
175
176
  };
176
177
  }
177
- function ke(e) {
178
- const t = h(e, "value");
178
+ function ct(e) {
179
+ const t = v(e, "value");
179
180
  return {
180
181
  type: "material",
181
- value: t ? T(t) : void 0
182
+ value: t ? S(t) : void 0
182
183
  };
183
184
  }
184
- function Be(e) {
185
- const t = e.getAttribute("relation"), i = t || "IfcRelContainedInSpatialStructure", a = h(e, "entity"), n = Ye(i), r = qe(i), s = {
185
+ function pt(e) {
186
+ const t = e.getAttribute("relation"), i = t || "IfcRelContainedInSpatialStructure", a = v(e, "entity"), n = mt(i), r = dt(i), s = {
186
187
  type: "partOf",
187
188
  relation: n,
188
- entity: a ? te(a) : void 0
189
+ entity: a ? ge(a) : void 0
189
190
  };
190
191
  return !r && t && (s.rawRelation = t), s;
191
192
  }
192
- function qe(e) {
193
+ function dt(e) {
193
194
  switch(e){
194
195
  case "IfcRelAggregates":
195
196
  case "IfcRelContainedInSpatialStructure":
@@ -202,28 +203,28 @@ let __tla = Promise.all([
202
203
  return !1;
203
204
  }
204
205
  }
205
- function Ye(e) {
206
+ function mt(e) {
206
207
  const t = e.toUpperCase();
207
208
  return t.includes("ASSIGNSTOGROUP") || t.includes("GROUP") ? "IfcRelAssignsToGroup" : t.includes("AGGREGATE") ? "IfcRelAggregates" : t.includes("CONTAINED") || t.includes("SPATIAL") ? "IfcRelContainedInSpatialStructure" : t.includes("NEST") ? "IfcRelNests" : t.includes("VOID") ? "IfcRelVoidsElement" : t.includes("FILL") ? "IfcRelFillsElement" : "IfcRelContainedInSpatialStructure";
208
209
  }
209
- function He(e) {
210
+ function ft(e) {
210
211
  const t = [];
211
212
  let i = 0;
212
213
  for (const a of Array.from(e.children)){
213
- const n = ee(a);
214
+ const n = Ee(a);
214
215
  if (n) {
215
- const r = a.getAttribute("cardinality"), s = a.getAttribute("minOccurs"), l = a.getAttribute("maxOccurs");
216
- let o = "required", u;
217
- if (r !== null) if (r === "required" || r === "optional" || r === "prohibited") o = r;
216
+ const r = a.getAttribute("cardinality"), s = a.getAttribute("minOccurs"), o = a.getAttribute("maxOccurs");
217
+ let l = "required", u;
218
+ if (r !== null) if (r === "required" || r === "optional" || r === "prohibited") l = r;
218
219
  else {
219
220
  const c = r.toLowerCase();
220
- (c === "required" || c === "optional" || c === "prohibited") && (o = c), u = r;
221
+ (c === "required" || c === "optional" || c === "prohibited") && (l = c), u = r;
221
222
  }
222
- else s === "0" && l === "0" ? o = "prohibited" : s === "0" && (o = "optional");
223
+ else s === "0" && o === "0" ? l = "prohibited" : s === "0" && (l = "optional");
223
224
  t.push({
224
225
  id: `req-${i++}`,
225
226
  facet: n,
226
- optionality: o,
227
+ optionality: l,
227
228
  cardinalityRaw: u,
228
229
  description: a.getAttribute("description") || void 0,
229
230
  instructions: a.getAttribute("instructions") || void 0
@@ -232,14 +233,14 @@ let __tla = Promise.all([
232
233
  }
233
234
  return t;
234
235
  }
235
- function T(e) {
236
- const t = h(e, "simpleValue");
236
+ function S(e) {
237
+ const t = v(e, "simpleValue");
237
238
  if (t) return {
238
239
  type: "simpleValue",
239
240
  value: t.textContent?.trim() || ""
240
241
  };
241
- const i = ie(e, "restriction", O) || h(e, "restriction");
242
- if (i) return Ge(i);
242
+ const i = Te(e, "restriction", D) || v(e, "restriction");
243
+ if (i) return yt(i);
243
244
  const a = e.textContent?.trim();
244
245
  return a ? {
245
246
  type: "simpleValue",
@@ -249,25 +250,25 @@ let __tla = Promise.all([
249
250
  value: ""
250
251
  };
251
252
  }
252
- function Ge(e) {
253
+ function yt(e) {
253
254
  const t = e.getAttribute("base") || void 0, i = (()=>{
254
- const s = q(e, "pattern", O);
255
- return s.length > 0 ? s : U(e, "pattern");
255
+ const s = J(e, "pattern", D);
256
+ return s.length > 0 ? s : q(e, "pattern");
256
257
  })();
257
258
  if (i.length > 0) {
258
- const s = i.map((o)=>o.getAttribute("value") || o.textContent || "").filter((o)=>o.length > 0);
259
+ const s = i.map((l)=>l.getAttribute("value") || l.textContent || "").filter((l)=>l.length > 0);
259
260
  return {
260
261
  type: "pattern",
261
- pattern: s.length === 1 ? s[0] : s.map((o)=>`(?:${o})`).join("|"),
262
+ pattern: s.length === 1 ? s[0] : s.map((l)=>`(?:${l})`).join("|"),
262
263
  base: t
263
264
  };
264
265
  }
265
- const a = q(e, "enumeration", O);
266
+ const a = J(e, "enumeration", D);
266
267
  if (a.length === 0) {
267
- const s = U(e, "enumeration");
268
+ const s = q(e, "enumeration");
268
269
  if (s.length > 0) return {
269
270
  type: "enumeration",
270
- values: s.map((l)=>l.getAttribute("value") || l.textContent || ""),
271
+ values: s.map((o)=>o.getAttribute("value") || o.textContent || ""),
271
272
  base: t
272
273
  };
273
274
  } else return {
@@ -284,21 +285,21 @@ let __tla = Promise.all([
284
285
  "length",
285
286
  "minLength",
286
287
  "maxLength"
287
- ])n[s] = ie(e, s, O) || h(e, s);
288
+ ])n[s] = Te(e, s, D) || v(e, s);
288
289
  if (Object.values(n).some((s)=>s !== null)) {
289
290
  const s = {
290
291
  type: "bounds",
291
292
  base: t
292
- }, l = (u)=>{
293
+ }, o = (u)=>{
293
294
  if (!u) return;
294
295
  const c = parseFloat(u.getAttribute("value") || u.textContent || "");
295
296
  return Number.isFinite(c) ? c : void 0;
296
- }, o = (u)=>{
297
+ }, l = (u)=>{
297
298
  if (!u) return;
298
299
  const c = parseInt(u.getAttribute("value") || u.textContent || "", 10);
299
300
  return Number.isFinite(c) && c >= 0 ? c : void 0;
300
301
  };
301
- return s.minInclusive = l(n.minInclusive), s.maxInclusive = l(n.maxInclusive), s.minExclusive = l(n.minExclusive), s.maxExclusive = l(n.maxExclusive), s.length = o(n.length), s.minLength = o(n.minLength), s.maxLength = o(n.maxLength), s;
302
+ return s.minInclusive = o(n.minInclusive), s.maxInclusive = o(n.maxInclusive), s.minExclusive = o(n.minExclusive), s.maxExclusive = o(n.maxExclusive), s.length = l(n.length), s.minLength = l(n.minLength), s.maxLength = l(n.maxLength), s;
302
303
  }
303
304
  const r = e.textContent?.trim() || "";
304
305
  return t && r === "" ? {
@@ -314,93 +315,122 @@ let __tla = Promise.all([
314
315
  base: t
315
316
  };
316
317
  }
317
- function h(e, t) {
318
+ function v(e, t) {
318
319
  for (const i of Array.from(e.children))if (i.localName.toLowerCase() === t.toLowerCase()) return i;
319
320
  return null;
320
321
  }
321
- function U(e, t) {
322
+ function q(e, t) {
322
323
  const i = [];
323
324
  for (const a of Array.from(e.children))a.localName.toLowerCase() === t.toLowerCase() && i.push(a);
324
325
  return i;
325
326
  }
326
- function ie(e, t, i) {
327
+ function Te(e, t, i) {
327
328
  for (const a of Array.from(e.children))if (a.localName.toLowerCase() === t.toLowerCase() && a.namespaceURI === i) return a;
328
329
  return null;
329
330
  }
330
- function q(e, t, i) {
331
+ function J(e, t, i) {
331
332
  const a = [];
332
333
  for (const n of Array.from(e.children))n.localName.toLowerCase() === t.toLowerCase() && n.namespaceURI === i && a.push(n);
333
334
  return a;
334
335
  }
335
- function C(e, t) {
336
- return h(e, t)?.textContent?.trim() || void 0;
336
+ function R(e, t) {
337
+ return v(e, t)?.textContent?.trim() || void 0;
338
+ }
339
+ const G = /^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/;
340
+ function W(e) {
341
+ return G.test(e);
342
+ }
343
+ function z(e) {
344
+ return e === "true" || e === "false";
337
345
  }
338
- const Y = /^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/, Xe = 1e-6;
339
- function je(e, t) {
340
- const i = Xe * (1 + Math.abs(e)), a = 16 * Number.EPSILON * Math.max(Math.abs(e), typeof t == "number" ? Math.abs(t) : 0);
346
+ const ht = 1e-6;
347
+ function vt(e, t) {
348
+ const i = ht * (1 + Math.abs(e)), a = 16 * Number.EPSILON * Math.max(Math.abs(e), typeof t == "number" ? Math.abs(t) : 0);
341
349
  return i + a;
342
350
  }
343
- function ae(e, t) {
344
- const i = String(t), a = Y.test(e), n = typeof t == "number" || Y.test(i);
351
+ function be(e, t) {
352
+ const i = String(t), a = G.test(e), n = typeof t == "number" || G.test(i);
345
353
  if (!a || !n) return;
346
354
  const r = parseFloat(e), s = typeof t == "number" ? t : parseFloat(i);
347
- if (!(Number.isNaN(r) || Number.isNaN(s))) return Math.abs(r - s) <= je(r, s);
355
+ if (!(Number.isNaN(r) || Number.isNaN(s))) return Math.abs(r - s) <= vt(r, s);
348
356
  }
349
- function ne(e, t) {
357
+ function Ie(e, t) {
350
358
  if (!(e !== "true" && e !== "false")) return typeof t == "boolean" ? e === "true" ? t === !0 : t === !1 : t === "true" || t === "false" ? t === e : !1;
351
359
  }
352
- function re(e, t, i) {
360
+ function Se(e, t, i) {
353
361
  const a = String(t);
354
362
  if (a === e || i && a.toUpperCase() === e.toUpperCase()) return !0;
355
363
  }
356
- function v(e, t, i) {
364
+ function h(e, t, i) {
357
365
  if (t == null) return !1;
358
366
  const a = i?.caseInsensitive ?? !1;
359
367
  switch(e.type){
360
368
  case "simpleValue":
361
- return We(e, t, a);
369
+ return gt(e, t, a);
362
370
  case "pattern":
363
- return ze(e, t, a);
371
+ return Tt(e, t, a);
364
372
  case "enumeration":
365
- return Qe(e, t, a);
373
+ return St(e, t, a);
366
374
  case "bounds":
367
- return Je(e, t);
375
+ return At(e, t);
368
376
  default:
369
377
  return !1;
370
378
  }
371
379
  }
372
- function We(e, t, i) {
373
- const a = e.value, n = re(a, t, i);
380
+ const Z = new WeakMap;
381
+ function Et(e) {
382
+ let t = Z.get(e);
383
+ return t === void 0 && (t = W(e.value) || z(e.value), Z.set(e, t)), t;
384
+ }
385
+ function gt(e, t, i) {
386
+ const a = e.value, n = Se(a, t, i);
374
387
  if (n !== void 0) return n;
375
- const r = ae(a, t);
388
+ if (!Et(e)) return !1;
389
+ const r = be(a, t);
376
390
  if (r !== void 0) return r;
377
- const s = ne(a, t);
391
+ const s = Ie(a, t);
378
392
  return s !== void 0 ? s : !1;
379
393
  }
380
- function ze(e, t, i = !1) {
394
+ function Tt(e, t, i = !1) {
381
395
  if (typeof t == "number" || typeof t == "boolean") return !1;
382
396
  const a = String(t);
383
397
  try {
384
- const n = Ke(e.pattern), r = i ? "i" : "";
398
+ const n = bt(e.pattern), r = i ? "i" : "";
385
399
  return new RegExp(`^${n}$`, r).test(a);
386
400
  } catch {
387
401
  return !1;
388
402
  }
389
403
  }
390
- function Ke(e) {
404
+ function bt(e) {
391
405
  return e.replace(/\\i/g, "[A-Za-z_:]").replace(/\\c/g, "[A-Za-z0-9._:-]").replace(/\\p\{[^}]+\}/g, ".").replace(/\[([^\]]+)-\[[^\]]+\]\]/g, "[$1]");
392
406
  }
393
- function Qe(e, t, i) {
394
- return e.values.some((a)=>{
395
- const n = re(a, t, i);
396
- if (n !== void 0) return n;
397
- const r = ae(a, t);
398
- if (r !== void 0) return r;
399
- const s = ne(a, t);
400
- return s !== void 0 ? s : !1;
401
- });
407
+ const ee = new WeakMap;
408
+ function It(e) {
409
+ let t = ee.get(e);
410
+ if (!t) {
411
+ const i = new Set(e.values), a = new Set;
412
+ let n = !1;
413
+ for (const r of e.values)a.add(r.toUpperCase()), (W(r) || z(r)) && (n = !0);
414
+ t = {
415
+ exact: i,
416
+ upper: a,
417
+ anyCoercible: n
418
+ }, ee.set(e, t);
419
+ }
420
+ return t;
402
421
  }
403
- function Je(e, t) {
422
+ function St(e, t, i) {
423
+ const a = It(e), n = String(t);
424
+ return a.exact.has(n) || i && a.upper.has(n.toUpperCase()) ? !0 : a.anyCoercible ? e.values.some((r)=>{
425
+ const s = Se(r, t, i);
426
+ if (s !== void 0) return s;
427
+ const o = be(r, t);
428
+ if (o !== void 0) return o;
429
+ const l = Ie(r, t);
430
+ return l !== void 0 ? l : !1;
431
+ }) : !1;
432
+ }
433
+ function At(e, t) {
404
434
  if (e.length !== void 0 || e.minLength !== void 0 || e.maxLength !== void 0) {
405
435
  const a = String(t);
406
436
  if (e.length !== void 0 && a.length !== e.length || e.minLength !== void 0 && a.length < e.minLength || e.maxLength !== void 0 && a.length > e.maxLength) return !1;
@@ -409,28 +439,38 @@ let __tla = Promise.all([
409
439
  const i = typeof t == "number" ? t : parseFloat(String(t));
410
440
  return !(isNaN(i) || e.minInclusive !== void 0 && i < e.minInclusive || e.maxInclusive !== void 0 && i > e.maxInclusive || e.minExclusive !== void 0 && i <= e.minExclusive || e.maxExclusive !== void 0 && i >= e.maxExclusive);
411
441
  }
442
+ const te = 10;
443
+ function xt(e) {
444
+ const t = e.slice(0, te).map((a)=>`"${a}"`).join(", "), i = e.length - te;
445
+ return i > 0 ? `[${t}, … +${i} more]` : `[${t}]`;
446
+ }
447
+ const ie = new WeakMap;
412
448
  function p(e) {
449
+ let t = ie.get(e);
450
+ return t === void 0 && (t = Ct(e), ie.set(e, t)), t;
451
+ }
452
+ function Ct(e) {
413
453
  switch(e.type){
414
454
  case "simpleValue":
415
455
  return `"${e.value}"`;
416
456
  case "pattern":
417
457
  return `pattern "${e.pattern}"`;
418
458
  case "enumeration":
419
- return e.values.length === 1 ? `"${e.values[0]}"` : `one of [${e.values.map((t)=>`"${t}"`).join(", ")}]`;
459
+ return e.values.length === 1 ? `"${e.values[0]}"` : `one of ${xt(e.values)}`;
420
460
  case "bounds":
421
- return Ze(e);
461
+ return Mt(e);
422
462
  default:
423
463
  return "unknown";
424
464
  }
425
465
  }
426
- function Ze(e) {
466
+ function Mt(e) {
427
467
  const t = [];
428
468
  return e.minInclusive !== void 0 && e.maxInclusive !== void 0 ? `between ${e.minInclusive} and ${e.maxInclusive}` : (e.minInclusive !== void 0 && t.push(`>= ${e.minInclusive}`), e.maxInclusive !== void 0 && t.push(`<= ${e.maxInclusive}`), e.minExclusive !== void 0 && t.push(`> ${e.minExclusive}`), e.maxExclusive !== void 0 && t.push(`< ${e.maxExclusive}`), t.join(" and ") || "any value");
429
469
  }
430
- const et = {
470
+ const Ae = {
431
471
  caseInsensitive: !0
432
472
  };
433
- function tt(e, t, i) {
473
+ function Nt(e, t, i) {
434
474
  const a = i.getEntityType(t);
435
475
  if (!a) return {
436
476
  passed: !1,
@@ -454,7 +494,7 @@ let __tla = Promise.all([
454
494
  expected: p(e.name)
455
495
  }
456
496
  };
457
- if (!v(e.name, a, et)) return {
497
+ if (!h(e.name, a, Ae)) return {
458
498
  passed: !1,
459
499
  actualValue: a,
460
500
  expectedValue: p(e.name),
@@ -478,16 +518,16 @@ let __tla = Promise.all([
478
518
  }
479
519
  };
480
520
  let s = !1;
481
- if ((n && v(e.predefinedType, n) || n === "USERDEFINED" && r && r !== n && v(e.predefinedType, r) || !n && r && v(e.predefinedType, r)) && (s = !0), !s) {
482
- const l = r || n || "(none)";
521
+ if ((n && h(e.predefinedType, n) || n === "USERDEFINED" && r && r !== n && h(e.predefinedType, r) || !n && r && h(e.predefinedType, r)) && (s = !0), !s) {
522
+ const o = r || n || "(none)";
483
523
  return {
484
524
  passed: !1,
485
- actualValue: `${a}[${l}]`,
525
+ actualValue: `${a}[${o}]`,
486
526
  expectedValue: `${p(e.name)} with predefinedType ${p(e.predefinedType)}`,
487
527
  failure: {
488
528
  type: "PREDEFINED_TYPE_MISMATCH",
489
529
  field: "predefinedType",
490
- actual: l,
530
+ actual: o,
491
531
  expected: p(e.predefinedType)
492
532
  }
493
533
  };
@@ -499,7 +539,16 @@ let __tla = Promise.all([
499
539
  expectedValue: p(e.name)
500
540
  };
501
541
  }
502
- function it(e, t) {
542
+ function Rt(e, t, i) {
543
+ const a = i.getEntityType(t);
544
+ if (!a || e.name.type === "simpleValue" && e.name.value !== e.name.value.toUpperCase() || !h(e.name, a, Ae)) return !1;
545
+ if (e.predefinedType) {
546
+ const n = i.getPredefinedTypeRaw?.(t), r = i.getObjectType(t);
547
+ return !n && !r ? !1 : !!(n && h(e.predefinedType, n) || n === "USERDEFINED" && r && r !== n && h(e.predefinedType, r) || !n && r && h(e.predefinedType, r));
548
+ }
549
+ return !0;
550
+ }
551
+ function Pt(e, t) {
503
552
  const i = e.name;
504
553
  if (i.type === "simpleValue") return t.getEntitiesByType(i.value);
505
554
  if (i.type === "enumeration") {
@@ -508,31 +557,31 @@ let __tla = Promise.all([
508
557
  return a;
509
558
  }
510
559
  }
511
- const at = /^[+-]?\d+$/, nt = /^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/, rt = /^\d{4}-\d{2}-\d{2}(Z|[+-]\d{2}:\d{2})?$/, st = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})?$/, lt = /^-?P(?:\d+Y)?(?:\d+M)?(?:\d+D)?(?:T(?:\d+H)?(?:\d+M)?(?:\d+(?:\.\d+)?S)?)?$/;
512
- function se(e, t) {
513
- return !t || t.length === 0 ? !0 : t.some((i)=>ot(e, i));
560
+ const _t = /^[+-]?\d+$/, wt = /^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/, $t = /^\d{4}-\d{2}-\d{2}(Z|[+-]\d{2}:\d{2})?$/, Ft = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})?$/, Ot = /^-?P(?:\d+Y)?(?:\d+M)?(?:\d+D)?(?:T(?:\d+H)?(?:\d+M)?(?:\d+(?:\.\d+)?S)?)?$/;
561
+ function K(e, t) {
562
+ return !t || t.length === 0 ? !0 : t.some((i)=>Lt(e, i));
514
563
  }
515
- function ot(e, t) {
564
+ function Lt(e, t) {
516
565
  switch(t){
517
566
  case "xs:integer":
518
- return at.test(e);
567
+ return _t.test(e);
519
568
  case "xs:double":
520
- return nt.test(e);
569
+ return wt.test(e);
521
570
  case "xs:boolean":
522
571
  return e === "true" || e === "false";
523
572
  case "xs:date":
524
- return rt.test(e);
573
+ return $t.test(e);
525
574
  case "xs:dateTime":
526
- return st.test(e);
575
+ return Ft.test(e);
527
576
  case "xs:duration":
528
- return lt.test(e);
577
+ return Ot.test(e);
529
578
  case "xs:string":
530
579
  return !0;
531
580
  default:
532
581
  return !0;
533
582
  }
534
583
  }
535
- function ut(e) {
584
+ function xe(e) {
536
585
  if (!e) return [];
537
586
  const t = e.toUpperCase();
538
587
  return t === "IFCINTEGER" || t === "IFCCOUNTMEASURE" ? [
@@ -554,9 +603,9 @@ let __tla = Promise.all([
554
603
  "xs:string"
555
604
  ] : [];
556
605
  }
557
- const ct = {
606
+ const Vt = {
558
607
  caseInsensitive: !0
559
- }, pt = [
608
+ }, Dt = [
560
609
  "Name",
561
610
  "Description",
562
611
  "ObjectType",
@@ -564,7 +613,7 @@ let __tla = Promise.all([
564
613
  "GlobalId",
565
614
  "LongName"
566
615
  ];
567
- function dt(e, t, i) {
616
+ function Ut(e, t, i) {
568
617
  const a = e.name;
569
618
  let n;
570
619
  if (a.type === "simpleValue") n = [
@@ -572,7 +621,7 @@ let __tla = Promise.all([
572
621
  ];
573
622
  else {
574
623
  const s = i.getAttributeNames?.(t);
575
- if (n = (s && s.length > 0 ? s : pt).filter((o)=>v(a, o, ct)), n.length === 0) return {
624
+ if (n = (s && s.length > 0 ? s : Dt).filter((l)=>h(a, l, Vt)), n.length === 0) return {
576
625
  passed: !1,
577
626
  expectedValue: e.value ? p(e.value) : `attribute matching ${p(a)} to exist`,
578
627
  failure: {
@@ -584,14 +633,14 @@ let __tla = Promise.all([
584
633
  }
585
634
  let r;
586
635
  for (const s of n){
587
- const l = mt(e, s, t, i);
588
- if (l.passed) return l;
589
- (!r || l.failure?.type !== "ATTRIBUTE_MISSING" && r.failure?.type === "ATTRIBUTE_MISSING") && (r = l);
636
+ const o = kt(e, s, t, i);
637
+ if (o.passed) return o;
638
+ (!r || o.failure?.type !== "ATTRIBUTE_MISSING" && r.failure?.type === "ATTRIBUTE_MISSING") && (r = o);
590
639
  }
591
640
  return r;
592
641
  }
593
- function mt(e, t, i, a) {
594
- const n = ft(t, i, a);
642
+ function kt(e, t, i, a) {
643
+ const n = Bt(t, i, a);
595
644
  if (n == null) return {
596
645
  passed: !1,
597
646
  actualValue: void 0,
@@ -620,7 +669,7 @@ let __tla = Promise.all([
620
669
  };
621
670
  if (e.value.type === "simpleValue") {
622
671
  const r = a.getAttributeXsdTypes?.(i, t);
623
- if (r && !se(e.value.value, r)) return {
672
+ if (r && !K(e.value.value, r)) return {
624
673
  passed: !1,
625
674
  actualValue: String(n),
626
675
  expectedValue: p(e.value),
@@ -632,7 +681,7 @@ let __tla = Promise.all([
632
681
  }
633
682
  };
634
683
  }
635
- return v(e.value, n) ? {
684
+ return h(e.value, n) ? {
636
685
  passed: !0,
637
686
  actualValue: String(n),
638
687
  expectedValue: p(e.value)
@@ -648,7 +697,7 @@ let __tla = Promise.all([
648
697
  }
649
698
  };
650
699
  }
651
- function ft(e, t, i) {
700
+ function Bt(e, t, i) {
652
701
  switch(e.toLowerCase()){
653
702
  case "name":
654
703
  return i.getEntityName(t);
@@ -662,10 +711,52 @@ let __tla = Promise.all([
662
711
  return i.getAttribute(t, e);
663
712
  }
664
713
  }
665
- const yt = {
714
+ const Ce = {
666
715
  caseInsensitive: !0
667
- };
668
- function ht(e, t, i) {
716
+ }, ae = new WeakMap, ne = new WeakMap, re = new WeakMap;
717
+ function Ht(e) {
718
+ let t = ae.get(e);
719
+ return t === void 0 && (t = e.map((i)=>i.name).join(", "), ae.set(e, t)), t;
720
+ }
721
+ function Yt(e) {
722
+ let t = ne.get(e);
723
+ return t === void 0 && (t = e.properties.map((i)=>i.name).join(", "), ne.set(e, t)), t;
724
+ }
725
+ function qt(e) {
726
+ let t = re.get(e);
727
+ return t === void 0 && (t = e.properties.map((i)=>`${e.name}.${i.name}`).join(", "), re.set(e, t)), t;
728
+ }
729
+ const se = new WeakMap;
730
+ function Gt(e, t) {
731
+ let i = se.get(e);
732
+ i || (i = new Map, se.set(e, i));
733
+ const a = t ?? "";
734
+ let n = i.get(a);
735
+ if (n === void 0) {
736
+ const r = xe(t);
737
+ n = r.length === 0 || K(e.value, r), i.set(a, n);
738
+ }
739
+ return n;
740
+ }
741
+ function Xt(e, t) {
742
+ return t.value === null || t.value === void 0 || t.value === "" || e.dataType && t.dataType && !h(e.dataType, t.dataType, Ce) ? !1 : e.value ? e.value.type === "simpleValue" && !Gt(e.value, t.dataType) ? !1 : (t.values && t.values.length > 0 ? t.values : [
743
+ t.value
744
+ ]).some((a)=>h(e.value, a)) : !0;
745
+ }
746
+ function jt(e, t, i) {
747
+ const a = i.getPropertySets(t);
748
+ if (a.length === 0) return !1;
749
+ let n = !1;
750
+ for (const r of a){
751
+ if (!h(e.propertySet, r.name)) continue;
752
+ n = !0;
753
+ let s = !1;
754
+ for (const o of r.properties)if (h(e.baseName, o.name) && (s = !0, !Xt(e, o))) return !1;
755
+ if (!s) return !1;
756
+ }
757
+ return n;
758
+ }
759
+ function Wt(e, t, i) {
669
760
  const a = i.getPropertySets(t);
670
761
  if (a.length === 0) return {
671
762
  passed: !1,
@@ -676,9 +767,9 @@ let __tla = Promise.all([
676
767
  expected: p(e.propertySet)
677
768
  }
678
769
  };
679
- const n = a.filter((u)=>v(e.propertySet, u.name));
770
+ const n = a.filter((u)=>h(e.propertySet, u.name));
680
771
  if (n.length === 0) {
681
- const u = a.map((c)=>c.name).join(", ");
772
+ const u = Ht(a);
682
773
  return {
683
774
  passed: !1,
684
775
  actualValue: u || "(none)",
@@ -696,7 +787,7 @@ let __tla = Promise.all([
696
787
  }
697
788
  let r, s;
698
789
  for (const u of n){
699
- const c = vt(e, u);
790
+ const c = zt(e, u);
700
791
  if (c.passed) {
701
792
  r = c;
702
793
  continue;
@@ -706,24 +797,24 @@ let __tla = Promise.all([
706
797
  if (s) {
707
798
  if (s.failure?.type !== "PROPERTY_MISSING" || r) return s;
708
799
  } else if (r) return r;
709
- const l = n.map((u)=>u.name).join(", "), o = n.flatMap((u)=>u.properties.map((c)=>`${u.name}.${c.name}`)).join(", ");
800
+ const o = n.map((u)=>u.name).join(", "), l = n.map((u)=>qt(u)).join(", ");
710
801
  return {
711
802
  passed: !1,
712
- actualValue: o || "(none)",
803
+ actualValue: l || "(none)",
713
804
  expectedValue: `${p(e.propertySet)}.${p(e.baseName)}`,
714
805
  failure: {
715
806
  type: "PROPERTY_MISSING",
716
807
  field: p(e.baseName),
717
808
  expected: p(e.baseName),
718
809
  context: {
719
- propertySet: l,
720
- availableProperties: o
810
+ propertySet: o,
811
+ availableProperties: l
721
812
  }
722
813
  }
723
814
  };
724
815
  }
725
- function vt(e, t) {
726
- const i = t.properties.filter((r)=>v(e.baseName, r.name));
816
+ function zt(e, t) {
817
+ const i = t.properties.filter((r)=>h(e.baseName, r.name));
727
818
  if (i.length === 0) return {
728
819
  passed: !1,
729
820
  failure: {
@@ -732,13 +823,13 @@ let __tla = Promise.all([
732
823
  expected: p(e.baseName),
733
824
  context: {
734
825
  propertySet: t.name,
735
- availableProperties: t.properties.map((r)=>r.name).join(", ")
826
+ availableProperties: Yt(t)
736
827
  }
737
828
  }
738
829
  };
739
830
  let a, n;
740
831
  for (const r of i){
741
- const s = Et(e, t, r);
832
+ const s = Kt(e, t, r);
742
833
  if (s.passed) {
743
834
  a = s;
744
835
  continue;
@@ -747,7 +838,7 @@ let __tla = Promise.all([
747
838
  }
748
839
  return n || a;
749
840
  }
750
- function Et(e, t, i) {
841
+ function Kt(e, t, i) {
751
842
  if (i.value === null || i.value === void 0 || i.value === "") return {
752
843
  passed: !1,
753
844
  actualValue: "(empty)",
@@ -759,7 +850,7 @@ let __tla = Promise.all([
759
850
  expected: e.value ? p(e.value) : "a non-empty value"
760
851
  }
761
852
  };
762
- if (e.dataType && i.dataType && !v(e.dataType, i.dataType, yt)) return {
853
+ if (e.dataType && i.dataType && !h(e.dataType, i.dataType, Ce)) return {
763
854
  passed: !1,
764
855
  actualValue: `${t.name}.${i.name} (${i.dataType})`,
765
856
  expectedValue: `dataType ${p(e.dataType)}`,
@@ -784,8 +875,8 @@ let __tla = Promise.all([
784
875
  }
785
876
  };
786
877
  if (e.value.type === "simpleValue") {
787
- const s = ut(i.dataType);
788
- if (s.length > 0 && !se(e.value.value, s)) return {
878
+ const s = xe(i.dataType);
879
+ if (s.length > 0 && !K(e.value.value, s)) return {
789
880
  passed: !1,
790
881
  actualValue: String(a),
791
882
  expectedValue: p(e.value),
@@ -799,16 +890,16 @@ let __tla = Promise.all([
799
890
  }
800
891
  if (!(i.values && i.values.length > 0 ? i.values : [
801
892
  a
802
- ]).some((s)=>v(e.value, s))) {
803
- const s = e.value.type === "bounds" ? "PROPERTY_OUT_OF_BOUNDS" : "PROPERTY_VALUE_MISMATCH", l = i.values && i.values.length > 0 ? i.values.join(", ") : String(a);
893
+ ]).some((s)=>h(e.value, s))) {
894
+ const s = e.value.type === "bounds" ? "PROPERTY_OUT_OF_BOUNDS" : "PROPERTY_VALUE_MISMATCH", o = i.values && i.values.length > 0 ? i.values.join(", ") : String(a);
804
895
  return {
805
896
  passed: !1,
806
- actualValue: l,
897
+ actualValue: o,
807
898
  expectedValue: p(e.value),
808
899
  failure: {
809
900
  type: s,
810
901
  field: `${t.name}.${i.name}`,
811
- actual: l,
902
+ actual: o,
812
903
  expected: p(e.value)
813
904
  }
814
905
  };
@@ -820,7 +911,7 @@ let __tla = Promise.all([
820
911
  expectedValue: e.value ? p(e.value) : "property exists"
821
912
  };
822
913
  }
823
- function Tt(e, t, i) {
914
+ function Qt(e, t, i) {
824
915
  const a = i.getClassifications(t), n = a.length > 0;
825
916
  if (!e.system && !e.value) return n ? {
826
917
  passed: !0,
@@ -848,9 +939,9 @@ let __tla = Promise.all([
848
939
  };
849
940
  }
850
941
  let r = a;
851
- if (e.system && (r = a.filter((s)=>v(e.system, s.system)), r.length === 0)) {
942
+ if (e.system && (r = a.filter((s)=>h(e.system, s.system)), r.length === 0)) {
852
943
  const s = [
853
- ...new Set(a.map((l)=>l.system))
944
+ ...new Set(a.map((o)=>o.system))
854
945
  ].join(", ");
855
946
  return {
856
947
  passed: !1,
@@ -868,28 +959,28 @@ let __tla = Promise.all([
868
959
  };
869
960
  }
870
961
  if (e.value) {
871
- const s = r.filter((l)=>v(e.value, l.value));
962
+ const s = r.filter((o)=>h(e.value, o.value));
872
963
  if (s.length === 0) {
873
- const l = r.map((o)=>o.value).join(", ");
964
+ const o = r.map((l)=>l.value).join(", ");
874
965
  return {
875
966
  passed: !1,
876
- actualValue: l || "(none)",
967
+ actualValue: o || "(none)",
877
968
  expectedValue: p(e.value),
878
969
  failure: {
879
970
  type: "CLASSIFICATION_VALUE_MISMATCH",
880
971
  field: "value",
881
- actual: l,
972
+ actual: o,
882
973
  expected: p(e.value),
883
974
  context: {
884
975
  system: e.system ? p(e.system) : "any",
885
- availableValues: l
976
+ availableValues: o
886
977
  }
887
978
  }
888
979
  };
889
980
  }
890
981
  return {
891
982
  passed: !0,
892
- actualValue: s.map((l)=>`${l.system}:${l.value}`).join(", "),
983
+ actualValue: s.map((o)=>`${o.system}:${o.value}`).join(", "),
893
984
  expectedValue: e.system ? `${p(e.system)}:${p(e.value)}` : p(e.value)
894
985
  };
895
986
  }
@@ -899,7 +990,7 @@ let __tla = Promise.all([
899
990
  expectedValue: p(e.system)
900
991
  };
901
992
  }
902
- function It(e, t, i) {
993
+ function Jt(e, t, i) {
903
994
  const a = i.getMaterials(t);
904
995
  if (!e.value) return a.length === 0 ? {
905
996
  passed: !1,
@@ -914,7 +1005,7 @@ let __tla = Promise.all([
914
1005
  actualValue: a.map((r)=>r.name).join(", "),
915
1006
  expectedValue: "any material"
916
1007
  };
917
- const n = a.filter((r)=>v(e.value, r.name) || r.category && v(e.value, r.category));
1008
+ const n = a.filter((r)=>h(e.value, r.name) || r.category && h(e.value, r.category));
918
1009
  if (n.length === 0) {
919
1010
  if (a.length === 0) return {
920
1011
  passed: !1,
@@ -947,9 +1038,9 @@ let __tla = Promise.all([
947
1038
  expectedValue: p(e.value)
948
1039
  };
949
1040
  }
950
- const H = {
1041
+ const oe = {
951
1042
  caseInsensitive: !0
952
- }, L = {
1043
+ }, U = {
953
1044
  IfcRelAggregates: "aggregated in",
954
1045
  IfcRelAssignsToGroup: "grouped in",
955
1046
  IfcRelContainedInSpatialStructure: "contained in",
@@ -957,14 +1048,14 @@ let __tla = Promise.all([
957
1048
  IfcRelVoidsElement: "voiding",
958
1049
  IfcRelFillsElement: "filling"
959
1050
  };
960
- function bt(e, t, i) {
1051
+ function Zt(e, t, i) {
961
1052
  const a = i.getAncestors ? i.getAncestors(t, e.relation) : [];
962
1053
  if (a.length === 0) {
963
1054
  const r = i.getParent(t, e.relation);
964
1055
  r && a.push(r);
965
1056
  }
966
1057
  if (a.length === 0) {
967
- const r = L[e.relation] || e.relation, s = e.entity ? p(e.entity.name) : "any entity";
1058
+ const r = U[e.relation] || e.relation, s = e.entity ? p(e.entity.name) : "any entity";
968
1059
  return {
969
1060
  passed: !1,
970
1061
  actualValue: "(no parent)",
@@ -981,23 +1072,23 @@ let __tla = Promise.all([
981
1072
  }
982
1073
  let n;
983
1074
  for (const r of a){
984
- const s = gt(e, r);
1075
+ const s = ei(e, r);
985
1076
  if (s.passed) return s;
986
1077
  (!n || s.failure?.type !== "PARTOF_ENTITY_MISMATCH" && n.failure?.type === "PARTOF_ENTITY_MISMATCH") && (n = s);
987
1078
  }
988
1079
  return n;
989
1080
  }
990
- function gt(e, t) {
1081
+ function ei(e, t) {
991
1082
  if (!e.entity) {
992
- const n = L[e.relation] || e.relation;
1083
+ const n = U[e.relation] || e.relation;
993
1084
  return {
994
1085
  passed: !0,
995
1086
  actualValue: `${n} ${t.entityType}`,
996
1087
  expectedValue: `${n} any entity`
997
1088
  };
998
1089
  }
999
- if (!v(e.entity.name, t.entityType, H)) {
1000
- const n = L[e.relation] || e.relation;
1090
+ if (!h(e.entity.name, t.entityType, oe)) {
1091
+ const n = U[e.relation] || e.relation;
1001
1092
  return {
1002
1093
  passed: !1,
1003
1094
  actualValue: `${n} ${t.entityType}`,
@@ -1029,7 +1120,7 @@ let __tla = Promise.all([
1029
1120
  }
1030
1121
  }
1031
1122
  };
1032
- if (!v(e.entity.predefinedType, t.predefinedType, H)) return {
1123
+ if (!h(e.entity.predefinedType, t.predefinedType, oe)) return {
1033
1124
  passed: !1,
1034
1125
  actualValue: `${t.entityType}[${t.predefinedType}]`,
1035
1126
  expectedValue: `${p(e.entity.name)}[${p(e.entity.predefinedType)}]`,
@@ -1045,27 +1136,27 @@ let __tla = Promise.all([
1045
1136
  }
1046
1137
  };
1047
1138
  }
1048
- const i = L[e.relation] || e.relation, a = t.predefinedType ? `${t.entityType}[${t.predefinedType}]` : t.entityType;
1139
+ const i = U[e.relation] || e.relation, a = t.predefinedType ? `${t.entityType}[${t.predefinedType}]` : t.entityType;
1049
1140
  return {
1050
1141
  passed: !0,
1051
1142
  actualValue: `${i} ${a}`,
1052
1143
  expectedValue: `${i} ${p(e.entity.name)}`
1053
1144
  };
1054
1145
  }
1055
- function le(e, t, i) {
1146
+ function Me(e, t, i) {
1056
1147
  switch(e.type){
1057
1148
  case "entity":
1058
- return tt(e, t, i);
1149
+ return Nt(e, t, i);
1059
1150
  case "attribute":
1060
- return dt(e, t, i);
1151
+ return Ut(e, t, i);
1061
1152
  case "property":
1062
- return ht(e, t, i);
1153
+ return Wt(e, t, i);
1063
1154
  case "classification":
1064
- return Tt(e, t, i);
1155
+ return Qt(e, t, i);
1065
1156
  case "material":
1066
- return It(e, t, i);
1157
+ return Jt(e, t, i);
1067
1158
  case "partOf":
1068
- return bt(e, t, i);
1159
+ return Zt(e, t, i);
1069
1160
  default:
1070
1161
  return {
1071
1162
  passed: !1,
@@ -1077,112 +1168,259 @@ let __tla = Promise.all([
1077
1168
  };
1078
1169
  }
1079
1170
  }
1080
- function St(e, t) {
1171
+ function ti(e, t, i) {
1172
+ switch(e.type){
1173
+ case "entity":
1174
+ return Rt(e, t, i);
1175
+ case "property":
1176
+ return jt(e, t, i);
1177
+ default:
1178
+ return Me(e, t, i).passed;
1179
+ }
1180
+ }
1181
+ function ii(e, t) {
1081
1182
  switch(e.type){
1082
1183
  case "entity":
1083
- return it(e, t);
1184
+ return Pt(e, t);
1084
1185
  default:
1085
1186
  return;
1086
1187
  }
1087
1188
  }
1088
- oa = async function(e, t, i, a = {}) {
1089
- const { translator: n, onProgress: r, includePassingEntities: s = !0 } = a, l = [], o = e.specifications.length;
1090
- for(let c = 0; c < o; c++){
1091
- const m = e.specifications[c];
1189
+ const Ne = "\0";
1190
+ function B(e) {
1191
+ return W(e) || z(e);
1192
+ }
1193
+ function le(e) {
1194
+ if (e.propertySet.type === "simpleValue" && e.baseName.type === "simpleValue" && !(B(e.propertySet.value) || B(e.baseName.value))) return e.propertySet.value + Ne + e.baseName.value;
1195
+ }
1196
+ class ai {
1197
+ constructor(t, i){
1198
+ this.accessor = t;
1199
+ for (const a of i.specifications)for (const n of a.applicability.facets){
1200
+ if (n.type !== "property") continue;
1201
+ const r = le(n);
1202
+ r !== void 0 && this.keys.add(r);
1203
+ }
1204
+ }
1205
+ keys = new Set;
1206
+ indexed = new Set;
1207
+ hasProp = new Map;
1208
+ byValue = new Map;
1209
+ async ensureIndexed(t, i, a) {
1210
+ if (this.keys.size === 0) return;
1211
+ let n = 0;
1212
+ for(let r = 0; r < t.length; r++){
1213
+ const s = t[r];
1214
+ if (this.indexed.has(s)) continue;
1215
+ this.indexed.add(s), n++, (n & 511) === 0 && (a?.(r + 1, t.length), await i());
1216
+ const o = this.accessor.getPropertySets(s);
1217
+ for (const l of o)for (const u of l.properties){
1218
+ const c = l.name + Ne + u.name;
1219
+ if (!this.keys.has(c)) continue;
1220
+ let m = this.hasProp.get(c);
1221
+ m || (m = new Set, this.hasProp.set(c, m)), m.add(s);
1222
+ const d = u.values && u.values.length > 0 ? u.values : [
1223
+ u.value
1224
+ ];
1225
+ let y = this.byValue.get(c);
1226
+ y || (y = new Map, this.byValue.set(c, y));
1227
+ for (const f of d){
1228
+ if (f == null || f === "") continue;
1229
+ const T = String(f);
1230
+ let E = y.get(T);
1231
+ E || (E = new Set, y.set(T, E)), E.add(s);
1232
+ }
1233
+ }
1234
+ }
1235
+ }
1236
+ async narrow(t, i, a, n) {
1237
+ const r = le(t);
1238
+ if (r === void 0 || !this.keys.has(r)) return;
1239
+ await this.ensureIndexed(i, a, n);
1240
+ const s = t.value;
1241
+ let o;
1242
+ if (s && s.type === "simpleValue" && !B(s.value)) o = this.byValue.get(r)?.get(s.value) ?? new Set;
1243
+ else if (s && s.type === "enumeration" && !s.values.some(B)) {
1244
+ const l = this.byValue.get(r);
1245
+ if (o = new Set, l) for (const u of s.values){
1246
+ const c = l.get(u);
1247
+ if (c) for (const m of c)o.add(m);
1248
+ }
1249
+ } else o = this.hasProp.get(r) ?? new Set;
1250
+ return o.size === 0 ? [] : i.filter((l)=>o.has(l));
1251
+ }
1252
+ }
1253
+ function A(e) {
1254
+ const t = new Map;
1255
+ return (i)=>{
1256
+ if (t.has(i)) return t.get(i);
1257
+ const a = e(i);
1258
+ return t.set(i, a), a;
1259
+ };
1260
+ }
1261
+ function O(e) {
1262
+ const t = new Map;
1263
+ return (i, a)=>{
1264
+ const n = `${i}\0${a}`;
1265
+ if (t.has(n)) return t.get(n);
1266
+ const r = e(i, a);
1267
+ return t.set(n, r), r;
1268
+ };
1269
+ }
1270
+ function ni(e) {
1271
+ let t;
1272
+ const i = new Map, a = {
1273
+ getEntityType: A((n)=>e.getEntityType(n)),
1274
+ getEntityName: A((n)=>e.getEntityName(n)),
1275
+ getGlobalId: A((n)=>e.getGlobalId(n)),
1276
+ getDescription: A((n)=>e.getDescription(n)),
1277
+ getObjectType: A((n)=>e.getObjectType(n)),
1278
+ getPropertySets: A((n)=>e.getPropertySets(n)),
1279
+ getClassifications: A((n)=>e.getClassifications(n)),
1280
+ getMaterials: A((n)=>e.getMaterials(n)),
1281
+ getAttribute: O((n, r)=>e.getAttribute(n, r)),
1282
+ getParent: O((n, r)=>e.getParent(n, r)),
1283
+ getPropertyValue: (n, r, s)=>e.getPropertyValue(n, r, s),
1284
+ getEntitiesByType (n) {
1285
+ let r = i.get(n);
1286
+ return r || (r = e.getEntitiesByType(n), i.set(n, r)), r;
1287
+ },
1288
+ getAllEntityIds () {
1289
+ return t || (t = e.getAllEntityIds()), t;
1290
+ }
1291
+ };
1292
+ return e.getPredefinedTypeRaw && (a.getPredefinedTypeRaw = A((n)=>e.getPredefinedTypeRaw(n))), e.getAttributeNames && (a.getAttributeNames = A((n)=>e.getAttributeNames(n))), e.getAttributeXsdTypes && (a.getAttributeXsdTypes = O((n, r)=>e.getAttributeXsdTypes(n, r))), e.getAncestors && (a.getAncestors = O((n, r)=>e.getAncestors(n, r))), a;
1293
+ }
1294
+ const H = ()=>typeof globalThis.performance?.now == "function" ? globalThis.performance.now() : Date.now();
1295
+ function ri() {
1296
+ return new Promise((e)=>{
1297
+ const t = new MessageChannel;
1298
+ t.port1.onmessage = ()=>{
1299
+ t.port1.close(), t.port2.close(), e();
1300
+ }, t.port2.postMessage(null);
1301
+ });
1302
+ }
1303
+ function si(e) {
1304
+ let t = H();
1305
+ return ()=>{
1306
+ if (!(H() - t < e)) return ri().then(()=>{
1307
+ t = H();
1308
+ });
1309
+ };
1310
+ }
1311
+ Ga = async function(e, t, i, a = {}) {
1312
+ const { translator: n, onProgress: r, includePassingEntities: s = !0 } = a, o = ni(t), l = new Map, u = si(a.yieldEveryMs ?? 40), c = new ai(o, e), m = [], d = e.specifications.length;
1313
+ for(let f = 0; f < d; f++){
1314
+ const T = e.specifications[f];
1092
1315
  r && r({
1093
1316
  phase: "filtering",
1094
- specificationIndex: c,
1095
- totalSpecifications: o,
1317
+ specificationIndex: f,
1318
+ totalSpecifications: d,
1096
1319
  entitiesProcessed: 0,
1097
1320
  totalEntities: 0,
1098
- percentage: Math.floor(c / o * 100)
1099
- });
1100
- const d = await At(m, t, i, a, (f)=>{
1321
+ percentage: Math.floor(f / d * 100)
1322
+ }), await u();
1323
+ const E = await oi(T, o, i, a, l, u, c, (b)=>{
1101
1324
  r && r({
1102
- ...f,
1103
- specificationIndex: c,
1104
- totalSpecifications: o,
1105
- percentage: Math.floor((c + f.entitiesProcessed / Math.max(f.totalEntities, 1)) / o * 100)
1325
+ ...b,
1326
+ specificationIndex: f,
1327
+ totalSpecifications: d,
1328
+ percentage: Math.floor((f + b.entitiesProcessed / Math.max(b.totalEntities, 1)) / d * 100)
1106
1329
  });
1107
1330
  });
1108
- l.push(d);
1331
+ m.push(E);
1109
1332
  }
1110
1333
  r && r({
1111
1334
  phase: "complete",
1112
- specificationIndex: o,
1113
- totalSpecifications: o,
1335
+ specificationIndex: d,
1336
+ totalSpecifications: d,
1114
1337
  entitiesProcessed: 0,
1115
1338
  totalEntities: 0,
1116
1339
  percentage: 100
1117
1340
  });
1118
- const u = Nt(l);
1341
+ const y = di(m);
1119
1342
  return {
1120
1343
  document: e,
1121
1344
  modelInfo: i,
1122
1345
  timestamp: new Date,
1123
- summary: u,
1124
- specificationResults: l
1346
+ summary: y,
1347
+ specificationResults: m
1125
1348
  };
1126
1349
  };
1127
- async function At(e, t, i, a, n) {
1128
- const { translator: r, maxEntities: s, includePassingEntities: l = !0 } = a, o = i.modelId, u = xt(e, t), c = s ? u.slice(0, s) : u, m = [], d = c.length;
1129
- for(let I = 0; I < d; I++){
1130
- const b = c[I];
1131
- n && I % 100 === 0 && n({
1350
+ async function oi(e, t, i, a, n, r, s, o) {
1351
+ const { translator: l, maxEntities: u, includePassingEntities: c = !0 } = a, m = i.modelId, d = await li(e, t, r, s, o), y = u ? d.slice(0, u) : d, f = [], T = y.length;
1352
+ for(let N = 0; N < T; N++){
1353
+ const Ve = y[N];
1354
+ o && N % 100 === 0 && o({
1132
1355
  phase: "validating",
1133
- entitiesProcessed: I,
1134
- totalEntities: d
1135
- });
1136
- const P = Ct(e, b, o, t, r);
1137
- (l || !P.passed) && m.push(P);
1138
- }
1139
- let f = 0, y = 0;
1140
- for (const I of m)I.passed ? f++ : y++;
1141
- l || (f = d - y);
1142
- const M = Mt(e, u.length);
1143
- let x = "pass";
1144
- u.length === 0 ? M?.passed === !1 ? x = "fail" : M?.passed === !0 ? x = "pass" : x = "not_applicable" : (y > 0 || M?.passed === !1) && (x = "fail");
1145
- const _ = d > 0 ? Math.floor(f / d * 100) : 100;
1356
+ entitiesProcessed: N,
1357
+ totalEntities: T
1358
+ }), (N & 31) === 0 && await r();
1359
+ const Q = ui(e, Ve, m, t, n, l);
1360
+ (c || !Q.passed) && f.push(Q);
1361
+ }
1362
+ let E = 0, b = 0;
1363
+ for (const N of f)N.passed ? E++ : b++;
1364
+ c || (E = T - b);
1365
+ const _ = pi(e, d.length);
1366
+ let g = "pass";
1367
+ d.length === 0 ? _?.passed === !1 ? g = "fail" : _?.passed === !0 ? g = "pass" : g = "not_applicable" : (b > 0 || _?.passed === !1) && (g = "fail");
1368
+ const F = T > 0 ? Math.floor(E / T * 100) : 100;
1146
1369
  return {
1147
1370
  specification: e,
1148
- status: x,
1149
- applicableCount: u.length,
1150
- passedCount: f,
1151
- failedCount: y,
1152
- passRate: _,
1153
- entityResults: m,
1154
- cardinalityResult: M
1371
+ status: g,
1372
+ applicableCount: d.length,
1373
+ passedCount: E,
1374
+ failedCount: b,
1375
+ passRate: F,
1376
+ entityResults: f,
1377
+ cardinalityResult: _
1155
1378
  };
1156
1379
  }
1157
- function xt(e, t) {
1158
- const i = e.applicability.facets;
1159
- if (i.length === 0) return t.getAllEntityIds();
1160
- let a;
1161
- for (const r of i){
1162
- const s = St(r, t);
1163
- if (s !== void 0) {
1164
- a = s;
1380
+ async function li(e, t, i, a, n) {
1381
+ const r = e.applicability.facets;
1382
+ if (r.length === 0) return t.getAllEntityIds();
1383
+ let s;
1384
+ for (const u of r){
1385
+ const c = ii(u, t);
1386
+ if (c !== void 0) {
1387
+ s = c;
1165
1388
  break;
1166
1389
  }
1167
1390
  }
1168
- a === void 0 && (a = t.getAllEntityIds());
1169
- const n = [];
1170
- for (const r of a){
1171
- let s = !0;
1172
- for (const l of i)if (!le(l, r, t).passed) {
1173
- s = !1;
1391
+ s === void 0 && (s = t.getAllEntityIds());
1392
+ for (const u of r){
1393
+ if (u.type !== "property") continue;
1394
+ const c = await a.narrow(u, s, i, n ? (m, d)=>n({
1395
+ phase: "filtering",
1396
+ entitiesProcessed: m,
1397
+ totalEntities: d
1398
+ }) : void 0);
1399
+ c !== void 0 && (s = c);
1400
+ }
1401
+ const o = [], l = s.length;
1402
+ for(let u = 0; u < l; u++){
1403
+ const c = s[u];
1404
+ n && l > 8192 && (u & 8191) === 0 && n({
1405
+ phase: "filtering",
1406
+ entitiesProcessed: u,
1407
+ totalEntities: l
1408
+ }), (u & 255) === 0 && await i();
1409
+ let m = !0;
1410
+ for (const d of r)if (!ti(d, c, t)) {
1411
+ m = !1;
1174
1412
  break;
1175
1413
  }
1176
- s && n.push(r);
1414
+ m && o.push(c);
1177
1415
  }
1178
- return n;
1416
+ return o;
1179
1417
  }
1180
- function Ct(e, t, i, a, n) {
1181
- const r = [];
1182
- let s = !0;
1418
+ function ui(e, t, i, a, n, r) {
1419
+ const s = [];
1420
+ let o = !0;
1183
1421
  for (const l of e.requirements){
1184
- const o = Rt(l, t, a, n);
1185
- r.push(o), o.status === "fail" && (s = !1);
1422
+ const u = ci(l, t, a, n, r);
1423
+ s.push(u), u.status === "fail" && (o = !1);
1186
1424
  }
1187
1425
  return {
1188
1426
  expressId: t,
@@ -1190,29 +1428,29 @@ let __tla = Promise.all([
1190
1428
  entityType: a.getEntityType(t) || "Unknown",
1191
1429
  entityName: a.getEntityName(t),
1192
1430
  globalId: a.getGlobalId(t),
1193
- passed: s,
1194
- requirementResults: r
1431
+ passed: o,
1432
+ requirementResults: s
1195
1433
  };
1196
1434
  }
1197
- function Rt(e, t, i, a) {
1198
- const n = le(e.facet, t, i);
1199
- let r, s;
1435
+ function ci(e, t, i, a, n) {
1436
+ const r = Me(e.facet, t, i);
1437
+ let s, o;
1200
1438
  switch(e.optionality){
1201
1439
  case "required":
1202
- r = n.passed ? "pass" : "fail", n.passed || (s = a ? a.describeFailure({
1440
+ s = r.passed ? "pass" : "fail", r.passed || (o = n ? n.describeFailure({
1203
1441
  requirement: e,
1204
1442
  status: "fail",
1205
1443
  facetType: e.facet.type,
1206
1444
  checkedDescription: "",
1207
- actualValue: n.actualValue,
1208
- expectedValue: n.expectedValue,
1209
- failure: n.failure
1210
- }) : G(n));
1445
+ actualValue: r.actualValue,
1446
+ expectedValue: r.expectedValue,
1447
+ failure: r.failure
1448
+ }) : ue(r));
1211
1449
  break;
1212
1450
  case "optional":
1213
- if (n.passed) r = "pass";
1451
+ if (r.passed) s = "pass";
1214
1452
  else {
1215
- const o = new Set([
1453
+ const u = new Set([
1216
1454
  "ATTRIBUTE_MISSING",
1217
1455
  "PROPERTY_MISSING",
1218
1456
  "PSET_MISSING",
@@ -1220,38 +1458,38 @@ let __tla = Promise.all([
1220
1458
  "MATERIAL_MISSING",
1221
1459
  "PARTOF_RELATION_MISSING"
1222
1460
  ]);
1223
- n.failure?.type && o.has(n.failure.type) ? r = "pass" : (r = "fail", s = a ? a.describeFailure({
1461
+ r.failure?.type && u.has(r.failure.type) ? s = "pass" : (s = "fail", o = n ? n.describeFailure({
1224
1462
  requirement: e,
1225
1463
  status: "fail",
1226
1464
  facetType: e.facet.type,
1227
1465
  checkedDescription: "",
1228
- actualValue: n.actualValue,
1229
- expectedValue: n.expectedValue,
1230
- failure: n.failure
1231
- }) : G(n));
1466
+ actualValue: r.actualValue,
1467
+ expectedValue: r.expectedValue,
1468
+ failure: r.failure
1469
+ }) : ue(r));
1232
1470
  }
1233
1471
  break;
1234
1472
  case "prohibited":
1235
- r = n.passed ? "fail" : "pass", r === "fail" && (s = a ? a.t("failures.prohibited", {
1236
- field: n.actualValue || "value"
1237
- }) : `Prohibited: found ${n.actualValue}`);
1473
+ s = r.passed ? "fail" : "pass", s === "fail" && (o = n ? n.t("failures.prohibited", {
1474
+ field: r.actualValue || "value"
1475
+ }) : `Prohibited: found ${r.actualValue}`);
1238
1476
  break;
1239
1477
  default:
1240
- r = n.passed ? "pass" : "fail";
1478
+ s = r.passed ? "pass" : "fail";
1241
1479
  }
1242
- const l = a ? a.describeRequirement(e) : _t(e);
1243
- return {
1480
+ let l = a.get(e);
1481
+ return l === void 0 && (l = n ? n.describeRequirement(e) : mi(e), a.set(e, l)), {
1244
1482
  requirement: e,
1245
- status: r,
1483
+ status: s,
1246
1484
  facetType: e.facet.type,
1247
1485
  checkedDescription: l,
1248
- failureReason: s,
1249
- actualValue: n.actualValue,
1250
- expectedValue: n.expectedValue,
1251
- failure: n.failure
1486
+ failureReason: o,
1487
+ actualValue: r.actualValue,
1488
+ expectedValue: r.expectedValue,
1489
+ failure: r.failure
1252
1490
  };
1253
1491
  }
1254
- function Mt(e, t) {
1492
+ function pi(e, t) {
1255
1493
  if (e.minOccurs === void 0 && e.maxOccurs === void 0) return;
1256
1494
  const i = e.minOccurs ?? 0, a = e.maxOccurs;
1257
1495
  let n = !0;
@@ -1264,10 +1502,10 @@ let __tla = Promise.all([
1264
1502
  message: r.length > 0 ? r.join("; ") : "Cardinality satisfied"
1265
1503
  };
1266
1504
  }
1267
- function Nt(e) {
1505
+ function di(e) {
1268
1506
  let t = e.length, i = 0, a = 0, n = 0, r = 0, s = 0;
1269
- for (const o of e)o.status === "pass" ? i++ : o.status === "fail" && a++, n += o.applicableCount, r += o.passedCount, s += o.failedCount;
1270
- const l = n > 0 ? Math.floor(r / n * 100) : 100;
1507
+ for (const l of e)l.status === "pass" ? i++ : l.status === "fail" && a++, n += l.applicableCount, r += l.passedCount, s += l.failedCount;
1508
+ const o = n > 0 ? Math.floor(r / n * 100) : 100;
1271
1509
  return {
1272
1510
  totalSpecifications: t,
1273
1511
  passedSpecifications: i,
@@ -1275,10 +1513,10 @@ let __tla = Promise.all([
1275
1513
  totalEntitiesChecked: n,
1276
1514
  totalEntitiesPassed: r,
1277
1515
  totalEntitiesFailed: s,
1278
- overallPassRate: l
1516
+ overallPassRate: o
1279
1517
  };
1280
1518
  }
1281
- function G(e) {
1519
+ function ue(e) {
1282
1520
  if (!e.failure) return `Expected ${e.expectedValue}, got ${e.actualValue}`;
1283
1521
  const { type: t, field: i, actual: a, expected: n } = e.failure;
1284
1522
  switch(t){
@@ -1326,7 +1564,7 @@ let __tla = Promise.all([
1326
1564
  return `Validation failed: ${t}`;
1327
1565
  }
1328
1566
  }
1329
- function _t(e) {
1567
+ function mi(e) {
1330
1568
  const t = e.facet, i = e.optionality;
1331
1569
  let a;
1332
1570
  switch(t.type){
@@ -1356,7 +1594,7 @@ let __tla = Promise.all([
1356
1594
  }
1357
1595
  return i === "prohibited" ? a = a.replace("Must", "Must NOT").replace("must", "must NOT") : i === "optional" && (a = a.replace("Must", "Should").replace("must", "should")), a;
1358
1596
  }
1359
- function Pt(e) {
1597
+ function fi(e) {
1360
1598
  if (/\[[^\]]*-\[/.test(e)) return {
1361
1599
  pattern: e,
1362
1600
  supported: !1,
@@ -1366,7 +1604,7 @@ let __tla = Promise.all([
1366
1604
  for(; i < e.length;){
1367
1605
  const a = e.charAt(i);
1368
1606
  if (a === "\\" && i + 1 < e.length) {
1369
- const n = e.charAt(i + 1), r = $t(n);
1607
+ const n = e.charAt(i + 1), r = yi(n);
1370
1608
  if (r) {
1371
1609
  t += r, i += 2;
1372
1610
  continue;
@@ -1382,7 +1620,7 @@ let __tla = Promise.all([
1382
1620
  reason: ""
1383
1621
  };
1384
1622
  }
1385
- function $t(e) {
1623
+ function yi(e) {
1386
1624
  switch(e){
1387
1625
  case "i":
1388
1626
  return "[\\p{L}_:]";
@@ -1404,13 +1642,13 @@ let __tla = Promise.all([
1404
1642
  return;
1405
1643
  }
1406
1644
  }
1407
- function wt(e) {
1645
+ function hi(e) {
1408
1646
  if (e === "") return {
1409
1647
  ok: !1,
1410
1648
  severity: "error",
1411
1649
  reason: "pattern is empty"
1412
1650
  };
1413
- const t = Pt(e);
1651
+ const t = fi(e);
1414
1652
  if (!t.supported) return {
1415
1653
  ok: !1,
1416
1654
  severity: "warning",
@@ -1429,13 +1667,13 @@ let __tla = Promise.all([
1429
1667
  };
1430
1668
  }
1431
1669
  }
1432
- function Ft(e) {
1670
+ function vi(e) {
1433
1671
  const t = [];
1434
1672
  return e.specifications.forEach((i, a)=>{
1435
- Ot(i, `specifications[${a}]`, t);
1673
+ Ei(i, `specifications[${a}]`, t);
1436
1674
  }), t;
1437
1675
  }
1438
- function Ot(e, t, i) {
1676
+ function Ei(e, t, i) {
1439
1677
  const a = e.minOccurs, n = e.maxOccurs;
1440
1678
  a !== void 0 && (!Number.isInteger(a) || a < 0) && i.push({
1441
1679
  severity: "error",
@@ -1468,12 +1706,12 @@ let __tla = Promise.all([
1468
1706
  message: `cardinality="${e.applicability.cardinality}" has no effect on <applicability>`,
1469
1707
  path: `${t}.applicability.cardinality`
1470
1708
  }), e.applicability.facets.forEach((r, s)=>{
1471
- k(r, `${t}.applicability.facets[${s}]`, i);
1709
+ X(r, `${t}.applicability.facets[${s}]`, i);
1472
1710
  }), e.requirements.forEach((r, s)=>{
1473
- k(r.facet, `${t}.requirements[${s}]`, i), Lt(r, `${t}.requirements[${s}]`, i);
1711
+ X(r.facet, `${t}.requirements[${s}]`, i), gi(r, `${t}.requirements[${s}]`, i);
1474
1712
  });
1475
1713
  }
1476
- function Lt(e, t, i) {
1714
+ function gi(e, t, i) {
1477
1715
  switch(e.cardinalityRaw !== void 0 && i.push({
1478
1716
  severity: "error",
1479
1717
  code: "E_CARDINALITY_INVALID",
@@ -1504,7 +1742,7 @@ let __tla = Promise.all([
1504
1742
  }
1505
1743
  case "material":
1506
1744
  {
1507
- e.optionality === "optional" && (e.facet.value !== void 0 && !D(e.facet.value) || i.push({
1745
+ e.optionality === "optional" && (e.facet.value !== void 0 && !Y(e.facet.value) || i.push({
1508
1746
  severity: "error",
1509
1747
  code: "E_CARDINALITY_INVALID",
1510
1748
  message: "optional <material> requirement must specify a non-empty <value> constraint",
@@ -1516,7 +1754,7 @@ let __tla = Promise.all([
1516
1754
  case "classification":
1517
1755
  {
1518
1756
  if (e.optionality === "optional") {
1519
- const a = e.facet.system !== void 0 && !D(e.facet.system), n = e.facet.value !== void 0 && !D(e.facet.value);
1757
+ const a = e.facet.system !== void 0 && !Y(e.facet.system), n = e.facet.value !== void 0 && !Y(e.facet.value);
1520
1758
  !a && !n && i.push({
1521
1759
  severity: "error",
1522
1760
  code: "E_CARDINALITY_INVALID",
@@ -1529,7 +1767,7 @@ let __tla = Promise.all([
1529
1767
  }
1530
1768
  }
1531
1769
  }
1532
- function D(e) {
1770
+ function Y(e) {
1533
1771
  switch(e.type){
1534
1772
  case "simpleValue":
1535
1773
  return e.value === "" || e.value == null;
@@ -1541,29 +1779,29 @@ let __tla = Promise.all([
1541
1779
  return e.minInclusive === void 0 && e.maxInclusive === void 0 && e.minExclusive === void 0 && e.maxExclusive === void 0 && e.length === void 0 && e.minLength === void 0 && e.maxLength === void 0;
1542
1780
  }
1543
1781
  }
1544
- function k(e, t, i) {
1782
+ function X(e, t, i) {
1545
1783
  switch(e.type){
1546
1784
  case "entity":
1547
- E(e.name, `${t}.name`, i, e.type), e.predefinedType && E(e.predefinedType, `${t}.predefinedType`, i, e.type);
1785
+ I(e.name, `${t}.name`, i, e.type), e.predefinedType && I(e.predefinedType, `${t}.predefinedType`, i, e.type);
1548
1786
  break;
1549
1787
  case "attribute":
1550
- E(e.name, `${t}.name`, i, e.type), e.value && E(e.value, `${t}.value`, i, e.type);
1788
+ I(e.name, `${t}.name`, i, e.type), e.value && I(e.value, `${t}.value`, i, e.type);
1551
1789
  break;
1552
1790
  case "property":
1553
- E(e.propertySet, `${t}.propertySet`, i, e.type), E(e.baseName, `${t}.baseName`, i, e.type), e.dataType && E(e.dataType, `${t}.dataType`, i, e.type), e.value && E(e.value, `${t}.value`, i, e.type);
1791
+ I(e.propertySet, `${t}.propertySet`, i, e.type), I(e.baseName, `${t}.baseName`, i, e.type), e.dataType && I(e.dataType, `${t}.dataType`, i, e.type), e.value && I(e.value, `${t}.value`, i, e.type);
1554
1792
  break;
1555
1793
  case "classification":
1556
- e.system && E(e.system, `${t}.system`, i, e.type), e.value && E(e.value, `${t}.value`, i, e.type);
1794
+ e.system && I(e.system, `${t}.system`, i, e.type), e.value && I(e.value, `${t}.value`, i, e.type);
1557
1795
  break;
1558
1796
  case "material":
1559
- e.value && E(e.value, `${t}.value`, i, e.type);
1797
+ e.value && I(e.value, `${t}.value`, i, e.type);
1560
1798
  break;
1561
1799
  case "partOf":
1562
- e.entity && k(e.entity, `${t}.entity`, i);
1800
+ e.entity && X(e.entity, `${t}.entity`, i);
1563
1801
  break;
1564
1802
  }
1565
1803
  }
1566
- function E(e, t, i, a) {
1804
+ function I(e, t, i, a) {
1567
1805
  switch(e.type){
1568
1806
  case "enumeration":
1569
1807
  if (e.values.length === 0 ? i.push({
@@ -1578,7 +1816,7 @@ let __tla = Promise.all([
1578
1816
  message: "xs:enumeration has an empty entry",
1579
1817
  path: t,
1580
1818
  facetType: a
1581
- }), e.base) for (const n of e.values)n == null || n === "" || kt(n, e.base) || i.push({
1819
+ }), e.base) for (const n of e.values)n == null || n === "" || Si(n, e.base) || i.push({
1582
1820
  severity: "error",
1583
1821
  code: "E_RESTRICTION_VALUE_MISMATCH",
1584
1822
  message: `xs:enumeration value "${n}" is not valid for xs:restriction @base="${e.base}"`,
@@ -1591,14 +1829,14 @@ let __tla = Promise.all([
1591
1829
  });
1592
1830
  break;
1593
1831
  case "bounds":
1594
- Vt(e, t, i, a);
1832
+ Ti(e, t, i, a);
1595
1833
  break;
1596
1834
  case "pattern":
1597
- Dt(e.pattern, t, i, a);
1835
+ bi(e.pattern, t, i, a);
1598
1836
  break;
1599
1837
  }
1600
1838
  }
1601
- function Vt(e, t, i, a) {
1839
+ function Ti(e, t, i, a) {
1602
1840
  const n = e.minInclusive ?? e.minExclusive, r = e.maxInclusive ?? e.maxExclusive;
1603
1841
  typeof n == "number" && typeof r == "number" && n > r && i.push({
1604
1842
  severity: "error",
@@ -1634,8 +1872,8 @@ let __tla = Promise.all([
1634
1872
  facetType: a
1635
1873
  });
1636
1874
  }
1637
- function Dt(e, t, i, a) {
1638
- const n = wt(e);
1875
+ function bi(e, t, i, a) {
1876
+ const n = hi(e);
1639
1877
  if (!n.ok) {
1640
1878
  if (n.severity === "error") {
1641
1879
  i.push({
@@ -1662,7 +1900,7 @@ let __tla = Promise.all([
1662
1900
  });
1663
1901
  }
1664
1902
  }
1665
- const Ut = {
1903
+ const Ii = {
1666
1904
  "xs:integer": /^[+-]?(\d+)$/,
1667
1905
  "xs:double": /^([-+]?[0-9]*\.?[0-9]*([eE][-+]?[0-9]+)?|NaN|\+INF|-INF)$/,
1668
1906
  "xs:float": /^([-+]?[0-9]*\.?[0-9]*([eE][-+]?[0-9]+)?|NaN|\+INF|-INF)$/,
@@ -1673,20 +1911,20 @@ let __tla = Promise.all([
1673
1911
  "xs:time": /^\d{2}:\d{2}:\d{2}(\.\d+)?(Z|([+-]\d{2}:\d{2}))?$/,
1674
1912
  "xs:duration": /^[-+]?P(\d+Y)?(\d+M)?(\d+D)?(T(\d+H)?(\d+M)?(\d+S)?)?$/
1675
1913
  };
1676
- function kt(e, t) {
1677
- const i = Ut[t];
1914
+ function Si(e, t) {
1915
+ const i = Ii[t];
1678
1916
  return i ? (t === "xs:double" || t === "xs:float" || t === "xs:decimal") && !/[0-9]/.test(e) ? !1 : i.test(e) : !0;
1679
1917
  }
1680
- async function Bt(e, t) {
1918
+ async function Ai(e, t) {
1681
1919
  const i = [];
1682
1920
  for(let a = 0; a < e.specifications.length; a++){
1683
- const n = e.specifications[a], r = qt(n, t.ifcVersion);
1921
+ const n = e.specifications[a], r = xi(n, t.ifcVersion);
1684
1922
  if (r.length === 0) continue;
1685
1923
  const s = new Set;
1686
- for (const l of r){
1687
- const o = [];
1688
- await Yt(n, l, `specifications[${a}]`, o);
1689
- for (const u of o){
1924
+ for (const o of r){
1925
+ const l = [];
1926
+ await Ci(n, o, `specifications[${a}]`, l);
1927
+ for (const u of l){
1690
1928
  const c = `${u.code}|${u.path}|${u.message}`;
1691
1929
  s.has(c) || (s.add(c), i.push(u));
1692
1930
  }
@@ -1694,21 +1932,21 @@ let __tla = Promise.all([
1694
1932
  }
1695
1933
  return i;
1696
1934
  }
1697
- function qt(e, t) {
1935
+ function xi(e, t) {
1698
1936
  if (t) {
1699
- const n = X(t);
1937
+ const n = ce(t);
1700
1938
  return n ? [
1701
1939
  n
1702
1940
  ] : [];
1703
1941
  }
1704
1942
  const i = [], a = new Set;
1705
1943
  for (const n of e.ifcVersions){
1706
- const r = X(n);
1944
+ const r = ce(n);
1707
1945
  r && !a.has(r) && (a.add(r), i.push(r));
1708
1946
  }
1709
1947
  return i;
1710
1948
  }
1711
- function X(e) {
1949
+ function ce(e) {
1712
1950
  switch(e){
1713
1951
  case "IFC2X3":
1714
1952
  case "IFC4":
@@ -1719,40 +1957,40 @@ let __tla = Promise.all([
1719
1957
  return;
1720
1958
  }
1721
1959
  }
1722
- async function Yt(e, t, i, a) {
1960
+ async function Ci(e, t, i, a) {
1723
1961
  const n = e.applicability.facets.find((r)=>r.type === "entity");
1724
1962
  for(let r = 0; r < e.applicability.facets.length; r++){
1725
1963
  const s = e.applicability.facets[r];
1726
- await j(s, t, `${i}.applicability.facets[${r}]`, n, a);
1964
+ await pe(s, t, `${i}.applicability.facets[${r}]`, n, a);
1727
1965
  }
1728
1966
  for(let r = 0; r < e.requirements.length; r++){
1729
1967
  const s = e.requirements[r];
1730
- await j(s.facet, t, `${i}.requirements[${r}]`, n, a);
1968
+ await pe(s.facet, t, `${i}.requirements[${r}]`, n, a);
1731
1969
  }
1732
1970
  }
1733
- async function j(e, t, i, a, n) {
1971
+ async function pe(e, t, i, a, n) {
1734
1972
  switch(e.type){
1735
1973
  case "entity":
1736
- await Xt(e, t, i, n);
1974
+ await Ri(e, t, i, n);
1737
1975
  break;
1738
1976
  case "property":
1739
- await Wt(e, t, i, a, n);
1977
+ await _i(e, t, i, a, n);
1740
1978
  break;
1741
1979
  case "attribute":
1742
- await ti(e, t, i, a, n);
1980
+ await Di(e, t, i, a, n);
1743
1981
  break;
1744
1982
  case "partOf":
1745
- await ai(e, t, i, a, n);
1983
+ await ki(e, t, i, a, n);
1746
1984
  break;
1747
1985
  case "classification":
1748
- await Ht(t, a, i, n);
1986
+ await Mi(t, a, i, n);
1749
1987
  break;
1750
1988
  case "material":
1751
- await Gt(t, a, i, n);
1989
+ await Ni(t, a, i, n);
1752
1990
  break;
1753
1991
  }
1754
1992
  }
1755
- async function Ht(e, t, i, a) {
1993
+ async function Mi(e, t, i, a) {
1756
1994
  if (!t || t.name.type !== "simpleValue") return;
1757
1995
  const n = t.name.value;
1758
1996
  if (!n) return;
@@ -1770,7 +2008,7 @@ let __tla = Promise.all([
1770
2008
  }
1771
2009
  });
1772
2010
  }
1773
- async function Gt(e, t, i, a) {
2011
+ async function Ni(e, t, i, a) {
1774
2012
  if (!t || t.name.type !== "simpleValue") return;
1775
2013
  const n = t.name.value;
1776
2014
  if (!n) return;
@@ -1788,11 +2026,11 @@ let __tla = Promise.all([
1788
2026
  }
1789
2027
  });
1790
2028
  }
1791
- async function Xt(e, t, i, a) {
2029
+ async function Ri(e, t, i, a) {
1792
2030
  if (e.name.type !== "simpleValue") return;
1793
2031
  const n = e.name.value;
1794
2032
  if (!n) return;
1795
- const r = await Z(t, n);
2033
+ const r = await ve(t, n);
1796
2034
  if (!r) {
1797
2035
  a.push({
1798
2036
  severity: "error",
@@ -1807,9 +2045,9 @@ let __tla = Promise.all([
1807
2045
  });
1808
2046
  return;
1809
2047
  }
1810
- e.predefinedType && r.predefinedTypes.length > 0 && jt(e.predefinedType, r, t, `${i}.predefinedType`, a);
2048
+ e.predefinedType && r.predefinedTypes.length > 0 && Pi(e.predefinedType, r, t, `${i}.predefinedType`, a);
1811
2049
  }
1812
- function jt(e, t, i, a, n) {
2050
+ function Pi(e, t, i, a, n) {
1813
2051
  const r = (s)=>t.predefinedTypes.includes(s.toUpperCase());
1814
2052
  switch(e.type){
1815
2053
  case "simpleValue":
@@ -1849,7 +2087,7 @@ let __tla = Promise.all([
1849
2087
  {
1850
2088
  try {
1851
2089
  const s = new RegExp(`^${e.pattern}$`);
1852
- t.predefinedTypes.some((o)=>s.test(o)) || n.push({
2090
+ t.predefinedTypes.some((l)=>s.test(l)) || n.push({
1853
2091
  severity: "error",
1854
2092
  code: "E_IFC_PREDEF_TYPE_INVALID",
1855
2093
  message: `predefined type pattern "${e.pattern}" matches no value for ${t.name} (${i})`,
@@ -1866,19 +2104,19 @@ let __tla = Promise.all([
1866
2104
  }
1867
2105
  }
1868
2106
  }
1869
- async function Wt(e, t, i, a, n) {
2107
+ async function _i(e, t, i, a, n) {
1870
2108
  if (e.dataType && e.dataType.type === "simpleValue") {
1871
- const o = e.dataType.value;
1872
- if (o) {
1873
- const u = await Te(t, o);
1874
- u ? e.value && Kt(e.value, u.backingType, o, `${i}.value`, n) : n.push({
2109
+ const l = e.dataType.value;
2110
+ if (l) {
2111
+ const u = await Be(t, l);
2112
+ u ? e.value && $i(e.value, u.backingType, l, `${i}.value`, n) : n.push({
1875
2113
  severity: "error",
1876
2114
  code: "E_IFC_DATATYPE_UNKNOWN",
1877
- message: `dataType "${o}" is not a known IFC measure/type for ${t}`,
2115
+ message: `dataType "${l}" is not a known IFC measure/type for ${t}`,
1878
2116
  path: `${i}.dataType`,
1879
2117
  facetType: "property",
1880
2118
  detail: {
1881
- value: o,
2119
+ value: l,
1882
2120
  version: t
1883
2121
  }
1884
2122
  });
@@ -1887,9 +2125,9 @@ let __tla = Promise.all([
1887
2125
  if (e.propertySet.type !== "simpleValue") return;
1888
2126
  const r = e.propertySet.value;
1889
2127
  if (!r) return;
1890
- const s = await Ie(t, r), l = be.some((o)=>r.startsWith(o));
2128
+ const s = await He(t, r), o = Ye.some((l)=>r.startsWith(l));
1891
2129
  if (!s) {
1892
- l && n.push({
2130
+ o && n.push({
1893
2131
  severity: "warning",
1894
2132
  code: "W_IFC_PSET_RESERVED_PREFIX",
1895
2133
  message: `property set "${r}" uses a reserved buildingSMART prefix but is not a known standard ${r.startsWith("Qto_") ? "quantity set" : "pset"} for ${t}`,
@@ -1903,9 +2141,9 @@ let __tla = Promise.all([
1903
2141
  return;
1904
2142
  }
1905
2143
  if (a && s.applicableEntities.length > 0) {
1906
- const o = await ei(a, t);
1907
- if (o.length > 0 && !(await Promise.all(o.map((c)=>Zt(t, c, s.applicableEntities)))).some(Boolean)) {
1908
- const c = o.length === 1 ? o[0] : `{${o.join(", ")}}`;
2144
+ const l = await Vi(a, t);
2145
+ if (l.length > 0 && !(await Promise.all(l.map((c)=>Li(t, c, s.applicableEntities)))).some(Boolean)) {
2146
+ const c = l.length === 1 ? l[0] : `{${l.join(", ")}}`;
1909
2147
  n.push({
1910
2148
  severity: "error",
1911
2149
  code: "E_IFC_PROP_NOT_IN_PSET",
@@ -1921,17 +2159,17 @@ let __tla = Promise.all([
1921
2159
  }
1922
2160
  }
1923
2161
  if (e.baseName.type === "simpleValue") {
1924
- const o = e.baseName.value;
1925
- if (o) {
1926
- const u = s.properties.find((c)=>c.name === o);
1927
- u ? e.dataType && e.dataType.type === "simpleValue" && e.dataType.value && zt(u, e.dataType.value, i, s.name, o, n) : n.push({
2162
+ const l = e.baseName.value;
2163
+ if (l) {
2164
+ const u = s.properties.find((c)=>c.name === l);
2165
+ u ? e.dataType && e.dataType.type === "simpleValue" && e.dataType.value && wi(u, e.dataType.value, i, s.name, l, n) : n.push({
1928
2166
  severity: "error",
1929
2167
  code: "E_IFC_PROP_NOT_IN_PSET",
1930
- message: `property "${o}" is not part of ${s.name} (${t})`,
2168
+ message: `property "${l}" is not part of ${s.name} (${t})`,
1931
2169
  path: `${i}.baseName`,
1932
2170
  facetType: "property",
1933
2171
  detail: {
1934
- property: o,
2172
+ property: l,
1935
2173
  pset: s.name,
1936
2174
  version: t
1937
2175
  }
@@ -1939,24 +2177,24 @@ let __tla = Promise.all([
1939
2177
  }
1940
2178
  }
1941
2179
  }
1942
- function zt(e, t, i, a, n, r) {
1943
- const s = t.toUpperCase();
1944
- if (e.dataType && e.dataType.toUpperCase() === s) return;
1945
- const l = Jt(e.kind);
1946
- l && s === l || r.push({
2180
+ function wi(e, t, i, a, n, r) {
2181
+ const s = t.toUpperCase(), o = e.dataType ?? (e.kind === "enumeration" ? "IfcLabel" : void 0);
2182
+ if (o && o.toUpperCase() === s) return;
2183
+ const l = Oi(e.kind);
2184
+ l && s === l || o && r.push({
1947
2185
  severity: "error",
1948
2186
  code: "W_IFC_DATATYPE_MISMATCH",
1949
- message: `${a}.${n} is typed ${e.dataType ?? e.kind} in the standard, not ${t}`,
2187
+ message: `${a}.${n} is typed ${o} in the standard, not ${t}`,
1950
2188
  path: `${i}.dataType`,
1951
2189
  facetType: "property",
1952
2190
  detail: {
1953
- expected: e.dataType ?? e.kind,
2191
+ expected: o,
1954
2192
  actual: t,
1955
2193
  property: n
1956
2194
  }
1957
2195
  });
1958
2196
  }
1959
- function Kt(e, t, i, a, n) {
2197
+ function $i(e, t, i, a, n) {
1960
2198
  if (e.type === "simpleValue") return;
1961
2199
  const r = e.type === "pattern" || e.type === "enumeration" || e.type === "bounds" ? e.base : void 0;
1962
2200
  let s;
@@ -1970,7 +2208,7 @@ let __tla = Promise.all([
1970
2208
  typeof e.length == "number" || typeof e.minLength == "number" || typeof e.maxLength == "number" ? s = "xs:string" : s = "xs:double";
1971
2209
  break;
1972
2210
  }
1973
- s && (Qt(s, t) || n.push({
2211
+ s && (Fi(s, t) || n.push({
1974
2212
  severity: "error",
1975
2213
  code: "E_RESTRICTION_BASE_MISMATCH",
1976
2214
  message: `xs:restriction base (${s}) is not compatible with dataType "${i}" (backing ${t})`,
@@ -1983,7 +2221,7 @@ let __tla = Promise.all([
1983
2221
  }
1984
2222
  }));
1985
2223
  }
1986
- function Qt(e, t) {
2224
+ function Fi(e, t) {
1987
2225
  if (e === t) return !0;
1988
2226
  const i = new Set([
1989
2227
  "xs:double",
@@ -1992,7 +2230,7 @@ let __tla = Promise.all([
1992
2230
  ]);
1993
2231
  return !!(i.has(e) && i.has(t));
1994
2232
  }
1995
- function Jt(e) {
2233
+ function Oi(e) {
1996
2234
  switch(e){
1997
2235
  case "single":
1998
2236
  return "IFCPROPERTYSINGLEVALUE";
@@ -2008,11 +2246,11 @@ let __tla = Promise.all([
2008
2246
  return;
2009
2247
  }
2010
2248
  }
2011
- async function Zt(e, t, i) {
2249
+ async function Li(e, t, i) {
2012
2250
  for (const a of i)if (await $(e, t, a)) return !0;
2013
2251
  return !1;
2014
2252
  }
2015
- async function ei(e, t) {
2253
+ async function Vi(e, t) {
2016
2254
  switch(e.name.type){
2017
2255
  case "simpleValue":
2018
2256
  return e.name.value ? [
@@ -2022,11 +2260,11 @@ let __tla = Promise.all([
2022
2260
  return e.name.values.filter((i)=>!!i);
2023
2261
  case "pattern":
2024
2262
  try {
2025
- const i = new RegExp(`^${e.name.pattern}$`), { getEntities: a } = await ge(async ()=>{
2026
- const { getEntities: r } = await import("./sandbox-0Z2NzeOJ.js").then(async (m)=>{
2263
+ const i = new RegExp(`^${e.name.pattern}$`), { getEntities: a } = await qe(async ()=>{
2264
+ const { getEntities: r } = await import("./sandbox-BSiO04m8.js").then(async (m)=>{
2027
2265
  await m.__tla;
2028
2266
  return m;
2029
- }).then((s)=>s.b0);
2267
+ }).then((s)=>s.b1);
2030
2268
  return {
2031
2269
  getEntities: r
2032
2270
  };
@@ -2039,31 +2277,31 @@ let __tla = Promise.all([
2039
2277
  return [];
2040
2278
  }
2041
2279
  }
2042
- async function ti(e, t, i, a, n) {
2280
+ async function Di(e, t, i, a, n) {
2043
2281
  if (!a || a.name.type !== "simpleValue" || e.name.type !== "simpleValue") return;
2044
2282
  const r = a.name.value, s = e.name.value;
2045
2283
  if (!r || !s) return;
2046
- const l = await ve(t, r);
2047
- if (l.length === 0) return;
2048
- if (!ii(l, s)) {
2284
+ const o = await Ue(t, r);
2285
+ if (o.length === 0) return;
2286
+ if (!Ui(o, s)) {
2049
2287
  n.push({
2050
2288
  severity: "error",
2051
2289
  code: "E_IFC_ATTR_UNKNOWN_FOR_ENTITY",
2052
- message: `attribute "${s}" is not defined on ${l[0].name} (${t})`,
2290
+ message: `attribute "${s}" is not defined on ${o[0].name} (${t})`,
2053
2291
  path: `${i}.name`,
2054
2292
  facetType: "attribute",
2055
2293
  detail: {
2056
2294
  attribute: s,
2057
- entity: l[0].name,
2295
+ entity: o[0].name,
2058
2296
  version: t
2059
2297
  }
2060
2298
  });
2061
2299
  return;
2062
2300
  }
2063
2301
  if (e.value === void 0) return;
2064
- const o = await Ee(t, s);
2065
- if (!o) return;
2066
- const u = l[0].name.toUpperCase(), c = l.map((f)=>f.name.toUpperCase()), m = c.some((f)=>o.simpleValueEntities.includes(f)), d = c.some((f)=>o.complexEntities.includes(f));
2302
+ const l = await ke(t, s);
2303
+ if (!l) return;
2304
+ const u = o[0].name.toUpperCase(), c = o.map((y)=>y.name.toUpperCase()), m = c.some((y)=>l.simpleValueEntities.includes(y)), d = c.some((y)=>l.complexEntities.includes(y));
2067
2305
  !m && d && n.push({
2068
2306
  severity: "error",
2069
2307
  code: "E_IFC_ATTR_UNKNOWN_FOR_ENTITY",
@@ -2077,14 +2315,14 @@ let __tla = Promise.all([
2077
2315
  }
2078
2316
  });
2079
2317
  }
2080
- function ii(e, t) {
2318
+ function Ui(e, t) {
2081
2319
  const i = t.toLowerCase();
2082
2320
  for (const a of e)for (const n of a.attributes)if (n.toLowerCase() === i) return !0;
2083
2321
  return !1;
2084
2322
  }
2085
- async function ai(e, t, i, a, n) {
2086
- const r = await he(t), s = e.rawRelation ?? e.relation, l = s.toUpperCase(), o = r.find((u)=>u.relation === l);
2087
- if (!o) {
2323
+ async function ki(e, t, i, a, n) {
2324
+ const r = await De(t), s = e.rawRelation ?? e.relation, o = s.toUpperCase(), l = r.find((u)=>u.relation === o);
2325
+ if (!l) {
2088
2326
  n.push({
2089
2327
  severity: "error",
2090
2328
  code: "E_IFC_PARTOF_RELATION",
@@ -2099,7 +2337,7 @@ let __tla = Promise.all([
2099
2337
  return;
2100
2338
  }
2101
2339
  if (e.entity && e.entity.name.type === "simpleValue" && e.entity.name.value) {
2102
- const u = e.entity.name.value, c = await Z(t, u);
2340
+ const u = e.entity.name.value, c = await ve(t, u);
2103
2341
  if (!c) {
2104
2342
  n.push({
2105
2343
  severity: "error",
@@ -2114,7 +2352,7 @@ let __tla = Promise.all([
2114
2352
  });
2115
2353
  return;
2116
2354
  }
2117
- const m = o.owner;
2355
+ const m = l.owner;
2118
2356
  await $(t, c.name, m) || n.push({
2119
2357
  severity: "error",
2120
2358
  code: "E_IFC_PARTOF_ENTITY",
@@ -2131,37 +2369,37 @@ let __tla = Promise.all([
2131
2369
  }
2132
2370
  if (a && a.name.type === "simpleValue" && a.name.value) {
2133
2371
  const u = a.name.value;
2134
- await $(t, u, o.member) || n.push({
2372
+ await $(t, u, l.member) || n.push({
2135
2373
  severity: "error",
2136
2374
  code: "E_IFC_PARTOF_ENTITY",
2137
- message: `applicability entity "${u}" cannot be the member of ${e.relation}; ${e.relation} requires the member to be a subtype of "${o.member}" (${t})`,
2375
+ message: `applicability entity "${u}" cannot be the member of ${e.relation}; ${e.relation} requires the member to be a subtype of "${l.member}" (${t})`,
2138
2376
  path: `${i}.relation`,
2139
2377
  facetType: "partOf",
2140
2378
  detail: {
2141
2379
  applicability: u,
2142
- required: o.member,
2380
+ required: l.member,
2143
2381
  relation: e.relation,
2144
2382
  version: t
2145
2383
  }
2146
2384
  });
2147
2385
  }
2148
2386
  }
2149
- function ni(e) {
2387
+ function Bi(e) {
2150
2388
  try {
2151
2389
  return {
2152
- document: Pe(e),
2390
+ document: tt(e),
2153
2391
  issues: []
2154
2392
  };
2155
2393
  } catch (t) {
2156
2394
  return {
2157
2395
  issues: [
2158
- ri(t)
2396
+ Hi(t)
2159
2397
  ]
2160
2398
  };
2161
2399
  }
2162
2400
  }
2163
- function ri(e) {
2164
- if (e instanceof g) {
2401
+ function Hi(e) {
2402
+ if (e instanceof x) {
2165
2403
  const t = e.details ? `${e.message}: ${e.details}` : e.message;
2166
2404
  let i = "E_PARSE_UNKNOWN";
2167
2405
  return e.message.includes("Failed to parse IDS XML") || e.message.includes("Invalid XML format") || e.message.includes("No DOMParser") ? i = "E_PARSE_XML" : e.message.includes("Invalid root element") ? i = "E_PARSE_ROOT" : e.message.includes("facet") && (i = "E_PARSE_FACET"), {
@@ -2178,17 +2416,17 @@ let __tla = Promise.all([
2178
2416
  path: ""
2179
2417
  };
2180
2418
  }
2181
- const oe = "http://www.w3.org/2001/XMLSchema", ue = new Set([
2419
+ const Re = "http://www.w3.org/2001/XMLSchema", Pe = new Set([
2182
2420
  "xmlns",
2183
2421
  "xsi",
2184
2422
  "xml"
2185
- ]), si = {
2423
+ ]), Yi = {
2186
2424
  attrs: [],
2187
2425
  children: [
2188
2426
  "info",
2189
2427
  "specifications"
2190
2428
  ]
2191
- }, li = {
2429
+ }, qi = {
2192
2430
  attrs: [],
2193
2431
  children: [
2194
2432
  "title",
@@ -2200,12 +2438,12 @@ let __tla = Promise.all([
2200
2438
  "purpose",
2201
2439
  "milestone"
2202
2440
  ]
2203
- }, oi = {
2441
+ }, Gi = {
2204
2442
  attrs: [],
2205
2443
  children: [
2206
2444
  "specification"
2207
2445
  ]
2208
- }, ui = {
2446
+ }, Xi = {
2209
2447
  attrs: [
2210
2448
  "name",
2211
2449
  "ifcVersion",
@@ -2221,7 +2459,7 @@ let __tla = Promise.all([
2221
2459
  "applicability",
2222
2460
  "requirements"
2223
2461
  ]
2224
- }, ci = {
2462
+ }, ji = {
2225
2463
  attrs: [
2226
2464
  "minOccurs",
2227
2465
  "maxOccurs"
@@ -2234,7 +2472,7 @@ let __tla = Promise.all([
2234
2472
  "property",
2235
2473
  "material"
2236
2474
  ]
2237
- }, pi = {
2475
+ }, Wi = {
2238
2476
  attrs: [
2239
2477
  "description"
2240
2478
  ],
@@ -2246,32 +2484,32 @@ let __tla = Promise.all([
2246
2484
  "property",
2247
2485
  "material"
2248
2486
  ]
2249
- }, di = {
2487
+ }, zi = {
2250
2488
  attrs: [],
2251
2489
  children: [
2252
2490
  "name",
2253
2491
  "predefinedType"
2254
2492
  ]
2255
- }, mi = {
2493
+ }, Ki = {
2256
2494
  attrs: [],
2257
2495
  children: [
2258
2496
  "name",
2259
2497
  "value"
2260
2498
  ]
2261
- }, fi = {
2499
+ }, Qi = {
2262
2500
  attrs: [],
2263
2501
  children: [
2264
2502
  "value",
2265
2503
  "system"
2266
2504
  ]
2267
- }, yi = {
2505
+ }, Ji = {
2268
2506
  attrs: [
2269
2507
  "relation"
2270
2508
  ],
2271
2509
  children: [
2272
2510
  "entity"
2273
2511
  ]
2274
- }, hi = {
2512
+ }, Zi = {
2275
2513
  attrs: [
2276
2514
  "dataType"
2277
2515
  ],
@@ -2280,14 +2518,14 @@ let __tla = Promise.all([
2280
2518
  "baseName",
2281
2519
  "value"
2282
2520
  ]
2283
- }, vi = {
2521
+ }, ea = {
2284
2522
  attrs: [],
2285
2523
  children: [
2286
2524
  "value"
2287
2525
  ]
2288
2526
  };
2289
- function Ei(e) {
2290
- const t = ce(e);
2527
+ function ta(e) {
2528
+ const t = _e(e);
2291
2529
  switch(e.toLowerCase()){
2292
2530
  case "entity":
2293
2531
  return {
@@ -2331,20 +2569,20 @@ let __tla = Promise.all([
2331
2569
  return t;
2332
2570
  }
2333
2571
  }
2334
- function ce(e) {
2572
+ function _e(e) {
2335
2573
  switch(e.toLowerCase()){
2336
2574
  case "entity":
2337
- return di;
2575
+ return zi;
2338
2576
  case "attribute":
2339
- return mi;
2577
+ return Ki;
2340
2578
  case "classification":
2341
- return fi;
2579
+ return Qi;
2342
2580
  case "partof":
2343
- return yi;
2581
+ return Ji;
2344
2582
  case "property":
2345
- return hi;
2583
+ return Zi;
2346
2584
  case "material":
2347
- return vi;
2585
+ return ea;
2348
2586
  default:
2349
2587
  return {
2350
2588
  attrs: [],
@@ -2352,7 +2590,7 @@ let __tla = Promise.all([
2352
2590
  };
2353
2591
  }
2354
2592
  }
2355
- const Ti = {
2593
+ const ia = {
2356
2594
  attrs: [],
2357
2595
  children: [
2358
2596
  "simpleValue"
@@ -2360,11 +2598,11 @@ let __tla = Promise.all([
2360
2598
  xsChildren: [
2361
2599
  "restriction"
2362
2600
  ]
2363
- }, Ii = {
2601
+ }, aa = {
2364
2602
  attrs: [],
2365
2603
  children: [],
2366
2604
  textOnly: !0
2367
- }, pe = [
2605
+ }, we = [
2368
2606
  "enumeration",
2369
2607
  "pattern",
2370
2608
  "minInclusive",
@@ -2377,21 +2615,21 @@ let __tla = Promise.all([
2377
2615
  "totalDigits",
2378
2616
  "fractionDigits",
2379
2617
  "whiteSpace"
2380
- ], bi = {
2618
+ ], na = {
2381
2619
  attrs: [
2382
2620
  "base"
2383
2621
  ],
2384
2622
  children: [],
2385
- xsChildren: pe
2386
- }, gi = {
2623
+ xsChildren: we
2624
+ }, ra = {
2387
2625
  attrs: [
2388
2626
  "value"
2389
2627
  ],
2390
2628
  children: [],
2391
2629
  textOnly: !0
2392
2630
  };
2393
- async function Si(e) {
2394
- const t = [], i = typeof e == "string" ? e : new TextDecoder().decode(e), a = i.charCodeAt(0) === 65279 ? i.slice(1) : i, n = await Ai();
2631
+ async function sa(e) {
2632
+ const t = [], i = typeof e == "string" ? e : new TextDecoder().decode(e), a = i.charCodeAt(0) === 65279 ? i.slice(1) : i, n = await oa();
2395
2633
  let r;
2396
2634
  try {
2397
2635
  r = n.parseFromString(a, "text/xml");
@@ -2399,11 +2637,11 @@ let __tla = Promise.all([
2399
2637
  return t;
2400
2638
  }
2401
2639
  const s = r.documentElement;
2402
- return !s || (s.localName ?? "").toLowerCase() !== "ids" || xi(s, t), t;
2640
+ return !s || (s.localName ?? "").toLowerCase() !== "ids" || la(s, t), t;
2403
2641
  }
2404
- let w;
2405
- function Ai() {
2406
- return w || (w = (async ()=>{
2642
+ let L;
2643
+ function oa() {
2644
+ return L || (L = (async ()=>{
2407
2645
  const e = globalThis.DOMParser;
2408
2646
  if (typeof e == "function") return new e;
2409
2647
  const i = await import("@xmldom/xmldom").then(async (m)=>{
@@ -2411,50 +2649,50 @@ let __tla = Promise.all([
2411
2649
  return m;
2412
2650
  });
2413
2651
  return new i.DOMParser;
2414
- })(), w);
2652
+ })(), L);
2415
2653
  }
2416
- function xi(e, t) {
2417
- S(e, si, "ids", t);
2418
- for (const i of R(e)){
2654
+ function la(e, t) {
2655
+ C(e, Yi, "ids", t);
2656
+ for (const i of P(e)){
2419
2657
  const a = (i.localName ?? "").toLowerCase();
2420
- a === "info" ? Ci(i, "ids.info", t) : a === "specifications" && Ri(i, "ids.specifications", t);
2658
+ a === "info" ? ua(i, "ids.info", t) : a === "specifications" && ca(i, "ids.specifications", t);
2421
2659
  }
2422
2660
  }
2423
- function Ci(e, t, i) {
2424
- S(e, li, t, i);
2661
+ function ua(e, t, i) {
2662
+ C(e, qi, t, i);
2425
2663
  }
2426
- function Ri(e, t, i) {
2427
- S(e, oi, t, i);
2664
+ function ca(e, t, i) {
2665
+ C(e, Gi, t, i);
2428
2666
  let a = 0;
2429
- for (const n of R(e))(n.localName ?? "").toLowerCase() === "specification" && Mi(n, `${t}.specification[${a++}]`, i);
2667
+ for (const n of P(e))(n.localName ?? "").toLowerCase() === "specification" && pa(n, `${t}.specification[${a++}]`, i);
2430
2668
  }
2431
- function Mi(e, t, i) {
2432
- S(e, ui, t, i);
2433
- for (const a of R(e)){
2669
+ function pa(e, t, i) {
2670
+ C(e, Xi, t, i);
2671
+ for (const a of P(e)){
2434
2672
  const n = (a.localName ?? "").toLowerCase();
2435
- n === "applicability" ? W(a, `${t}.applicability`, !1, i) : n === "requirements" && W(a, `${t}.requirements`, !0, i);
2673
+ n === "applicability" ? de(a, `${t}.applicability`, !1, i) : n === "requirements" && de(a, `${t}.requirements`, !0, i);
2436
2674
  }
2437
2675
  }
2438
- function W(e, t, i, a) {
2439
- S(e, i ? pi : ci, t, a);
2676
+ function de(e, t, i, a) {
2677
+ C(e, i ? Wi : ji, t, a);
2440
2678
  let n = 0;
2441
- for (const r of R(e)){
2679
+ for (const r of P(e)){
2442
2680
  const s = (r.localName ?? "").toLowerCase();
2443
- de(r, s, `${t}.facets[${n++}]`, i, a);
2681
+ $e(r, s, `${t}.facets[${n++}]`, i, a);
2444
2682
  }
2445
2683
  }
2446
- function de(e, t, i, a, n) {
2447
- const r = a ? Ei(t) : ce(t);
2448
- S(e, r, i, n);
2449
- for (const s of R(e)){
2450
- const l = (s.localName ?? "").toLowerCase();
2451
- Ni(s, l, `${i}.${l}`, a, n);
2684
+ function $e(e, t, i, a, n) {
2685
+ const r = a ? ta(t) : _e(t);
2686
+ C(e, r, i, n);
2687
+ for (const s of P(e)){
2688
+ const o = (s.localName ?? "").toLowerCase();
2689
+ da(s, o, `${i}.${o}`, a, n);
2452
2690
  }
2453
2691
  }
2454
- function Ni(e, t, i, a, n) {
2692
+ function da(e, t, i, a, n) {
2455
2693
  switch(t){
2456
2694
  case "entity":
2457
- de(e, "entity", i, !1, n);
2695
+ $e(e, "entity", i, !1, n);
2458
2696
  return;
2459
2697
  case "name":
2460
2698
  case "value":
@@ -2462,34 +2700,34 @@ let __tla = Promise.all([
2462
2700
  case "propertySet":
2463
2701
  case "system":
2464
2702
  case "predefinedType":
2465
- _i(e, i, n);
2703
+ ma(e, i, n);
2466
2704
  return;
2467
2705
  default:
2468
2706
  return;
2469
2707
  }
2470
2708
  }
2471
- function _i(e, t, i) {
2472
- S(e, Ti, t, i);
2473
- for (const a of R(e)){
2709
+ function ma(e, t, i) {
2710
+ C(e, ia, t, i);
2711
+ for (const a of P(e)){
2474
2712
  const n = (a.localName ?? "").toLowerCase();
2475
- n === "simpleValue" ? S(a, Ii, `${t}.simpleValue`, i) : n === "restriction" && (a.namespaceURI === oe || a.namespaceURI === null) && Pi(a, `${t}.restriction`, i);
2713
+ n === "simpleValue" ? C(a, aa, `${t}.simpleValue`, i) : n === "restriction" && (a.namespaceURI === Re || a.namespaceURI === null) && fa(a, `${t}.restriction`, i);
2476
2714
  }
2477
2715
  }
2478
- function Pi(e, t, i) {
2479
- S(e, bi, t, i);
2480
- for (const a of R(e)){
2716
+ function fa(e, t, i) {
2717
+ C(e, na, t, i);
2718
+ for (const a of P(e)){
2481
2719
  const n = (a.localName ?? "").toLowerCase();
2482
- pe.includes(n) && S(a, gi, `${t}.${n}`, i);
2720
+ we.includes(n) && C(a, ra, `${t}.${n}`, i);
2483
2721
  }
2484
2722
  }
2485
- function S(e, t, i, a) {
2486
- const n = new Set(t.attrs.map((l)=>l.toLowerCase()));
2487
- for (const l of Array.from(e.attributes ?? [])){
2488
- if (Oi(l)) continue;
2489
- const o = l.nodeName ?? "";
2490
- if (wi(o)) continue;
2491
- const u = l.localName ?? l.nodeName ?? "", c = u.indexOf(":"), m = c === -1 ? u.toLowerCase() : u.slice(c + 1).toLowerCase(), d = c === -1 ? "" : u.slice(0, c).toLowerCase();
2492
- !m || m === "xmlns" || d === "xmlns" || ue.has(d) || n.has(m) || a.push({
2723
+ function C(e, t, i, a) {
2724
+ const n = new Set(t.attrs.map((o)=>o.toLowerCase()));
2725
+ for (const o of Array.from(e.attributes ?? [])){
2726
+ if (Ea(o)) continue;
2727
+ const l = o.nodeName ?? "";
2728
+ if (ha(l)) continue;
2729
+ const u = o.localName ?? o.nodeName ?? "", c = u.indexOf(":"), m = c === -1 ? u.toLowerCase() : u.slice(c + 1).toLowerCase(), d = c === -1 ? "" : u.slice(0, c).toLowerCase();
2730
+ !m || m === "xmlns" || d === "xmlns" || Pe.has(d) || n.has(m) || a.push({
2493
2731
  severity: "error",
2494
2732
  code: "E_XSD_STRUCTURE",
2495
2733
  message: `unexpected attribute "${u}" on <${e.localName}>`,
@@ -2500,65 +2738,65 @@ let __tla = Promise.all([
2500
2738
  }
2501
2739
  });
2502
2740
  }
2503
- if (t.requiredAttrs) for (const l of t.requiredAttrs)$i(e, l) || a.push({
2741
+ if (t.requiredAttrs) for (const o of t.requiredAttrs)ya(e, o) || a.push({
2504
2742
  severity: "error",
2505
2743
  code: "E_XSD_REQUIRED_ATTR",
2506
- message: `<${e.localName}> is missing required @${l}`,
2744
+ message: `<${e.localName}> is missing required @${o}`,
2507
2745
  path: i,
2508
2746
  detail: {
2509
- attribute: l,
2747
+ attribute: o,
2510
2748
  element: e.localName ?? ""
2511
2749
  }
2512
2750
  });
2513
- const r = new Set(t.children.map((l)=>l.toLowerCase())), s = new Set((t.xsChildren ?? []).map((l)=>l.toLowerCase()));
2514
- for (const l of R(e)){
2515
- const o = (l.localName ?? "").toLowerCase();
2516
- if (l.namespaceURI === oe) {
2517
- s.has(o) || a.push({
2751
+ const r = new Set(t.children.map((o)=>o.toLowerCase())), s = new Set((t.xsChildren ?? []).map((o)=>o.toLowerCase()));
2752
+ for (const o of P(e)){
2753
+ const l = (o.localName ?? "").toLowerCase();
2754
+ if (o.namespaceURI === Re) {
2755
+ s.has(l) || a.push({
2518
2756
  severity: "error",
2519
2757
  code: "E_XSD_STRUCTURE",
2520
- message: `unexpected XSD child <xs:${o}> in <${e.localName}>`,
2758
+ message: `unexpected XSD child <xs:${l}> in <${e.localName}>`,
2521
2759
  path: i,
2522
2760
  detail: {
2523
- child: `xs:${o}`,
2761
+ child: `xs:${l}`,
2524
2762
  parent: e.localName ?? ""
2525
2763
  }
2526
2764
  });
2527
2765
  continue;
2528
2766
  }
2529
- r.has(o) || a.push({
2767
+ r.has(l) || a.push({
2530
2768
  severity: "error",
2531
2769
  code: "E_XSD_STRUCTURE",
2532
- message: `unexpected child <${l.localName}> in <${e.localName}>`,
2770
+ message: `unexpected child <${o.localName}> in <${e.localName}>`,
2533
2771
  path: i,
2534
2772
  detail: {
2535
- child: l.localName ?? "",
2773
+ child: o.localName ?? "",
2536
2774
  parent: e.localName ?? ""
2537
2775
  }
2538
2776
  });
2539
2777
  }
2540
2778
  t.textOnly;
2541
2779
  }
2542
- function $i(e, t) {
2780
+ function ya(e, t) {
2543
2781
  if (typeof e.hasAttribute == "function" && e.hasAttribute(t)) return !0;
2544
2782
  for (const i of Array.from(e.attributes ?? []))if ((i.localName ?? i.nodeName ?? "").toLowerCase() === t.toLowerCase()) return !0;
2545
2783
  return !1;
2546
2784
  }
2547
- function wi(e) {
2785
+ function ha(e) {
2548
2786
  if (!e) return !1;
2549
2787
  if (e === "xmlns") return !0;
2550
2788
  const t = e.indexOf(":");
2551
- return t === -1 ? !1 : ue.has(e.slice(0, t));
2789
+ return t === -1 ? !1 : Pe.has(e.slice(0, t));
2552
2790
  }
2553
- const Fi = new Set([
2791
+ const va = new Set([
2554
2792
  "http://www.w3.org/2000/xmlns/",
2555
2793
  "http://www.w3.org/XML/1998/namespace",
2556
2794
  "http://www.w3.org/2001/XMLSchema-instance"
2557
2795
  ]);
2558
- function Oi(e) {
2559
- return e.namespaceURI !== null && Fi.has(e.namespaceURI);
2796
+ function Ea(e) {
2797
+ return e.namespaceURI !== null && va.has(e.namespaceURI);
2560
2798
  }
2561
- function R(e) {
2799
+ function P(e) {
2562
2800
  if (e.children && e.children.length !== void 0) return Array.from(e.children);
2563
2801
  const t = [], i = e.childNodes ?? [];
2564
2802
  for(let a = 0; a < i.length; a++){
@@ -2567,42 +2805,42 @@ let __tla = Promise.all([
2567
2805
  }
2568
2806
  return t;
2569
2807
  }
2570
- const Li = [
2808
+ const ga = [
2571
2809
  "IFC2X3",
2572
2810
  "IFC4",
2573
2811
  "IFC4X3_ADD2",
2574
2812
  "IFC4X3"
2575
- ], me = new Set([
2813
+ ], Fe = new Set([
2576
2814
  "IFC2X3",
2577
2815
  "IFC4",
2578
2816
  "IFC4X3",
2579
2817
  "IFC4X3_ADD2"
2580
- ]), z = [
2581
- ...me
2818
+ ]), me = [
2819
+ ...Fe
2582
2820
  ].join(", ");
2583
- function Vi(e) {
2584
- return me.has(e.toUpperCase().replace(/[^A-Z0-9_]/g, ""));
2821
+ function Ta(e) {
2822
+ return Fe.has(e.toUpperCase().replace(/[^A-Z0-9_]/g, ""));
2585
2823
  }
2586
- const Di = new Set([
2824
+ const ba = new Set([
2587
2825
  "entity",
2588
2826
  "attribute",
2589
2827
  "classification",
2590
2828
  "material",
2591
2829
  "partOf",
2592
2830
  "property"
2593
- ]), Ui = [
2831
+ ]), Ia = [
2594
2832
  "http://standards.buildingsmart.org/IDS/1.0/ids.xsd",
2595
2833
  "http://standards.buildingsmart.org/IDS/0.9.7/ids.xsd",
2596
2834
  "http://standards.buildingsmart.org/IDS/0.9.6/ids.xsd",
2597
2835
  "http://standards.buildingsmart.org/IDS/ids.xsd"
2598
2836
  ];
2599
- function ki(e) {
2837
+ function Sa(e) {
2600
2838
  const t = [];
2601
2839
  if (e.schemaLocation) {
2602
2840
  const i = e.schemaLocation.split(/\s+/).filter((a)=>a.length > 0);
2603
2841
  for(let a = 0; a + 1 < i.length; a += 2){
2604
2842
  const n = i[a], r = i[a + 1];
2605
- n === "http://standards.buildingsmart.org/IDS" && (Ui.includes(r) || t.push({
2843
+ n === "http://standards.buildingsmart.org/IDS" && (Ia.includes(r) || t.push({
2606
2844
  severity: "error",
2607
2845
  code: "E_XSD_SCHEMA_LOCATION",
2608
2846
  message: `xsi:schemaLocation references "${r}", not a recognised IDS XSD`,
@@ -2618,9 +2856,9 @@ let __tla = Promise.all([
2618
2856
  code: "E_XSD_REQUIRED_ATTR",
2619
2857
  message: "IDS document is missing a non-empty <info><title> element",
2620
2858
  path: "info.title"
2621
- }), e.specifications.forEach((i, a)=>Bi(i, a, t)), t;
2859
+ }), e.specifications.forEach((i, a)=>Aa(i, a, t)), t;
2622
2860
  }
2623
- function Bi(e, t, i) {
2861
+ function Aa(e, t, i) {
2624
2862
  const a = `specifications[${t}]`;
2625
2863
  if ((!e.name || e.name.trim() === "" || /^Specification \d+$/.test(e.name)) && i.push({
2626
2864
  severity: "error",
@@ -2633,10 +2871,10 @@ let __tla = Promise.all([
2633
2871
  message: "specification is missing the @ifcVersion attribute",
2634
2872
  path: `${a}.ifcVersion`
2635
2873
  });
2636
- else for (const n of e.ifcVersions)Li.includes(n) || i.push({
2874
+ else for (const n of e.ifcVersions)ga.includes(n) || i.push({
2637
2875
  severity: "error",
2638
2876
  code: "E_XSD_ENUM",
2639
- message: `@ifcVersion "${n}" is not in {${z}}`,
2877
+ message: `@ifcVersion "${n}" is not in {${me}}`,
2640
2878
  path: `${a}.ifcVersion`,
2641
2879
  detail: {
2642
2880
  value: n
@@ -2644,10 +2882,10 @@ let __tla = Promise.all([
2644
2882
  });
2645
2883
  if (e.ifcVersionRaw) {
2646
2884
  const n = e.ifcVersionRaw.split(/\s+/).filter((r)=>r.length > 0);
2647
- for (const r of n)Vi(r) || i.push({
2885
+ for (const r of n)Ta(r) || i.push({
2648
2886
  severity: "error",
2649
2887
  code: "E_XSD_ENUM",
2650
- message: `@ifcVersion token "${r}" is not in {${z}}`,
2888
+ message: `@ifcVersion token "${r}" is not in {${me}}`,
2651
2889
  path: `${a}.ifcVersion`,
2652
2890
  detail: {
2653
2891
  value: r
@@ -2660,18 +2898,18 @@ let __tla = Promise.all([
2660
2898
  message: "specification has an empty <applicability> — at least one facet is required",
2661
2899
  path: `${a}.applicability`
2662
2900
  }), e.applicability.facets.forEach((n, r)=>{
2663
- K(n, `${a}.applicability.facets[${r}]`, i);
2901
+ fe(n, `${a}.applicability.facets[${r}]`, i);
2664
2902
  }), e.requirements.length === 0 && i.push({
2665
2903
  severity: "warning",
2666
2904
  code: "E_XSD_STRUCTURE",
2667
2905
  message: "specification has no <requirements>; matched entities will not be checked",
2668
2906
  path: `${a}.requirements`
2669
2907
  }), e.requirements.forEach((n, r)=>{
2670
- K(n.facet, `${a}.requirements[${r}]`, i);
2908
+ fe(n.facet, `${a}.requirements[${r}]`, i);
2671
2909
  });
2672
2910
  }
2673
- function K(e, t, i) {
2674
- if (!Di.has(e.type)) {
2911
+ function fe(e, t, i) {
2912
+ if (!ba.has(e.type)) {
2675
2913
  i.push({
2676
2914
  severity: "error",
2677
2915
  code: "E_XSD_STRUCTURE",
@@ -2683,17 +2921,17 @@ let __tla = Promise.all([
2683
2921
  }
2684
2922
  switch(e.type){
2685
2923
  case "entity":
2686
- F(e.name, `${t}.name`, "entity.name", i, e.type);
2924
+ V(e.name, `${t}.name`, "entity.name", i, e.type);
2687
2925
  break;
2688
2926
  case "attribute":
2689
- F(e.name, `${t}.name`, "attribute.name", i, e.type);
2927
+ V(e.name, `${t}.name`, "attribute.name", i, e.type);
2690
2928
  break;
2691
2929
  case "property":
2692
- F(e.propertySet, `${t}.propertySet`, "property.propertySet", i, e.type), F(e.baseName, `${t}.baseName`, "property.baseName", i, e.type);
2930
+ V(e.propertySet, `${t}.propertySet`, "property.propertySet", i, e.type), V(e.baseName, `${t}.baseName`, "property.baseName", i, e.type);
2693
2931
  break;
2694
2932
  }
2695
2933
  }
2696
- function F(e, t, i, a, n) {
2934
+ function V(e, t, i, a, n) {
2697
2935
  if (!e) {
2698
2936
  a.push({
2699
2937
  severity: "error",
@@ -2712,23 +2950,23 @@ let __tla = Promise.all([
2712
2950
  facetType: n
2713
2951
  });
2714
2952
  }
2715
- ua = async function(e, t = {}) {
2716
- const { document: i, issues: a } = ni(e);
2717
- if (!i) return B(a);
2718
- const n = t.xsdValidation === !1 ? [] : await Si(e), r = await qi(i, t);
2719
- return B([
2953
+ Xa = async function(e, t = {}) {
2954
+ const { document: i, issues: a } = Bi(e);
2955
+ if (!i) return j(a);
2956
+ const n = t.xsdValidation === !1 ? [] : await sa(e), r = await xa(i, t);
2957
+ return j([
2720
2958
  ...a,
2721
2959
  ...n,
2722
2960
  ...r.issues
2723
2961
  ], i);
2724
2962
  };
2725
- async function qi(e, t = {}) {
2963
+ async function xa(e, t = {}) {
2726
2964
  const i = t.xsdValidation !== !1, a = t.ifcSchemaChecks !== !1, n = t.coherenceChecks !== !1, r = [];
2727
- return i && r.push(...ki(e)), n && r.push(...Ft(e)), a && r.push(...await Bt(e, {
2965
+ return i && r.push(...Sa(e)), n && r.push(...vi(e)), a && r.push(...await Ai(e, {
2728
2966
  ifcVersion: t.ifcVersion
2729
- })), B(r, e);
2967
+ })), j(r, e);
2730
2968
  }
2731
- function B(e, t) {
2969
+ function j(e, t) {
2732
2970
  let i = "valid";
2733
2971
  for (const a of e){
2734
2972
  if (a.severity === "error") {
@@ -2743,7 +2981,7 @@ let __tla = Promise.all([
2743
2981
  parsedDocument: t
2744
2982
  };
2745
2983
  }
2746
- const Yi = {
2984
+ const Ca = {
2747
2985
  status: {
2748
2986
  pass: "PASS",
2749
2987
  fail: "FAIL",
@@ -2928,7 +3166,7 @@ let __tla = Promise.all([
2928
3166
  runValidation: "Run validation",
2929
3167
  clearResults: "Clear results"
2930
3168
  }
2931
- }, Hi = {
3169
+ }, Ma = {
2932
3170
  status: {
2933
3171
  pass: "BESTANDEN",
2934
3172
  fail: "FEHLGESCHLAGEN",
@@ -3113,7 +3351,7 @@ let __tla = Promise.all([
3113
3351
  runValidation: "Validierung starten",
3114
3352
  clearResults: "Ergebnisse löschen"
3115
3353
  }
3116
- }, Gi = {
3354
+ }, Na = {
3117
3355
  status: {
3118
3356
  pass: "CONFORME",
3119
3357
  fail: "NON CONFORME",
@@ -3298,19 +3536,19 @@ let __tla = Promise.all([
3298
3536
  runValidation: "Lancer la validation",
3299
3537
  clearResults: "Effacer les résultats"
3300
3538
  }
3301
- }, Q = {
3302
- en: Yi,
3303
- de: Hi,
3304
- fr: Gi
3539
+ }, ye = {
3540
+ en: Ca,
3541
+ de: Ma,
3542
+ fr: Na
3305
3543
  };
3306
- ca = function(e = "en") {
3307
- return new Xi(e);
3544
+ ja = function(e = "en") {
3545
+ return new Ra(e);
3308
3546
  };
3309
- class Xi {
3547
+ class Ra {
3310
3548
  locale;
3311
3549
  translations;
3312
3550
  constructor(t){
3313
- this.locale = t, this.translations = Q[t] || Q.en;
3551
+ this.locale = t, this.translations = ye[t] || ye.en;
3314
3552
  }
3315
3553
  t(t, i) {
3316
3554
  const a = t.split(".");
@@ -3497,7 +3735,7 @@ let __tla = Promise.all([
3497
3735
  describeFailure(t) {
3498
3736
  const i = this.translations.failures;
3499
3737
  if (!t.failure) return t.actualValue && t.expectedValue ? `${t.actualValue} ≠ ${t.expectedValue}` : i.unknown.replace("{reason}", "no details");
3500
- const { type: a, field: n, actual: r, expected: s, context: l } = t.failure;
3738
+ const { type: a, field: n, actual: r, expected: s, context: o } = t.failure;
3501
3739
  switch(a){
3502
3740
  case "ENTITY_TYPE_MISMATCH":
3503
3741
  return this.interpolate(i.entityTypeMismatch, {
@@ -3530,20 +3768,20 @@ let __tla = Promise.all([
3530
3768
  expected: s || "?"
3531
3769
  });
3532
3770
  case "PSET_MISSING":
3533
- return l?.availablePsets ? this.interpolate(i.psetMissingAvailable, {
3771
+ return o?.availablePsets ? this.interpolate(i.psetMissingAvailable, {
3534
3772
  pset: n || s || "?",
3535
- available: l.availablePsets
3773
+ available: o.availablePsets
3536
3774
  }) : this.interpolate(i.psetMissing, {
3537
3775
  pset: n || s || "?"
3538
3776
  });
3539
3777
  case "PROPERTY_MISSING":
3540
- return l?.availableProperties ? this.interpolate(i.propertyMissingAvailable, {
3778
+ return o?.availableProperties ? this.interpolate(i.propertyMissingAvailable, {
3541
3779
  property: n || "?",
3542
- pset: l.propertySet || "?",
3543
- available: l.availableProperties
3780
+ pset: o.propertySet || "?",
3781
+ available: o.availableProperties
3544
3782
  }) : this.interpolate(i.propertyMissing, {
3545
3783
  property: n || "?",
3546
- pset: l?.propertySet || "?"
3784
+ pset: o?.propertySet || "?"
3547
3785
  });
3548
3786
  case "PROPERTY_VALUE_MISMATCH":
3549
3787
  return this.interpolate(i.propertyValueMismatch, {
@@ -3569,17 +3807,17 @@ let __tla = Promise.all([
3569
3807
  case "CLASSIFICATION_MISSING":
3570
3808
  return i.classificationMissing;
3571
3809
  case "CLASSIFICATION_SYSTEM_MISMATCH":
3572
- return l?.availableSystems ? this.interpolate(i.classificationSystemMissingAvailable, {
3810
+ return o?.availableSystems ? this.interpolate(i.classificationSystemMissingAvailable, {
3573
3811
  expected: s || "?",
3574
- available: l.availableSystems
3812
+ available: o.availableSystems
3575
3813
  }) : this.interpolate(i.classificationSystemMismatch, {
3576
3814
  actual: r || "?",
3577
3815
  expected: s || "?"
3578
3816
  });
3579
3817
  case "CLASSIFICATION_VALUE_MISMATCH":
3580
- return l?.availableValues ? this.interpolate(i.classificationValueMissingAvailable, {
3818
+ return o?.availableValues ? this.interpolate(i.classificationValueMissingAvailable, {
3581
3819
  expected: s || "?",
3582
- available: l.availableValues
3820
+ available: o.availableValues
3583
3821
  }) : this.interpolate(i.classificationValueMismatch, {
3584
3822
  actual: r || "?",
3585
3823
  expected: s || "?"
@@ -3587,17 +3825,17 @@ let __tla = Promise.all([
3587
3825
  case "MATERIAL_MISSING":
3588
3826
  return i.materialMissing;
3589
3827
  case "MATERIAL_VALUE_MISMATCH":
3590
- return l?.availableMaterials ? this.interpolate(i.materialValueMissingAvailable, {
3828
+ return o?.availableMaterials ? this.interpolate(i.materialValueMissingAvailable, {
3591
3829
  expected: s || "?",
3592
- available: l.availableMaterials
3830
+ available: o.availableMaterials
3593
3831
  }) : this.interpolate(i.materialValueMismatch, {
3594
3832
  actual: r || "?",
3595
3833
  expected: s || "?"
3596
3834
  });
3597
3835
  case "PARTOF_RELATION_MISSING":
3598
- return l?.entity ? this.interpolate(i.partOfMissing, {
3836
+ return o?.entity ? this.interpolate(i.partOfMissing, {
3599
3837
  relation: this.getRelationDescription(n || "IfcRelContainedInSpatialStructure"),
3600
- entity: l.entity
3838
+ entity: o.entity
3601
3839
  }) : this.interpolate(i.partOfMissingSimple, {
3602
3840
  relation: this.getRelationDescription(n || "IfcRelContainedInSpatialStructure")
3603
3841
  });
@@ -3650,7 +3888,7 @@ let __tla = Promise.all([
3650
3888
  return this.translations.relations[t] || t.replace("IfcRel", "").toLowerCase();
3651
3889
  }
3652
3890
  }
3653
- function ji(e) {
3891
+ function Pa(e) {
3654
3892
  if (!e) return [];
3655
3893
  const t = [], i = (a, n)=>{
3656
3894
  a && t.push({
@@ -3680,11 +3918,11 @@ let __tla = Promise.all([
3680
3918
  }
3681
3919
  return t;
3682
3920
  }
3683
- function Wi(e, t) {
3921
+ function _a(e, t) {
3684
3922
  const i = [
3685
- ...Se(e, t) || []
3923
+ ...Ge(e, t) || []
3686
3924
  ];
3687
- zi(e, t, i);
3925
+ wa(e, t, i);
3688
3926
  const a = [];
3689
3927
  for (const n of i){
3690
3928
  const r = n.system || "", s = n.identification || n.name || "";
@@ -3692,58 +3930,58 @@ let __tla = Promise.all([
3692
3930
  system: r,
3693
3931
  value: s,
3694
3932
  name: n.name
3695
- }), Array.isArray(n.path)) for (const l of n.path)l && l !== s && a.push({
3933
+ }), Array.isArray(n.path)) for (const o of n.path)o && o !== s && a.push({
3696
3934
  system: r,
3697
- value: l,
3935
+ value: o,
3698
3936
  name: n.name
3699
3937
  });
3700
3938
  }
3701
3939
  return a;
3702
3940
  }
3703
- function zi(e, t, i) {
3941
+ function wa(e, t, i) {
3704
3942
  const a = e.entityIndex?.byType?.get?.("IFCEXTERNALREFERENCERELATIONSHIP") || [];
3705
3943
  if (a.length === 0 || !e.source?.length) return;
3706
- const n = new Ae(e.source);
3944
+ const n = new Xe(e.source);
3707
3945
  for (const r of a){
3708
3946
  const s = e.entityIndex.byId.get(r);
3709
3947
  if (!s) continue;
3710
- const l = n.extractEntity(s);
3711
- if (!l) continue;
3712
- const o = l.attributes?.[2], u = l.attributes?.[3];
3713
- if (typeof o != "number" || !Array.isArray(u) || !u.includes(t)) continue;
3714
- const c = e.entityIndex.byId.get(o);
3948
+ const o = n.extractEntity(s);
3949
+ if (!o) continue;
3950
+ const l = o.attributes?.[2], u = o.attributes?.[3];
3951
+ if (typeof l != "number" || !Array.isArray(u) || !u.includes(t)) continue;
3952
+ const c = e.entityIndex.byId.get(l);
3715
3953
  if (!c) continue;
3716
3954
  const m = n.extractEntity(c);
3717
3955
  if (!m || m.type.toUpperCase() !== "IFCCLASSIFICATIONREFERENCE") continue;
3718
- const d = m.attributes || [], f = {
3956
+ const d = m.attributes || [], y = {
3719
3957
  identification: typeof d[1] == "string" ? d[1] : void 0,
3720
3958
  name: typeof d[2] == "string" ? d[2] : void 0,
3721
3959
  path: []
3722
3960
  };
3723
- let y = typeof d[3] == "number" ? d[3] : void 0;
3724
- const M = new Set;
3725
- for(; y !== void 0 && !M.has(y);){
3726
- M.add(y);
3727
- const x = e.entityIndex.byId.get(y);
3728
- if (!x) break;
3729
- const _ = n.extractEntity(x);
3730
- if (!_) break;
3731
- const I = _.type.toUpperCase(), b = _.attributes || [];
3732
- if (I === "IFCCLASSIFICATION") {
3733
- f.system = typeof b[3] == "string" ? b[3] : void 0;
3961
+ let f = typeof d[3] == "number" ? d[3] : void 0;
3962
+ const T = new Set;
3963
+ for(; f !== void 0 && !T.has(f);){
3964
+ T.add(f);
3965
+ const E = e.entityIndex.byId.get(f);
3966
+ if (!E) break;
3967
+ const b = n.extractEntity(E);
3968
+ if (!b) break;
3969
+ const _ = b.type.toUpperCase(), g = b.attributes || [];
3970
+ if (_ === "IFCCLASSIFICATION") {
3971
+ y.system = typeof g[3] == "string" ? g[3] : void 0;
3734
3972
  break;
3735
3973
  }
3736
- if (I === "IFCCLASSIFICATIONREFERENCE") {
3737
- const P = typeof b[1] == "string" ? b[1] : typeof b[2] == "string" ? b[2] : void 0;
3738
- P && f.path.unshift(P), y = typeof b[3] == "number" ? b[3] : void 0;
3974
+ if (_ === "IFCCLASSIFICATIONREFERENCE") {
3975
+ const F = typeof g[1] == "string" ? g[1] : typeof g[2] == "string" ? g[2] : void 0;
3976
+ F && y.path.unshift(F), f = typeof g[3] == "number" ? g[3] : void 0;
3739
3977
  continue;
3740
3978
  }
3741
3979
  break;
3742
3980
  }
3743
- i.push(f);
3981
+ i.push(y);
3744
3982
  }
3745
3983
  }
3746
- function fe(e) {
3984
+ function Oe(e) {
3747
3985
  if (typeof e == "string") return e.startsWith("IFC") || e.startsWith("Ifc") ? e.toUpperCase() : "IFCLABEL";
3748
3986
  switch(e){
3749
3987
  case 0:
@@ -3772,7 +4010,7 @@ let __tla = Promise.all([
3772
4010
  return "IFCLABEL";
3773
4011
  }
3774
4012
  }
3775
- function Ki(e) {
4013
+ function $a(e) {
3776
4014
  switch(e){
3777
4015
  case 0:
3778
4016
  return "IFCLENGTHMEASURE";
@@ -3790,7 +4028,7 @@ let __tla = Promise.all([
3790
4028
  return "IFCLABEL";
3791
4029
  }
3792
4030
  }
3793
- function Qi(e, t, i, a) {
4031
+ function Fa(e, t, i, a) {
3794
4032
  if (!a || a === 1) return {
3795
4033
  value: e,
3796
4034
  values: t
@@ -3800,16 +4038,16 @@ let __tla = Promise.all([
3800
4038
  value: e,
3801
4039
  values: t
3802
4040
  };
3803
- const l = (u)=>{
4041
+ const o = (u)=>{
3804
4042
  const c = typeof u == "number" ? u : parseFloat(String(u));
3805
4043
  return Number.isFinite(c) ? c * a : null;
3806
4044
  };
3807
4045
  if (r) {
3808
4046
  const u = (()=>{
3809
- const m = l(e);
4047
+ const m = o(e);
3810
4048
  return m ?? e;
3811
4049
  })(), c = Array.isArray(t) ? t.map((m)=>{
3812
- const d = l(m);
4050
+ const d = o(m);
3813
4051
  return d == null ? String(m) : String(d);
3814
4052
  }) : t;
3815
4053
  return {
@@ -3817,84 +4055,84 @@ let __tla = Promise.all([
3817
4055
  values: c
3818
4056
  };
3819
4057
  }
3820
- const o = [];
4058
+ const l = [];
3821
4059
  for (const u of t){
3822
- o.push(String(u));
3823
- const c = l(u);
3824
- c != null && String(c) !== String(u) && o.push(String(c));
4060
+ l.push(String(u));
4061
+ const c = o(u);
4062
+ c != null && String(c) !== String(u) && l.push(String(c));
3825
4063
  }
3826
4064
  return {
3827
4065
  value: e,
3828
- values: o
4066
+ values: l
3829
4067
  };
3830
4068
  }
3831
- function J(e, t) {
4069
+ function he(e, t) {
3832
4070
  const i = [], a = e.lengthUnitScale;
3833
- return Ji(e, t, a, i), Zi(e, t, i), ea(e, t, i), ta(e, t, a, i), i.length === 0 && ia(e, t, i), i;
4071
+ return Oa(e, t, a, i), La(e, t, i), Va(e, t, i), Da(e, t, a, i), i.length === 0 && Ua(e, t, i), i;
3834
4072
  }
3835
- function Ji(e, t, i, a) {
4073
+ function Oa(e, t, i, a) {
3836
4074
  let n = e.properties?.getForEntity?.(t);
3837
- if ((!n || n.length === 0) && (n = xe(e, t)), !(!n || n.length === 0)) for (const r of n)a.push({
4075
+ if ((!n || n.length === 0) && (n = je(e, t)), !(!n || n.length === 0)) for (const r of n)a.push({
3838
4076
  name: r.name,
3839
- properties: (r.properties || []).map((s)=>ye(s, i))
4077
+ properties: (r.properties || []).map((s)=>Le(s, i))
3840
4078
  });
3841
4079
  }
3842
- function Zi(e, t, i) {
4080
+ function La(e, t, i) {
3843
4081
  let a = e.quantities?.getForEntity?.(t);
3844
- if ((!a || a.length === 0) && (a = Ce(e, t)), !(!a || a.length === 0)) for (const n of a)i.push({
4082
+ if ((!a || a.length === 0) && (a = We(e, t)), !(!a || a.length === 0)) for (const n of a)i.push({
3845
4083
  name: n.name,
3846
4084
  properties: (n.quantities || []).map((r)=>({
3847
4085
  name: r.name,
3848
4086
  value: r.value,
3849
- dataType: Ki(r.type)
4087
+ dataType: $a(r.type)
3850
4088
  }))
3851
4089
  });
3852
4090
  }
3853
- function ea(e, t, i) {
3854
- const a = e.relationships?.getRelated?.(t, A.DefinesByProperties, "inverse") || [];
4091
+ function Va(e, t, i) {
4092
+ const a = e.relationships?.getRelated?.(t, M.DefinesByProperties, "inverse") || [];
3855
4093
  for (const n of a){
3856
4094
  const r = e.entityIndex?.byId?.get?.(n);
3857
4095
  if (!r) continue;
3858
4096
  const s = String(r.type).toUpperCase();
3859
4097
  if (s === "IFCPROPERTYSET" || s === "IFCELEMENTQUANTITY" || !s.endsWith("PROPERTIES")) continue;
3860
- const l = N(e, n), o = l.find((c)=>c.name === "Name")?.value;
3861
- if (typeof o != "string" || !o || i.some((c)=>c.name === o)) continue;
3862
- const u = l.filter((c)=>c.name !== "GlobalId" && c.name !== "Name" && c.name !== "Description" && c.value !== void 0 && c.value !== "").map((c)=>({
4098
+ const o = w(e, n), l = o.find((c)=>c.name === "Name")?.value;
4099
+ if (typeof l != "string" || !l || i.some((c)=>c.name === l)) continue;
4100
+ const u = o.filter((c)=>c.name !== "GlobalId" && c.name !== "Name" && c.name !== "Description" && c.value !== void 0 && c.value !== "").map((c)=>({
3863
4101
  name: c.name,
3864
4102
  value: c.value,
3865
4103
  dataType: ""
3866
4104
  }));
3867
4105
  u.length > 0 && i.push({
3868
- name: o,
4106
+ name: l,
3869
4107
  properties: u
3870
4108
  });
3871
4109
  }
3872
4110
  }
3873
- function ta(e, t, i, a) {
3874
- const n = Re(e, t);
4111
+ function Da(e, t, i, a) {
4112
+ const n = ze(e, t);
3875
4113
  if (!n || !n.properties || n.properties.length === 0) return;
3876
4114
  const r = new Set(a.map((s)=>s.name));
3877
4115
  for (const s of n.properties)r.has(s.name) || a.push({
3878
4116
  name: s.name,
3879
- properties: (s.properties || []).map((l)=>ye(l, i))
4117
+ properties: (s.properties || []).map((o)=>Le(o, i))
3880
4118
  });
3881
4119
  }
3882
- function ia(e, t, i) {
3883
- const a = Me(e, t);
4120
+ function Ua(e, t, i) {
4121
+ const a = Ke(e, t);
3884
4122
  if (a.length !== 0) for (const n of a)i.push({
3885
4123
  name: n.name,
3886
4124
  properties: (n.properties || []).map((r)=>({
3887
4125
  name: r.name,
3888
4126
  value: Array.isArray(r.value) ? JSON.stringify(r.value) : r.value,
3889
- dataType: fe(r.type),
4127
+ dataType: Oe(r.type),
3890
4128
  ...Array.isArray(r.values) && r.values.length > 0 ? {
3891
4129
  values: r.values
3892
4130
  } : {}
3893
4131
  }))
3894
4132
  });
3895
4133
  }
3896
- function ye(e, t) {
3897
- const i = Array.isArray(e.values) && e.values.length > 0, a = e.dataType ?? (i ? void 0 : fe(e.type)), n = Array.isArray(e.value) ? JSON.stringify(e.value) : e.value, r = i ? e.values : void 0, s = Qi(n, r, a, t);
4134
+ function Le(e, t) {
4135
+ const i = Array.isArray(e.values) && e.values.length > 0, a = e.dataType ?? (i ? void 0 : Oe(e.type)), n = Array.isArray(e.value) ? JSON.stringify(e.value) : e.value, r = i ? e.values : void 0, s = Fa(n, r, a, t);
3898
4136
  return {
3899
4137
  name: e.name,
3900
4138
  value: s.value,
@@ -3904,32 +4142,32 @@ let __tla = Promise.all([
3904
4142
  } : {}
3905
4143
  };
3906
4144
  }
3907
- function aa(e, t) {
3908
- const a = N(e, t).find((s)=>s.name === "PredefinedType"), n = typeof a?.value == "string" && a.value ? a.value : void 0;
4145
+ function ka(e, t) {
4146
+ const a = w(e, t).find((s)=>s.name === "PredefinedType"), n = typeof a?.value == "string" && a.value ? a.value : void 0;
3909
4147
  if (n && n !== "NOTDEFINED") return n;
3910
- const r = e.relationships?.getRelated?.(t, A.DefinesByType, "inverse") || [];
4148
+ const r = e.relationships?.getRelated?.(t, M.DefinesByType, "inverse") || [];
3911
4149
  for (const s of r){
3912
- const o = N(e, s).find((c)=>c.name === "PredefinedType"), u = typeof o?.value == "string" && o.value ? o.value : void 0;
4150
+ const l = w(e, s).find((c)=>c.name === "PredefinedType"), u = typeof l?.value == "string" && l.value ? l.value : void 0;
3913
4151
  if (u && u !== "NOTDEFINED") return u;
3914
4152
  }
3915
4153
  return n;
3916
4154
  }
3917
- function na(e, t, i) {
3918
- const a = N(e, t), r = a.find((u)=>u.name === "PredefinedType")?.value;
4155
+ function Ba(e, t, i) {
4156
+ const a = w(e, t), r = a.find((u)=>u.name === "PredefinedType")?.value;
3919
4157
  if (typeof r == "string" && r && r !== "NOTDEFINED" && r !== "USERDEFINED") return r;
3920
4158
  const s = a.find((u)=>u.name === "ElementType") || a.find((u)=>u.name === "ObjectType") || a.find((u)=>u.name === "ProcessType") || a.find((u)=>u.name === "ResourceType");
3921
4159
  if (s && typeof s.value == "string" && s.value) return s.value;
3922
- const l = e.relationships?.getRelated?.(t, A.DefinesByType, "inverse") || [];
3923
- for (const u of l){
3924
- const c = N(e, u), d = c.find((y)=>y.name === "PredefinedType")?.value;
4160
+ const o = e.relationships?.getRelated?.(t, M.DefinesByType, "inverse") || [];
4161
+ for (const u of o){
4162
+ const c = w(e, u), d = c.find((f)=>f.name === "PredefinedType")?.value;
3925
4163
  if (typeof d == "string" && d && d !== "NOTDEFINED" && d !== "USERDEFINED") return d;
3926
- const f = c.find((y)=>y.name === "ElementType") || c.find((y)=>y.name === "ObjectType") || c.find((y)=>y.name === "ProcessType") || c.find((y)=>y.name === "ResourceType");
3927
- if (f && typeof f.value == "string" && f.value) return f.value;
4164
+ const y = c.find((f)=>f.name === "ElementType") || c.find((f)=>f.name === "ObjectType") || c.find((f)=>f.name === "ProcessType") || c.find((f)=>f.name === "ResourceType");
4165
+ if (y && typeof y.value == "string" && y.value) return y.value;
3928
4166
  }
3929
- const o = i();
3930
- return o || (typeof r == "string" && r ? r : void 0);
4167
+ const l = i();
4168
+ return l || (typeof r == "string" && r ? r : void 0);
3931
4169
  }
3932
- function ra(e) {
4170
+ function Ha(e) {
3933
4171
  switch((e || "").toUpperCase()){
3934
4172
  case "IFC2X3":
3935
4173
  return "IFC2X3";
@@ -3943,32 +4181,32 @@ let __tla = Promise.all([
3943
4181
  return "IFC4";
3944
4182
  }
3945
4183
  }
3946
- const sa = {
3947
- IfcRelAggregates: A.Aggregates,
3948
- IfcRelAssignsToGroup: A.AssignsToGroup,
3949
- IfcRelContainedInSpatialStructure: A.ContainsElements,
3950
- IfcRelNests: A.Aggregates,
3951
- IfcRelVoidsElement: A.VoidsElement,
3952
- IfcRelFillsElement: A.FillsElement
4184
+ const Ya = {
4185
+ IfcRelAggregates: M.Aggregates,
4186
+ IfcRelAssignsToGroup: M.AssignsToGroup,
4187
+ IfcRelContainedInSpatialStructure: M.ContainsElements,
4188
+ IfcRelNests: M.Aggregates,
4189
+ IfcRelVoidsElement: M.VoidsElement,
4190
+ IfcRelFillsElement: M.FillsElement
3953
4191
  };
3954
- pa = function(e) {
4192
+ Wa = function(e) {
3955
4193
  const t = new Map;
3956
4194
  function i(r) {
3957
4195
  let s = t.get(r);
3958
- return s || (s = N(e, r), t.set(r, s)), s;
4196
+ return s || (s = w(e, r), t.set(r, s)), s;
3959
4197
  }
3960
4198
  function a(r, s) {
3961
- const l = s.toLowerCase(), o = i(r);
3962
- for (const u of o)if (u.name.toLowerCase() === l) return u.value;
4199
+ const o = s.toLowerCase(), l = i(r);
4200
+ for (const u of l)if (u.name.toLowerCase() === o) return u.value;
3963
4201
  }
3964
4202
  const n = {
3965
4203
  getEntityType (r) {
3966
4204
  const s = e.entities?.getTypeName?.(r);
3967
4205
  if (s && s !== "Unknown") return s;
3968
- const l = e.entityIndex?.byId;
3969
- if (!l) return;
3970
- const o = l.get(r);
3971
- if (o) return typeof o == "object" && "type" in o ? String(o.type) : void 0;
4206
+ const o = e.entityIndex?.byId;
4207
+ if (!o) return;
4208
+ const l = o.get(r);
4209
+ if (l) return typeof l == "object" && "type" in l ? String(l.type) : void 0;
3972
4210
  },
3973
4211
  getEntityName (r) {
3974
4212
  const s = a(r, "Name");
@@ -3986,14 +4224,14 @@ let __tla = Promise.all([
3986
4224
  return i(r).map((s)=>s.name);
3987
4225
  },
3988
4226
  getAttributeXsdTypes (r, s) {
3989
- const l = n.getEntityType(r);
3990
- if (l) return _e(ra(e.schemaVersion), l, s);
4227
+ const o = n.getEntityType(r);
4228
+ if (o) return Je(Ha(e.schemaVersion), o, s);
3991
4229
  },
3992
4230
  getPredefinedTypeRaw (r) {
3993
- return aa(e, r);
4231
+ return ka(e, r);
3994
4232
  },
3995
4233
  getObjectType (r) {
3996
- return na(e, r, ()=>e.entities?.getObjectType?.(r));
4234
+ return Ba(e, r, ()=>e.entities?.getObjectType?.(r));
3997
4235
  },
3998
4236
  getEntitiesByType (r) {
3999
4237
  const s = e.entityIndex?.byType?.get(r.toUpperCase());
@@ -4003,9 +4241,9 @@ let __tla = Promise.all([
4003
4241
  const r = e.entityIndex?.byId;
4004
4242
  return r ? Array.from(r.keys()) : [];
4005
4243
  },
4006
- getPropertyValue (r, s, l) {
4007
- const o = s.toLowerCase(), u = l.toLowerCase(), c = J(e, r);
4008
- for (const m of c)if (m.name.toLowerCase() === o) {
4244
+ getPropertyValue (r, s, o) {
4245
+ const l = s.toLowerCase(), u = o.toLowerCase(), c = he(e, r);
4246
+ for (const m of c)if (m.name.toLowerCase() === l) {
4009
4247
  for (const d of m.properties || [])if (d.name.toLowerCase() === u) return {
4010
4248
  value: d.value,
4011
4249
  dataType: d.dataType,
@@ -4015,35 +4253,35 @@ let __tla = Promise.all([
4015
4253
  }
4016
4254
  },
4017
4255
  getPropertySets (r) {
4018
- return J(e, r);
4256
+ return he(e, r);
4019
4257
  },
4020
4258
  getClassifications (r) {
4021
- return Wi(e, r);
4259
+ return _a(e, r);
4022
4260
  },
4023
4261
  getMaterials (r) {
4024
- return ji(Ne(e, r));
4262
+ return Pa(Qe(e, r));
4025
4263
  },
4026
4264
  getParent (r, s) {
4027
- const l = n.getAncestors(r, s);
4028
- return l.length > 0 ? l[0] : void 0;
4265
+ const o = n.getAncestors(r, s);
4266
+ return o.length > 0 ? o[0] : void 0;
4029
4267
  },
4030
4268
  getAncestors (r, s) {
4031
- const l = e.relationships;
4032
- if (!l?.getRelated) return [];
4033
- const o = sa[s];
4034
- if (o === void 0) return [];
4269
+ const o = e.relationships;
4270
+ if (!o?.getRelated) return [];
4271
+ const l = Ya[s];
4272
+ if (l === void 0) return [];
4035
4273
  const u = [], c = new Set([
4036
4274
  r
4037
4275
  ]), m = [
4038
4276
  r
4039
4277
  ];
4040
4278
  for(; m.length > 0;){
4041
- const d = m.shift(), f = l.getRelated(d, o, "inverse");
4042
- for (const y of f || [])c.has(y) || (c.add(y), u.push({
4043
- expressId: y,
4044
- entityType: n.getEntityType(y) || "Unknown",
4045
- predefinedType: n.getObjectType(y)
4046
- }), m.push(y));
4279
+ const d = m.shift(), y = o.getRelated(d, l, "inverse");
4280
+ for (const f of y || [])c.has(f) || (c.add(f), u.push({
4281
+ expressId: f,
4282
+ entityType: n.getEntityType(f) || "Unknown",
4283
+ predefinedType: n.getObjectType(f)
4284
+ }), m.push(f));
4047
4285
  }
4048
4286
  return u;
4049
4287
  },
@@ -4060,8 +4298,8 @@ let __tla = Promise.all([
4060
4298
  return n.getObjectType(r);
4061
4299
  default:
4062
4300
  {
4063
- const o = a(r, s);
4064
- if (o !== void 0) return o;
4301
+ const l = a(r, s);
4302
+ if (l !== void 0) return l;
4065
4303
  const u = e.entities;
4066
4304
  return u?.getAttribute ? u.getAttribute(r, s) : void 0;
4067
4305
  }
@@ -4071,4 +4309,4 @@ let __tla = Promise.all([
4071
4309
  return n;
4072
4310
  };
4073
4311
  });
4074
- export { g as I, ca as a, ua as b, pa as c, Pe as p, oa as v, __tla };
4312
+ export { x as I, ja as a, Xa as b, Wa as c, tt as p, Ga as v, __tla };