@ifc-lite/viewer 1.27.0 → 1.28.1

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 (162) hide show
  1. package/.turbo/turbo-build.log +35 -42
  2. package/CHANGELOG.md +74 -0
  3. package/dist/assets/{basketViewActivator-B3CdrLsb.js → basketViewActivator-Ce38DhXd.js} +8 -8
  4. package/dist/assets/{bcf-QeHK_Aud.js → bcf-Cv_O3JfD.js} +56 -56
  5. package/dist/assets/{decode-worker-CgM1iNSK.js → decode-worker-Cjign7Zh.js} +1 -1
  6. package/dist/assets/{deflate-B-d0SYQM.js → deflate-HbyMq59o.js} +1 -1
  7. package/dist/assets/drawing-2d-DW98umlt.js +257 -0
  8. package/dist/assets/e57-source-2wI9jkCA.js +1 -0
  9. package/dist/assets/{exporters-B4LbZFeT.js → exporters-BuD3XRzB.js} +1309 -1153
  10. package/dist/assets/geometry.worker-TH3fCCoY.js +1 -0
  11. package/dist/assets/{geotiff-CrVtDRFq.js → geotiff-B2HA8Bwm.js} +10 -10
  12. package/dist/assets/{ids-DjsGFN10.js → ids-DYUFMd5f.js} +952 -945
  13. package/dist/assets/{ifc-lite_bg-DsYUIHm3.wasm → ifc-lite_bg-BEA5DLmg.wasm} +0 -0
  14. package/dist/assets/index-E9wB0zWt.css +1 -0
  15. package/dist/assets/{index-COYokSKc.js → index-n5O1QJMM.js} +37877 -38126
  16. package/dist/assets/{index.es-CY202jA3.js → index.es-BKVIpZgL.js} +9 -9
  17. package/dist/assets/{jpeg-D4wOkf5h.js → jpeg-C7hjKjPX.js} +1 -1
  18. package/dist/assets/{jspdf.es.min-DIGb9BHN.js → jspdf.es.min-oWlFc42Y.js} +4 -4
  19. package/dist/assets/lens-C4p1kQ0p.js +1 -0
  20. package/dist/assets/{lerc-DmW0_tgf.js → lerc-BfIOGhQz.js} +1 -1
  21. package/dist/assets/{lzw-oWetY-d6.js → lzw-B0jRuuW5.js} +1 -1
  22. package/dist/assets/{native-bridge-BX8_tHXE.js → native-bridge-DpB-dtEn.js} +6 -3
  23. package/dist/assets/{packbits-F8Nkp4NY.js → packbits-DVvBTC39.js} +1 -1
  24. package/dist/assets/parser.worker-BDsWQ6rc.js +182 -0
  25. package/dist/assets/{pdf-Dsh3HPZB.js → pdf-dVIqI5ac.js} +10 -10
  26. package/dist/assets/raw-C0ZJYGmN.js +1 -0
  27. package/dist/assets/{sandbox-BAC3a-eN.js → sandbox-qpJlrNN0.js} +2962 -2554
  28. package/dist/assets/server-client-DVZ2huNS.js +719 -0
  29. package/dist/assets/{webimage-BLV1dgmd.js → webimage-B394g0Tw.js} +1 -1
  30. package/dist/assets/{xlsx-Bc2HTrjC.js → xlsx-D-oHO76J.js} +8 -8
  31. package/dist/assets/{zstd-C_1HxVrA.js → zstd-Bf38MwV2.js} +1 -1
  32. package/dist/index.html +9 -9
  33. package/package.json +24 -23
  34. package/src/App.tsx +1 -3
  35. package/src/components/mcp/playground-dispatcher.ts +3 -0
  36. package/src/components/mcp/playground-files.ts +33 -1
  37. package/src/components/viewer/BCFPanel.tsx +1 -16
  38. package/src/components/viewer/ChatPanel.tsx +11 -46
  39. package/src/components/viewer/CommandPalette.tsx +6 -1
  40. package/src/components/viewer/ComparePanel.tsx +420 -0
  41. package/src/components/viewer/HierarchyPanel.tsx +48 -183
  42. package/src/components/viewer/IDSPanel.tsx +1 -26
  43. package/src/components/viewer/MainToolbar.tsx +94 -187
  44. package/src/components/viewer/MobileToolbar.tsx +1 -9
  45. package/src/components/viewer/PropertiesPanel.tsx +98 -127
  46. package/src/components/viewer/ScriptPanel.tsx +8 -34
  47. package/src/components/viewer/Section2DPanel.tsx +32 -1
  48. package/src/components/viewer/ViewerLayout.tsx +5 -2
  49. package/src/components/viewer/Viewport.tsx +3 -0
  50. package/src/components/viewer/ViewportContainer.tsx +24 -42
  51. package/src/components/viewer/ViewportOverlays.tsx +1 -4
  52. package/src/components/viewer/hierarchy/HierarchyNode.tsx +3 -3
  53. package/src/components/viewer/hierarchy/ifc-icons.ts +9 -0
  54. package/src/components/viewer/hierarchy/treeDataBuilder.ts +87 -0
  55. package/src/components/viewer/hierarchy/types.ts +1 -0
  56. package/src/components/viewer/hierarchy/useHierarchyTree.ts +6 -2
  57. package/src/components/viewer/properties/MaterialTotalsPanel.tsx +283 -0
  58. package/src/components/viewer/useGeometryStreaming.ts +0 -2
  59. package/src/hooks/federationLoadGate.test.ts +12 -2
  60. package/src/hooks/federationLoadGate.ts +9 -2
  61. package/src/hooks/ingest/federationAlign.ts +488 -0
  62. package/src/hooks/ingest/viewerModelIngest.ts +3 -212
  63. package/src/hooks/useCompare.ts +0 -0
  64. package/src/hooks/useCompareOverlay.ts +119 -0
  65. package/src/hooks/useDrawingGeneration.ts +234 -14
  66. package/src/hooks/useIfc.ts +1 -1
  67. package/src/hooks/useIfcCache.ts +100 -24
  68. package/src/hooks/useIfcFederation.ts +42 -811
  69. package/src/hooks/useIfcLoader.ts +349 -1517
  70. package/src/hooks/useIfcServer.ts +3 -0
  71. package/src/hooks/useLens.ts +5 -1
  72. package/src/hooks/useSymbolicAnnotations.ts +70 -38
  73. package/src/lib/compare/buildFingerprints.ts +173 -0
  74. package/src/lib/compare/describeChange.ts +0 -0
  75. package/src/lib/compare/geometricData.test.ts +54 -0
  76. package/src/lib/compare/geometricData.ts +37 -0
  77. package/src/lib/compare/overlay.test.ts +99 -0
  78. package/src/lib/compare/overlay.ts +91 -0
  79. package/src/lib/geo/cesium-placement.ts +1 -1
  80. package/src/lib/geo/reproject.ts +4 -1
  81. package/src/lib/llm/script-edit-ops.ts +23 -0
  82. package/src/lib/llm/stream-client.ts +8 -1
  83. package/src/lib/search/result-export.ts +7 -1
  84. package/src/sdk/adapters/export-adapter.ts +6 -1
  85. package/src/services/cacheService.ts +9 -25
  86. package/src/services/desktop-export.ts +2 -59
  87. package/src/services/file-dialog.ts +8 -142
  88. package/src/store/constants.ts +23 -0
  89. package/src/store/globalId.ts +15 -13
  90. package/src/store/index.ts +19 -6
  91. package/src/store/slices/cesiumSlice.ts +8 -1
  92. package/src/store/slices/compareSlice.ts +96 -0
  93. package/src/store/slices/drawing2DSlice.ts +8 -0
  94. package/src/store/slices/lensSlice.ts +8 -0
  95. package/src/store/slices/visibilitySlice.ts +22 -1
  96. package/src/store/types.ts +1 -71
  97. package/src/utils/acquireFileBuffer.test.ts +12 -4
  98. package/src/utils/ifcConfig.ts +0 -12
  99. package/src/utils/loadingUtils.ts +32 -0
  100. package/src/utils/spatialHierarchy.test.ts +53 -1
  101. package/src/utils/spatialHierarchy.ts +42 -2
  102. package/src/vite-env.d.ts +2 -0
  103. package/vite.config.ts +6 -3
  104. package/DESKTOP_CONTRACT_VERSION +0 -1
  105. package/dist/assets/drawing-2d-C71b8Ugx.js +0 -257
  106. package/dist/assets/e57-source-CQHxE8n3.js +0 -1
  107. package/dist/assets/event-B0kAzHa-.js +0 -1
  108. package/dist/assets/geometry.worker-BdH-E6NB.js +0 -1
  109. package/dist/assets/index-ajK6D32J.css +0 -1
  110. package/dist/assets/lens-PYsLu_MA.js +0 -1
  111. package/dist/assets/parser.worker-D591Zu_-.js +0 -182
  112. package/dist/assets/raw-D9iw0tmc.js +0 -1
  113. package/dist/assets/server-client-Cjwnm7il.js +0 -706
  114. package/dist/assets/tauri-core-stub-D8Fa-u43.js +0 -1
  115. package/dist/assets/tauri-dialog-stub-r7Wksg7o.js +0 -1
  116. package/dist/assets/tauri-fs-stub-BdeRC7aK.js +0 -1
  117. package/src/components/viewer/DesktopEntitlementBanner.tsx +0 -74
  118. package/src/components/viewer/SettingsPage.tsx +0 -581
  119. package/src/hooks/ingest/resolveDataStoreOrAbort.test.ts +0 -61
  120. package/src/hooks/ingest/resolveDataStoreOrAbort.ts +0 -28
  121. package/src/hooks/ingest/watchedGeometryStream.test.ts +0 -78
  122. package/src/hooks/ingest/watchedGeometryStream.ts +0 -76
  123. package/src/lib/desktop/desktopEntitlementEvents.ts +0 -39
  124. package/src/lib/desktop-entitlement.ts +0 -43
  125. package/src/lib/desktop-product.ts +0 -130
  126. package/src/lib/platform.ts +0 -23
  127. package/src/services/desktop-cache.ts +0 -186
  128. package/src/services/desktop-harness.ts +0 -196
  129. package/src/services/desktop-logger.ts +0 -20
  130. package/src/services/desktop-native-metadata.ts +0 -230
  131. package/src/services/desktop-panel-actions.ts +0 -43
  132. package/src/services/desktop-preferences.ts +0 -44
  133. package/src/services/fs-cache.ts +0 -212
  134. package/src/services/tauri-core-stub.ts +0 -7
  135. package/src/services/tauri-dialog-stub.ts +0 -7
  136. package/src/services/tauri-fs-stub.ts +0 -7
  137. package/src/services/tauri-modules.d.ts +0 -50
  138. package/src/store/slices/desktopEntitlementSlice.ts +0 -86
  139. package/src/utils/desktopModelSnapshot.ts +0 -358
  140. package/src/utils/nativeSpatialDataStore.ts +0 -277
  141. package/src-tauri/Cargo.toml +0 -29
  142. package/src-tauri/build.rs +0 -7
  143. package/src-tauri/capabilities/default.json +0 -18
  144. package/src-tauri/icons/128x128.png +0 -0
  145. package/src-tauri/icons/128x128@2x.png +0 -0
  146. package/src-tauri/icons/32x32.png +0 -0
  147. package/src-tauri/icons/Square107x107Logo.png +0 -0
  148. package/src-tauri/icons/Square142x142Logo.png +0 -0
  149. package/src-tauri/icons/Square150x150Logo.png +0 -0
  150. package/src-tauri/icons/Square284x284Logo.png +0 -0
  151. package/src-tauri/icons/Square30x30Logo.png +0 -0
  152. package/src-tauri/icons/Square310x310Logo.png +0 -0
  153. package/src-tauri/icons/Square44x44Logo.png +0 -0
  154. package/src-tauri/icons/Square71x71Logo.png +0 -0
  155. package/src-tauri/icons/Square89x89Logo.png +0 -0
  156. package/src-tauri/icons/StoreLogo.png +0 -0
  157. package/src-tauri/icons/icon.icns +0 -0
  158. package/src-tauri/icons/icon.ico +0 -0
  159. package/src-tauri/icons/icon.png +0 -0
  160. package/src-tauri/src/lib.rs +0 -21
  161. package/src-tauri/src/main.rs +0 -10
  162. package/src-tauri/tauri.conf.json +0 -39
@@ -1,6 +1,6 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/native-bridge-BX8_tHXE.js","assets/sandbox-BAC3a-eN.js","assets/lens-PYsLu_MA.js"])))=>i.map(i=>d[i]);
2
- import { V as We, _ as je, aT as nt, a9 as ke, aa as Ye, l as et, m as bt, aW as Ue, E as He, al as se, ap as Xe, am as qe, aO as Qe, X as Je, k as ie, j as Ke, __tla as __tla_0 } from "./sandbox-BAC3a-eN.js";
3
- let ds, ls, Be, us, ts, Ge, cs, En, hs, oe, fs, as;
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/native-bridge-DpB-dtEn.js","assets/sandbox-qpJlrNN0.js","assets/lens-C4p1kQ0p.js"])))=>i.map(i=>d[i]);
2
+ import { U as Ye, _ as Xe, aV as it, aa as qe, ab as Qe, P as st, Q as Et, aY as Ge, E as Je, am as re, aq as Ke, an as Ze, aQ as tn, W as en, j as oe, i as nn, __tla as __tla_0 } from "./sandbox-qpJlrNN0.js";
3
+ let ps, hs, De, _s, is, us, Rn, Is, gs, fs, ds;
4
4
  let __tla = Promise.all([
5
5
  (()=>{
6
6
  try {
@@ -9,74 +9,81 @@ let __tla = Promise.all([
9
9
  })()
10
10
  ]).then(async ()=>{
11
11
  let a;
12
- function U(r) {
13
- Nt === ot.length && ot.push(ot.length + 1);
14
- const t = Nt;
15
- return Nt = ot[t], ot[t] = r, t;
12
+ function B(r) {
13
+ Ot === ct.length && ct.push(ct.length + 1);
14
+ const t = Ot;
15
+ return Ot = ct[t], ct[t] = r, t;
16
16
  }
17
- function Ze(r) {
18
- if (kt == 1) throw new Error("out of js stack");
19
- return ot[--kt] = r, kt;
17
+ function sn(r) {
18
+ if (Yt == 1) throw new Error("out of js stack");
19
+ return ct[--Yt] = r, Yt;
20
20
  }
21
- const ue = typeof FinalizationRegistry > "u" ? {
21
+ const pe = typeof FinalizationRegistry > "u" ? {
22
22
  register: ()=>{},
23
23
  unregister: ()=>{}
24
24
  } : new FinalizationRegistry((r)=>r.dtor(r.a, r.b));
25
- function tn(r) {
26
- r < 132 || (ot[r] = Nt, Nt = r);
25
+ function rn(r) {
26
+ r < 132 || (ct[r] = Ot, Ot = r);
27
27
  }
28
- function re(r, t) {
29
- return r = r >>> 0, sn().subarray(r / 4, r / 4 + t);
28
+ function ae(r, t) {
29
+ return r = r >>> 0, Ve().subarray(r / 4, r / 4 + t);
30
30
  }
31
- function en(r, t) {
32
- return r = r >>> 0, rn().subarray(r / 8, r / 8 + t);
31
+ function on(r, t) {
32
+ return r = r >>> 0, dn().subarray(r / 8, r / 8 + t);
33
33
  }
34
- function De(r, t) {
35
- return r = r >>> 0, ve().subarray(r / 4, r / 4 + t);
34
+ function $e(r, t) {
35
+ return r = r >>> 0, ze().subarray(r / 4, r / 4 + t);
36
36
  }
37
- function nn(r, t) {
37
+ function an(r, t) {
38
+ return r = r >>> 0, ln().subarray(r / 8, r / 8 + t);
39
+ }
40
+ function cn(r, t) {
38
41
  return r = r >>> 0, Ct().subarray(r / 1, r / 1 + t);
39
42
  }
43
+ let Ft = null;
44
+ function ln() {
45
+ return (Ft === null || Ft.byteLength === 0) && (Ft = new BigUint64Array(a.memory.buffer)), Ft;
46
+ }
40
47
  let _t = null;
41
48
  function A() {
42
49
  return (_t === null || _t.buffer.detached === !0 || _t.buffer.detached === void 0 && _t.buffer !== a.memory.buffer) && (_t = new DataView(a.memory.buffer)), _t;
43
50
  }
44
- let Tt = null;
45
- function sn() {
46
- return (Tt === null || Tt.byteLength === 0) && (Tt = new Float32Array(a.memory.buffer)), Tt;
51
+ let Rt = null;
52
+ function Ve() {
53
+ return (Rt === null || Rt.byteLength === 0) && (Rt = new Float32Array(a.memory.buffer)), Rt;
47
54
  }
48
- let Ft = null;
49
- function rn() {
50
- return (Ft === null || Ft.byteLength === 0) && (Ft = new Float64Array(a.memory.buffer)), Ft;
55
+ let St = null;
56
+ function dn() {
57
+ return (St === null || St.byteLength === 0) && (St = new Float64Array(a.memory.buffer)), St;
51
58
  }
52
- function J(r, t) {
53
- return r = r >>> 0, cn(r, t);
59
+ function K(r, t) {
60
+ return r = r >>> 0, pn(r, t);
54
61
  }
55
- let Rt = null;
56
- function ve() {
57
- return (Rt === null || Rt.byteLength === 0) && (Rt = new Uint32Array(a.memory.buffer)), Rt;
62
+ let Nt = null;
63
+ function ze() {
64
+ return (Nt === null || Nt.byteLength === 0) && (Nt = new Uint32Array(a.memory.buffer)), Nt;
58
65
  }
59
- let St = null;
66
+ let At = null;
60
67
  function Ct() {
61
- return (St === null || St.byteLength === 0) && (St = new Uint8Array(a.memory.buffer)), St;
68
+ return (At === null || At.byteLength === 0) && (At = new Uint8Array(a.memory.buffer)), At;
62
69
  }
63
- function k(r) {
64
- return ot[r];
70
+ function W(r) {
71
+ return ct[r];
65
72
  }
66
- function Qt(r, t) {
73
+ function Kt(r, t) {
67
74
  try {
68
75
  return r.apply(this, t);
69
76
  } catch (e) {
70
- a.__wbindgen_export(U(e));
77
+ a.__wbindgen_export(B(e));
71
78
  }
72
79
  }
73
- let ot = new Array(128).fill(void 0);
74
- ot.push(void 0, null, !0, !1);
75
- let Nt = ot.length;
76
- function zt(r) {
80
+ let ct = new Array(128).fill(void 0);
81
+ ct.push(void 0, null, !0, !1);
82
+ let Ot = ct.length;
83
+ function bt(r) {
77
84
  return r == null;
78
85
  }
79
- function on(r, t, e, n) {
86
+ function fn(r, t, e, n) {
80
87
  const s = {
81
88
  a: r,
82
89
  b: t,
@@ -93,21 +100,25 @@ let __tla = Promise.all([
93
100
  }
94
101
  };
95
102
  return i._wbg_cb_unref = ()=>{
96
- --s.cnt === 0 && (s.dtor(s.a, s.b), s.a = 0, ue.unregister(s));
97
- }, ue.register(i, s, s), i;
103
+ --s.cnt === 0 && (s.dtor(s.a, s.b), s.a = 0, pe.unregister(s));
104
+ }, pe.register(i, s, s), i;
98
105
  }
99
- function ut(r, t) {
106
+ function ft(r, t) {
100
107
  const e = t(r.length * 4, 4) >>> 0;
101
- return ve().set(r, e / 4), G = r.length, e;
108
+ return ze().set(r, e / 4), v = r.length, e;
102
109
  }
103
- function It(r, t) {
110
+ function gt(r, t) {
104
111
  const e = t(r.length * 1, 1) >>> 0;
105
- return Ct().set(r, e / 1), G = r.length, e;
112
+ return Ct().set(r, e / 1), v = r.length, e;
113
+ }
114
+ function un(r, t) {
115
+ const e = t(r.length * 4, 4) >>> 0;
116
+ return Ve().set(r, e / 4), v = r.length, e;
106
117
  }
107
- function ct(r, t, e) {
118
+ function lt(r, t, e) {
108
119
  if (e === void 0) {
109
- const c = At.encode(r), l = t(c.length, 1) >>> 0;
110
- return Ct().subarray(l, l + c.length).set(c), G = c.length, l;
120
+ const c = xt.encode(r), l = t(c.length, 1) >>> 0;
121
+ return Ct().subarray(l, l + c.length).set(c), v = c.length, l;
111
122
  }
112
123
  let n = r.length, s = t(n, 1) >>> 0;
113
124
  const i = Ct();
@@ -119,92 +130,95 @@ let __tla = Promise.all([
119
130
  }
120
131
  if (o !== n) {
121
132
  o !== 0 && (r = r.slice(o)), s = e(s, n, n = o + r.length * 3, 1) >>> 0;
122
- const c = Ct().subarray(s + o, s + n), l = At.encodeInto(r, c);
133
+ const c = Ct().subarray(s + o, s + n), l = xt.encodeInto(r, c);
123
134
  o += l.written, s = e(s, n, o, 1) >>> 0;
124
135
  }
125
- return G = o, s;
136
+ return v = o, s;
126
137
  }
127
- let kt = 128;
128
- function D(r) {
129
- const t = k(r);
130
- return tn(r), t;
138
+ let Yt = 128;
139
+ function P(r) {
140
+ const t = W(r);
141
+ return rn(r), t;
131
142
  }
132
- let Yt = new TextDecoder("utf-8", {
143
+ let Xt = new TextDecoder("utf-8", {
133
144
  ignoreBOM: !0,
134
145
  fatal: !0
135
146
  });
136
- Yt.decode();
137
- const an = 2146435072;
138
- let Jt = 0;
139
- function cn(r, t) {
140
- return Jt += t, Jt >= an && (Yt = new TextDecoder("utf-8", {
147
+ Xt.decode();
148
+ const hn = 2146435072;
149
+ let Zt = 0;
150
+ function pn(r, t) {
151
+ return Zt += t, Zt >= hn && (Xt = new TextDecoder("utf-8", {
141
152
  ignoreBOM: !0,
142
153
  fatal: !0
143
- }), Yt.decode(), Jt = t), Yt.decode(Ct().subarray(r, r + t));
154
+ }), Xt.decode(), Zt = t), Xt.decode(Ct().subarray(r, r + t));
144
155
  }
145
- const At = new TextEncoder;
146
- "encodeInto" in At || (At.encodeInto = function(r, t) {
147
- const e = At.encode(r);
156
+ const xt = new TextEncoder;
157
+ "encodeInto" in xt || (xt.encodeInto = function(r, t) {
158
+ const e = xt.encode(r);
148
159
  return t.set(e), {
149
160
  read: r.length,
150
161
  written: e.length
151
162
  };
152
163
  });
153
- let G = 0;
154
- function ln(r, t, e) {
155
- a.__wasm_bindgen_func_elem_654(r, t, U(e));
164
+ let v = 0;
165
+ function gn(r, t, e) {
166
+ a.__wasm_bindgen_func_elem_675(r, t, B(e));
156
167
  }
157
- function dn(r, t, e, n) {
158
- a.__wasm_bindgen_func_elem_688(r, t, U(e), U(n));
168
+ function _n(r, t, e, n) {
169
+ a.__wasm_bindgen_func_elem_709(r, t, B(e), B(n));
159
170
  }
160
171
  typeof FinalizationRegistry > "u" || new FinalizationRegistry((r)=>a.__wbg_clashrunresult_free(r >>> 0, 1));
161
172
  typeof FinalizationRegistry > "u" || new FinalizationRegistry((r)=>a.__wbg_clashsession_free(r >>> 0, 1));
162
- const he = typeof FinalizationRegistry > "u" ? {
173
+ const ge = typeof FinalizationRegistry > "u" ? {
163
174
  register: ()=>{},
164
175
  unregister: ()=>{}
165
- } : new FinalizationRegistry((r)=>a.__wbg_gridaxiscollection_free(r >>> 0, 1)), pe = typeof FinalizationRegistry > "u" ? {
176
+ } : new FinalizationRegistry((r)=>a.__wbg_gridaxiscollection_free(r >>> 0, 1)), _e = typeof FinalizationRegistry > "u" ? {
166
177
  register: ()=>{},
167
178
  unregister: ()=>{}
168
179
  } : new FinalizationRegistry((r)=>a.__wbg_gridaxisjs_free(r >>> 0, 1)), Ie = typeof FinalizationRegistry > "u" ? {
169
180
  register: ()=>{},
170
181
  unregister: ()=>{}
171
- } : new FinalizationRegistry((r)=>a.__wbg_ifcapi_free(r >>> 0, 1)), _e = typeof FinalizationRegistry > "u" ? {
182
+ } : new FinalizationRegistry((r)=>a.__wbg_ifcapi_free(r >>> 0, 1)), ye = typeof FinalizationRegistry > "u" ? {
172
183
  register: ()=>{},
173
184
  unregister: ()=>{}
174
- } : new FinalizationRegistry((r)=>a.__wbg_meshcollection_free(r >>> 0, 1)), ge = typeof FinalizationRegistry > "u" ? {
185
+ } : new FinalizationRegistry((r)=>a.__wbg_meshcollection_free(r >>> 0, 1)), me = typeof FinalizationRegistry > "u" ? {
175
186
  register: ()=>{},
176
187
  unregister: ()=>{}
177
- } : new FinalizationRegistry((r)=>a.__wbg_meshdatajs_free(r >>> 0, 1)), ye = typeof FinalizationRegistry > "u" ? {
188
+ } : new FinalizationRegistry((r)=>a.__wbg_meshdatajs_free(r >>> 0, 1)), Ee = typeof FinalizationRegistry > "u" ? {
178
189
  register: ()=>{},
179
190
  unregister: ()=>{}
180
- } : new FinalizationRegistry((r)=>a.__wbg_profilecollection_free(r >>> 0, 1)), me = typeof FinalizationRegistry > "u" ? {
191
+ } : new FinalizationRegistry((r)=>a.__wbg_meshoutlinejs_free(r >>> 0, 1)), be = typeof FinalizationRegistry > "u" ? {
181
192
  register: ()=>{},
182
193
  unregister: ()=>{}
183
- } : new FinalizationRegistry((r)=>a.__wbg_profileentryjs_free(r >>> 0, 1)), Ee = typeof FinalizationRegistry > "u" ? {
194
+ } : new FinalizationRegistry((r)=>a.__wbg_profilecollection_free(r >>> 0, 1)), Ce = typeof FinalizationRegistry > "u" ? {
184
195
  register: ()=>{},
185
196
  unregister: ()=>{}
186
- } : new FinalizationRegistry((r)=>a.__wbg_symboliccircle_free(r >>> 0, 1)), be = typeof FinalizationRegistry > "u" ? {
197
+ } : new FinalizationRegistry((r)=>a.__wbg_profileentryjs_free(r >>> 0, 1)), we = typeof FinalizationRegistry > "u" ? {
187
198
  register: ()=>{},
188
199
  unregister: ()=>{}
189
- } : new FinalizationRegistry((r)=>a.__wbg_symbolicfillarea_free(r >>> 0, 1)), Ce = typeof FinalizationRegistry > "u" ? {
200
+ } : new FinalizationRegistry((r)=>a.__wbg_symboliccircle_free(r >>> 0, 1)), Te = typeof FinalizationRegistry > "u" ? {
190
201
  register: ()=>{},
191
202
  unregister: ()=>{}
192
- } : new FinalizationRegistry((r)=>a.__wbg_symbolicpolyline_free(r >>> 0, 1)), we = typeof FinalizationRegistry > "u" ? {
203
+ } : new FinalizationRegistry((r)=>a.__wbg_symbolicfillarea_free(r >>> 0, 1)), Fe = typeof FinalizationRegistry > "u" ? {
193
204
  register: ()=>{},
194
205
  unregister: ()=>{}
195
- } : new FinalizationRegistry((r)=>a.__wbg_symbolicrepresentationcollection_free(r >>> 0, 1)), Te = typeof FinalizationRegistry > "u" ? {
206
+ } : new FinalizationRegistry((r)=>a.__wbg_symbolicpolyline_free(r >>> 0, 1)), Re = typeof FinalizationRegistry > "u" ? {
207
+ register: ()=>{},
208
+ unregister: ()=>{}
209
+ } : new FinalizationRegistry((r)=>a.__wbg_symbolicrepresentationcollection_free(r >>> 0, 1)), Se = typeof FinalizationRegistry > "u" ? {
196
210
  register: ()=>{},
197
211
  unregister: ()=>{}
198
212
  } : new FinalizationRegistry((r)=>a.__wbg_symbolictext_free(r >>> 0, 1));
199
- class Ot {
213
+ class Lt {
200
214
  static __wrap(t) {
201
215
  t = t >>> 0;
202
- const e = Object.create(Ot.prototype);
203
- return e.__wbg_ptr = t, he.register(e, e.__wbg_ptr, e), e;
216
+ const e = Object.create(Lt.prototype);
217
+ return e.__wbg_ptr = t, ge.register(e, e.__wbg_ptr, e), e;
204
218
  }
205
219
  __destroy_into_raw() {
206
220
  const t = this.__wbg_ptr;
207
- return this.__wbg_ptr = 0, he.unregister(this), t;
221
+ return this.__wbg_ptr = 0, ge.unregister(this), t;
208
222
  }
209
223
  free() {
210
224
  const t = this.__destroy_into_raw();
@@ -215,22 +229,22 @@ let __tla = Promise.all([
215
229
  }
216
230
  getAxis(t) {
217
231
  const e = a.gridaxiscollection_getAxis(this.__wbg_ptr, t);
218
- return e === 0 ? void 0 : xt.__wrap(e);
232
+ return e === 0 ? void 0 : Mt.__wrap(e);
219
233
  }
220
234
  get isEmpty() {
221
235
  return a.gridaxiscollection_isEmpty(this.__wbg_ptr) !== 0;
222
236
  }
223
237
  }
224
- Symbol.dispose && (Ot.prototype[Symbol.dispose] = Ot.prototype.free);
225
- class xt {
238
+ Symbol.dispose && (Lt.prototype[Symbol.dispose] = Lt.prototype.free);
239
+ class Mt {
226
240
  static __wrap(t) {
227
241
  t = t >>> 0;
228
- const e = Object.create(xt.prototype);
229
- return e.__wbg_ptr = t, pe.register(e, e.__wbg_ptr, e), e;
242
+ const e = Object.create(Mt.prototype);
243
+ return e.__wbg_ptr = t, _e.register(e, e.__wbg_ptr, e), e;
230
244
  }
231
245
  __destroy_into_raw() {
232
246
  const t = this.__wbg_ptr;
233
- return this.__wbg_ptr = 0, pe.unregister(this), t;
247
+ return this.__wbg_ptr = 0, _e.unregister(this), t;
234
248
  }
235
249
  free() {
236
250
  const t = this.__destroy_into_raw();
@@ -238,7 +252,7 @@ let __tla = Promise.all([
238
252
  }
239
253
  get end() {
240
254
  const t = a.gridaxisjs_end(this.__wbg_ptr);
241
- return D(t);
255
+ return P(t);
242
256
  }
243
257
  get tag() {
244
258
  let t, e;
@@ -246,14 +260,14 @@ let __tla = Promise.all([
246
260
  const i = a.__wbindgen_add_to_stack_pointer(-16);
247
261
  a.gridaxisjs_tag(i, this.__wbg_ptr);
248
262
  var n = A().getInt32(i + 0, !0), s = A().getInt32(i + 4, !0);
249
- return t = n, e = s, J(n, s);
263
+ return t = n, e = s, K(n, s);
250
264
  } finally{
251
265
  a.__wbindgen_add_to_stack_pointer(16), a.__wbindgen_export2(t, e, 1);
252
266
  }
253
267
  }
254
268
  get start() {
255
269
  const t = a.gridaxisjs_start(this.__wbg_ptr);
256
- return D(t);
270
+ return P(t);
257
271
  }
258
272
  get axisId() {
259
273
  return a.gridaxisjs_axisId(this.__wbg_ptr) >>> 0;
@@ -262,8 +276,8 @@ let __tla = Promise.all([
262
276
  return a.gridaxisjs_gridId(this.__wbg_ptr) >>> 0;
263
277
  }
264
278
  }
265
- Symbol.dispose && (xt.prototype[Symbol.dispose] = xt.prototype.free);
266
- oe = class {
279
+ Symbol.dispose && (Mt.prototype[Symbol.dispose] = Mt.prototype.free);
280
+ class ce {
267
281
  __destroy_into_raw() {
268
282
  const t = this.__wbg_ptr;
269
283
  return this.__wbg_ptr = 0, Ie.unregister(this), t;
@@ -273,50 +287,50 @@ let __tla = Promise.all([
273
287
  a.__wbg_ifcapi_free(t, 0);
274
288
  }
275
289
  buildPrePassFast(t) {
276
- const e = It(t, a.__wbindgen_export3), n = G, s = a.ifcapi_buildPrePassFast(this.__wbg_ptr, e, n);
277
- return D(s);
290
+ const e = gt(t, a.__wbindgen_export3), n = v, s = a.ifcapi_buildPrePassFast(this.__wbg_ptr, e, n);
291
+ return P(s);
278
292
  }
279
293
  buildPrePassOnce(t) {
280
- const e = It(t, a.__wbindgen_export3), n = G, s = a.ifcapi_buildPrePassOnce(this.__wbg_ptr, e, n);
281
- return D(s);
294
+ const e = gt(t, a.__wbindgen_export3), n = v, s = a.ifcapi_buildPrePassOnce(this.__wbg_ptr, e, n);
295
+ return P(s);
282
296
  }
283
- processGeometryBatch(t, e, n, s, i, o, c, l, d, u, f, p) {
284
- const g = It(t, a.__wbindgen_export3), h = G, y = ut(e, a.__wbindgen_export3), E = G, C = ut(l, a.__wbindgen_export3), T = G, $ = ut(d, a.__wbindgen_export3), x = G, Y = ut(u, a.__wbindgen_export3), O = G, v = ut(f, a.__wbindgen_export3), b = G, S = It(p, a.__wbindgen_export3), F = G, m = a.ifcapi_processGeometryBatch(this.__wbg_ptr, g, h, y, E, n, s, i, o, c, C, T, $, x, Y, O, v, b, S, F);
285
- return Lt.__wrap(m);
297
+ processGeometryBatch(t, e, n, s, i, o, c, l, d, f, u, p) {
298
+ const I = gt(t, a.__wbindgen_export3), h = v, y = ft(e, a.__wbindgen_export3), E = v, C = ft(l, a.__wbindgen_export3), T = v, G = ft(d, a.__wbindgen_export3), x = v, k = ft(f, a.__wbindgen_export3), O = v, D = ft(u, a.__wbindgen_export3), b = v, S = gt(p, a.__wbindgen_export3), F = v, m = a.ifcapi_processGeometryBatch(this.__wbg_ptr, I, h, y, E, n, s, i, o, c, C, T, G, x, k, O, D, b, S, F);
299
+ return Pt.__wrap(m);
286
300
  }
287
301
  buildPrePassStreaming(t, e, n) {
288
302
  try {
289
- const c = a.__wbindgen_add_to_stack_pointer(-16), l = It(t, a.__wbindgen_export3), d = G;
290
- a.ifcapi_buildPrePassStreaming(c, this.__wbg_ptr, l, d, Ze(e), n);
303
+ const c = a.__wbindgen_add_to_stack_pointer(-16), l = gt(t, a.__wbindgen_export3), d = v;
304
+ a.ifcapi_buildPrePassStreaming(c, this.__wbg_ptr, l, d, sn(e), n);
291
305
  var s = A().getInt32(c + 0, !0), i = A().getInt32(c + 4, !0), o = A().getInt32(c + 8, !0);
292
- if (o) throw D(i);
293
- return D(s);
306
+ if (o) throw P(i);
307
+ return P(s);
294
308
  } finally{
295
- a.__wbindgen_add_to_stack_pointer(16), ot[kt++] = void 0;
309
+ a.__wbindgen_add_to_stack_pointer(16), ct[Yt++] = void 0;
296
310
  }
297
311
  }
298
312
  parseGridAxes(t) {
299
- const e = ct(t, a.__wbindgen_export3, a.__wbindgen_export4), n = G, s = a.ifcapi_parseGridAxes(this.__wbg_ptr, e, n);
300
- return Ot.__wrap(s);
313
+ const e = lt(t, a.__wbindgen_export3, a.__wbindgen_export4), n = v, s = a.ifcapi_parseGridAxes(this.__wbg_ptr, e, n);
314
+ return Lt.__wrap(s);
301
315
  }
302
316
  parseGridLines(t) {
303
- const e = ct(t, a.__wbindgen_export3, a.__wbindgen_export4), n = G, s = a.ifcapi_parseGridLines(this.__wbg_ptr, e, n);
304
- return D(s);
317
+ const e = lt(t, a.__wbindgen_export3, a.__wbindgen_export4), n = v, s = a.ifcapi_parseGridLines(this.__wbg_ptr, e, n);
318
+ return P(s);
305
319
  }
306
320
  parseAlignmentLines(t) {
307
- const e = ct(t, a.__wbindgen_export3, a.__wbindgen_export4), n = G, s = a.ifcapi_parseAlignmentLines(this.__wbg_ptr, e, n);
308
- return D(s);
321
+ const e = lt(t, a.__wbindgen_export3, a.__wbindgen_export4), n = v, s = a.ifcapi_parseAlignmentLines(this.__wbg_ptr, e, n);
322
+ return P(s);
309
323
  }
310
324
  extractProfiles(t, e) {
311
- const n = ct(t, a.__wbindgen_export3, a.__wbindgen_export4), s = G, i = a.ifcapi_extractProfiles(this.__wbg_ptr, n, s, e);
312
- return Pt.__wrap(i);
325
+ const n = lt(t, a.__wbindgen_export3, a.__wbindgen_export4), s = v, i = a.ifcapi_extractProfiles(this.__wbg_ptr, n, s, e);
326
+ return vt.__wrap(i);
313
327
  }
314
328
  getMemory() {
315
329
  const t = a.ifcapi_getMemory(this.__wbg_ptr);
316
- return D(t);
330
+ return P(t);
317
331
  }
318
332
  setEntityIndex(t, e, n) {
319
- const s = ut(t, a.__wbindgen_export3), i = G, o = ut(e, a.__wbindgen_export3), c = G, l = ut(n, a.__wbindgen_export3), d = G;
333
+ const s = ft(t, a.__wbindgen_export3), i = v, o = ft(e, a.__wbindgen_export3), c = v, l = ft(n, a.__wbindgen_export3), d = v;
320
334
  a.ifcapi_setEntityIndex(this.__wbg_ptr, s, i, o, c, l, d);
321
335
  }
322
336
  setMergeLayers(t) {
@@ -325,6 +339,9 @@ let __tla = Promise.all([
325
339
  clearPrePassCache() {
326
340
  a.ifcapi_clearPrePassCache(this.__wbg_ptr);
327
341
  }
342
+ setComputeGeometryHashes(t) {
343
+ a.ifcapi_setComputeGeometryHashes(this.__wbg_ptr, !bt(t), bt(t) ? 0 : t);
344
+ }
328
345
  constructor(){
329
346
  const t = a.ifcapi_new();
330
347
  return this.__wbg_ptr = t >>> 0, Ie.register(this, this.__wbg_ptr, this), this;
@@ -335,7 +352,7 @@ let __tla = Promise.all([
335
352
  const i = a.__wbindgen_add_to_stack_pointer(-16);
336
353
  a.ifcapi_version(i, this.__wbg_ptr);
337
354
  var n = A().getInt32(i + 0, !0), s = A().getInt32(i + 4, !0);
338
- return t = n, e = s, J(n, s);
355
+ return t = n, e = s, K(n, s);
339
356
  } finally{
340
357
  a.__wbindgen_add_to_stack_pointer(16), a.__wbindgen_export2(t, e, 1);
341
358
  }
@@ -344,44 +361,44 @@ let __tla = Promise.all([
344
361
  return a.ifcapi_is_ready(this.__wbg_ptr) !== 0;
345
362
  }
346
363
  parseStreaming(t, e) {
347
- const n = ct(t, a.__wbindgen_export3, a.__wbindgen_export4), s = G, i = a.ifcapi_parseStreaming(this.__wbg_ptr, n, s, U(e));
348
- return D(i);
364
+ const n = lt(t, a.__wbindgen_export3, a.__wbindgen_export4), s = v, i = a.ifcapi_parseStreaming(this.__wbg_ptr, n, s, B(e));
365
+ return P(i);
349
366
  }
350
367
  scanEntitiesFast(t) {
351
- const e = ct(t, a.__wbindgen_export3, a.__wbindgen_export4), n = G, s = a.ifcapi_scanEntitiesFast(this.__wbg_ptr, e, n);
352
- return D(s);
368
+ const e = lt(t, a.__wbindgen_export3, a.__wbindgen_export4), n = v, s = a.ifcapi_scanEntitiesFast(this.__wbg_ptr, e, n);
369
+ return P(s);
353
370
  }
354
371
  scanEntitiesFastBytes(t) {
355
- const e = It(t, a.__wbindgen_export3), n = G, s = a.ifcapi_scanEntitiesFastBytes(this.__wbg_ptr, e, n);
356
- return D(s);
372
+ const e = gt(t, a.__wbindgen_export3), n = v, s = a.ifcapi_scanEntitiesFastBytes(this.__wbg_ptr, e, n);
373
+ return P(s);
357
374
  }
358
375
  scanGeometryEntitiesFast(t) {
359
- const e = ct(t, a.__wbindgen_export3, a.__wbindgen_export4), n = G, s = a.ifcapi_scanGeometryEntitiesFast(this.__wbg_ptr, e, n);
360
- return D(s);
376
+ const e = lt(t, a.__wbindgen_export3, a.__wbindgen_export4), n = v, s = a.ifcapi_scanGeometryEntitiesFast(this.__wbg_ptr, e, n);
377
+ return P(s);
361
378
  }
362
379
  scanRelevantEntitiesFastBytes(t) {
363
- const e = It(t, a.__wbindgen_export3), n = G, s = a.ifcapi_scanRelevantEntitiesFastBytes(this.__wbg_ptr, e, n);
364
- return D(s);
380
+ const e = gt(t, a.__wbindgen_export3), n = v, s = a.ifcapi_scanRelevantEntitiesFastBytes(this.__wbg_ptr, e, n);
381
+ return P(s);
365
382
  }
366
383
  parse(t) {
367
- const e = ct(t, a.__wbindgen_export3, a.__wbindgen_export4), n = G, s = a.ifcapi_parse(this.__wbg_ptr, e, n);
368
- return D(s);
384
+ const e = lt(t, a.__wbindgen_export3, a.__wbindgen_export4), n = v, s = a.ifcapi_parse(this.__wbg_ptr, e, n);
385
+ return P(s);
369
386
  }
370
387
  parseSymbolicRepresentations(t) {
371
- const e = ct(t, a.__wbindgen_export3, a.__wbindgen_export4), n = G, s = a.ifcapi_parseSymbolicRepresentations(this.__wbg_ptr, e, n);
372
- return Gt.__wrap(s);
388
+ const e = lt(t, a.__wbindgen_export3, a.__wbindgen_export4), n = v, s = a.ifcapi_parseSymbolicRepresentations(this.__wbg_ptr, e, n);
389
+ return zt.__wrap(s);
373
390
  }
374
- };
375
- Symbol.dispose && (oe.prototype[Symbol.dispose] = oe.prototype.free);
376
- class Lt {
391
+ }
392
+ Symbol.dispose && (ce.prototype[Symbol.dispose] = ce.prototype.free);
393
+ class Pt {
377
394
  static __wrap(t) {
378
395
  t = t >>> 0;
379
- const e = Object.create(Lt.prototype);
380
- return e.__wbg_ptr = t, _e.register(e, e.__wbg_ptr, e), e;
396
+ const e = Object.create(Pt.prototype);
397
+ return e.__wbg_ptr = t, ye.register(e, e.__wbg_ptr, e), e;
381
398
  }
382
399
  __destroy_into_raw() {
383
400
  const t = this.__wbg_ptr;
384
- return this.__wbg_ptr = 0, _e.unregister(this), t;
401
+ return this.__wbg_ptr = 0, ye.unregister(this), t;
385
402
  }
386
403
  free() {
387
404
  const t = this.__destroy_into_raw();
@@ -403,7 +420,7 @@ let __tla = Promise.all([
403
420
  try {
404
421
  const c = a.__wbindgen_add_to_stack_pointer(-16);
405
422
  a.meshcollection_localToWorld(c, this.__wbg_ptr, t, e, n);
406
- var s = A().getInt32(c + 0, !0), i = A().getInt32(c + 4, !0), o = en(s, i).slice();
423
+ var s = A().getInt32(c + 0, !0), i = A().getInt32(c + 4, !0), o = on(s, i).slice();
407
424
  return a.__wbindgen_export2(s, i * 8, 8), o;
408
425
  } finally{
409
426
  a.__wbindgen_add_to_stack_pointer(16);
@@ -425,24 +442,35 @@ let __tla = Promise.all([
425
442
  a.__wbindgen_add_to_stack_pointer(16);
426
443
  }
427
444
  }
445
+ get geometryHashIds() {
446
+ const t = a.meshcollection_geometryHashIds(this.__wbg_ptr);
447
+ return P(t);
448
+ }
449
+ get geometryHashCount() {
450
+ return a.meshcollection_geometryHashCount(this.__wbg_ptr) >>> 0;
451
+ }
452
+ get geometryHashValues() {
453
+ const t = a.meshcollection_geometryHashValues(this.__wbg_ptr);
454
+ return P(t);
455
+ }
428
456
  get(t) {
429
457
  const e = a.meshcollection_get(this.__wbg_ptr, t);
430
- return e === 0 ? void 0 : Mt.__wrap(e);
458
+ return e === 0 ? void 0 : Bt.__wrap(e);
431
459
  }
432
460
  get length() {
433
461
  return a.meshcollection_length(this.__wbg_ptr) >>> 0;
434
462
  }
435
463
  }
436
- Symbol.dispose && (Lt.prototype[Symbol.dispose] = Lt.prototype.free);
437
- class Mt {
464
+ Symbol.dispose && (Pt.prototype[Symbol.dispose] = Pt.prototype.free);
465
+ class Bt {
438
466
  static __wrap(t) {
439
467
  t = t >>> 0;
440
- const e = Object.create(Mt.prototype);
441
- return e.__wbg_ptr = t, ge.register(e, e.__wbg_ptr, e), e;
468
+ const e = Object.create(Bt.prototype);
469
+ return e.__wbg_ptr = t, me.register(e, e.__wbg_ptr, e), e;
442
470
  }
443
471
  __destroy_into_raw() {
444
472
  const t = this.__wbg_ptr;
445
- return this.__wbg_ptr = 0, ge.unregister(this), t;
473
+ return this.__wbg_ptr = 0, me.unregister(this), t;
446
474
  }
447
475
  free() {
448
476
  const t = this.__destroy_into_raw();
@@ -456,7 +484,7 @@ let __tla = Promise.all([
456
484
  }
457
485
  get textureRgba() {
458
486
  const t = a.meshdatajs_textureRgba(this.__wbg_ptr);
459
- return D(t);
487
+ return P(t);
460
488
  }
461
489
  get vertexCount() {
462
490
  return a.meshdatajs_vertexCount(this.__wbg_ptr) >>> 0;
@@ -467,7 +495,7 @@ let __tla = Promise.all([
467
495
  a.meshdatajs_shadingColor(n, this.__wbg_ptr);
468
496
  var t = A().getInt32(n + 0, !0), e = A().getInt32(n + 4, !0);
469
497
  let s;
470
- return t !== 0 && (s = re(t, e).slice(), a.__wbindgen_export2(t, e * 4, 4)), s;
498
+ return t !== 0 && (s = ae(t, e).slice(), a.__wbindgen_export2(t, e * 4, 4)), s;
471
499
  } finally{
472
500
  a.__wbindgen_add_to_stack_pointer(16);
473
501
  }
@@ -475,6 +503,9 @@ let __tla = Promise.all([
475
503
  get textureWidth() {
476
504
  return a.meshdatajs_textureWidth(this.__wbg_ptr) >>> 0;
477
505
  }
506
+ get geometryClass() {
507
+ return a.meshdatajs_geometryClass(this.__wbg_ptr);
508
+ }
478
509
  get textureHeight() {
479
510
  return a.meshdatajs_textureHeight(this.__wbg_ptr) >>> 0;
480
511
  }
@@ -489,13 +520,13 @@ let __tla = Promise.all([
489
520
  }
490
521
  get uvs() {
491
522
  const t = a.meshdatajs_uvs(this.__wbg_ptr);
492
- return D(t);
523
+ return P(t);
493
524
  }
494
525
  get color() {
495
526
  try {
496
527
  const s = a.__wbindgen_add_to_stack_pointer(-16);
497
528
  a.meshdatajs_color(s, this.__wbg_ptr);
498
- var t = A().getInt32(s + 0, !0), e = A().getInt32(s + 4, !0), n = re(t, e).slice();
529
+ var t = A().getInt32(s + 0, !0), e = A().getInt32(s + 4, !0), n = ae(t, e).slice();
499
530
  return a.__wbindgen_export2(t, e * 4, 4), n;
500
531
  } finally{
501
532
  a.__wbindgen_add_to_stack_pointer(16);
@@ -503,11 +534,11 @@ let __tla = Promise.all([
503
534
  }
504
535
  get indices() {
505
536
  const t = a.meshdatajs_indices(this.__wbg_ptr);
506
- return D(t);
537
+ return P(t);
507
538
  }
508
539
  get normals() {
509
540
  const t = a.meshdatajs_normals(this.__wbg_ptr);
510
- return D(t);
541
+ return P(t);
511
542
  }
512
543
  get ifcType() {
513
544
  let t, e;
@@ -515,26 +546,55 @@ let __tla = Promise.all([
515
546
  const i = a.__wbindgen_add_to_stack_pointer(-16);
516
547
  a.meshdatajs_ifcType(i, this.__wbg_ptr);
517
548
  var n = A().getInt32(i + 0, !0), s = A().getInt32(i + 4, !0);
518
- return t = n, e = s, J(n, s);
549
+ return t = n, e = s, K(n, s);
519
550
  } finally{
520
551
  a.__wbindgen_add_to_stack_pointer(16), a.__wbindgen_export2(t, e, 1);
521
552
  }
522
553
  }
523
554
  get positions() {
524
555
  const t = a.meshdatajs_positions(this.__wbg_ptr);
525
- return D(t);
556
+ return P(t);
526
557
  }
527
558
  }
528
- Symbol.dispose && (Mt.prototype[Symbol.dispose] = Mt.prototype.free);
529
- class Pt {
559
+ Symbol.dispose && (Bt.prototype[Symbol.dispose] = Bt.prototype.free);
560
+ class Ut {
530
561
  static __wrap(t) {
531
562
  t = t >>> 0;
532
- const e = Object.create(Pt.prototype);
533
- return e.__wbg_ptr = t, ye.register(e, e.__wbg_ptr, e), e;
563
+ const e = Object.create(Ut.prototype);
564
+ return e.__wbg_ptr = t, Ee.register(e, e.__wbg_ptr, e), e;
534
565
  }
535
566
  __destroy_into_raw() {
536
567
  const t = this.__wbg_ptr;
537
- return this.__wbg_ptr = 0, ye.unregister(this), t;
568
+ return this.__wbg_ptr = 0, Ee.unregister(this), t;
569
+ }
570
+ free() {
571
+ const t = this.__destroy_into_raw();
572
+ a.__wbg_meshoutlinejs_free(t, 0);
573
+ }
574
+ get contourCount() {
575
+ return a.meshoutlinejs_contourCount(this.__wbg_ptr) >>> 0;
576
+ }
577
+ contour(t) {
578
+ const e = a.meshoutlinejs_contour(this.__wbg_ptr, t);
579
+ return P(e);
580
+ }
581
+ get axisMax() {
582
+ return a.meshoutlinejs_axisMax(this.__wbg_ptr);
583
+ }
584
+ get axisMin() {
585
+ return a.meshoutlinejs_axisMin(this.__wbg_ptr);
586
+ }
587
+ }
588
+ Symbol.dispose && (Ut.prototype[Symbol.dispose] = Ut.prototype.free);
589
+ class vt {
590
+ static __wrap(t) {
591
+ t = t >>> 0;
592
+ const e = Object.create(vt.prototype);
593
+ return e.__wbg_ptr = t, be.register(e, e.__wbg_ptr, e), e;
594
+ }
595
+ __destroy_into_raw() {
596
+ const t = this.__wbg_ptr;
597
+ return this.__wbg_ptr = 0, be.unregister(this), t;
538
598
  }
539
599
  free() {
540
600
  const t = this.__destroy_into_raw();
@@ -542,22 +602,22 @@ let __tla = Promise.all([
542
602
  }
543
603
  get(t) {
544
604
  const e = a.profilecollection_get(this.__wbg_ptr, t);
545
- return e === 0 ? void 0 : Bt.__wrap(e);
605
+ return e === 0 ? void 0 : Dt.__wrap(e);
546
606
  }
547
607
  get length() {
548
608
  return a.profilecollection_length(this.__wbg_ptr) >>> 0;
549
609
  }
550
610
  }
551
- Symbol.dispose && (Pt.prototype[Symbol.dispose] = Pt.prototype.free);
552
- class Bt {
611
+ Symbol.dispose && (vt.prototype[Symbol.dispose] = vt.prototype.free);
612
+ class Dt {
553
613
  static __wrap(t) {
554
614
  t = t >>> 0;
555
- const e = Object.create(Bt.prototype);
556
- return e.__wbg_ptr = t, me.register(e, e.__wbg_ptr, e), e;
615
+ const e = Object.create(Dt.prototype);
616
+ return e.__wbg_ptr = t, Ce.register(e, e.__wbg_ptr, e), e;
557
617
  }
558
618
  __destroy_into_raw() {
559
619
  const t = this.__wbg_ptr;
560
- return this.__wbg_ptr = 0, me.unregister(this), t;
620
+ return this.__wbg_ptr = 0, Ce.unregister(this), t;
561
621
  }
562
622
  free() {
563
623
  const t = this.__destroy_into_raw();
@@ -568,22 +628,22 @@ let __tla = Promise.all([
568
628
  }
569
629
  get holeCounts() {
570
630
  const t = a.profileentryjs_holeCounts(this.__wbg_ptr);
571
- return D(t);
631
+ return P(t);
572
632
  }
573
633
  get holePoints() {
574
634
  const t = a.profileentryjs_holePoints(this.__wbg_ptr);
575
- return D(t);
635
+ return P(t);
576
636
  }
577
637
  get modelIndex() {
578
638
  return a.profileentryjs_modelIndex(this.__wbg_ptr) >>> 0;
579
639
  }
580
640
  get outerPoints() {
581
641
  const t = a.profileentryjs_outerPoints(this.__wbg_ptr);
582
- return D(t);
642
+ return P(t);
583
643
  }
584
644
  get extrusionDir() {
585
645
  const t = a.profileentryjs_extrusionDir(this.__wbg_ptr);
586
- return D(t);
646
+ return P(t);
587
647
  }
588
648
  get extrusionDepth() {
589
649
  return a.profileentryjs_extrusionDepth(this.__wbg_ptr);
@@ -594,26 +654,26 @@ let __tla = Promise.all([
594
654
  const i = a.__wbindgen_add_to_stack_pointer(-16);
595
655
  a.profileentryjs_ifcType(i, this.__wbg_ptr);
596
656
  var n = A().getInt32(i + 0, !0), s = A().getInt32(i + 4, !0);
597
- return t = n, e = s, J(n, s);
657
+ return t = n, e = s, K(n, s);
598
658
  } finally{
599
659
  a.__wbindgen_add_to_stack_pointer(16), a.__wbindgen_export2(t, e, 1);
600
660
  }
601
661
  }
602
662
  get transform() {
603
663
  const t = a.profileentryjs_transform(this.__wbg_ptr);
604
- return D(t);
664
+ return P(t);
605
665
  }
606
666
  }
607
- Symbol.dispose && (Bt.prototype[Symbol.dispose] = Bt.prototype.free);
608
- class Ut {
667
+ Symbol.dispose && (Dt.prototype[Symbol.dispose] = Dt.prototype.free);
668
+ class Gt {
609
669
  static __wrap(t) {
610
670
  t = t >>> 0;
611
- const e = Object.create(Ut.prototype);
612
- return e.__wbg_ptr = t, Ee.register(e, e.__wbg_ptr, e), e;
671
+ const e = Object.create(Gt.prototype);
672
+ return e.__wbg_ptr = t, we.register(e, e.__wbg_ptr, e), e;
613
673
  }
614
674
  __destroy_into_raw() {
615
675
  const t = this.__wbg_ptr;
616
- return this.__wbg_ptr = 0, Ee.unregister(this), t;
676
+ return this.__wbg_ptr = 0, we.unregister(this), t;
617
677
  }
618
678
  free() {
619
679
  const t = this.__destroy_into_raw();
@@ -634,7 +694,7 @@ let __tla = Promise.all([
634
694
  const i = a.__wbindgen_add_to_stack_pointer(-16);
635
695
  a.symboliccircle_repIdentifier(i, this.__wbg_ptr);
636
696
  var n = A().getInt32(i + 0, !0), s = A().getInt32(i + 4, !0);
637
- return t = n, e = s, J(n, s);
697
+ return t = n, e = s, K(n, s);
638
698
  } finally{
639
699
  a.__wbindgen_add_to_stack_pointer(16), a.__wbindgen_export2(t, e, 1);
640
700
  }
@@ -657,7 +717,7 @@ let __tla = Promise.all([
657
717
  const i = a.__wbindgen_add_to_stack_pointer(-16);
658
718
  a.symboliccircle_ifcType(i, this.__wbg_ptr);
659
719
  var n = A().getInt32(i + 0, !0), s = A().getInt32(i + 4, !0);
660
- return t = n, e = s, J(n, s);
720
+ return t = n, e = s, K(n, s);
661
721
  } finally{
662
722
  a.__wbindgen_add_to_stack_pointer(16), a.__wbindgen_export2(t, e, 1);
663
723
  }
@@ -666,16 +726,16 @@ let __tla = Promise.all([
666
726
  return a.symboliccircle_endAngle(this.__wbg_ptr);
667
727
  }
668
728
  }
669
- Symbol.dispose && (Ut.prototype[Symbol.dispose] = Ut.prototype.free);
670
- class Dt {
729
+ Symbol.dispose && (Gt.prototype[Symbol.dispose] = Gt.prototype.free);
730
+ class $t {
671
731
  static __wrap(t) {
672
732
  t = t >>> 0;
673
- const e = Object.create(Dt.prototype);
674
- return e.__wbg_ptr = t, be.register(e, e.__wbg_ptr, e), e;
733
+ const e = Object.create($t.prototype);
734
+ return e.__wbg_ptr = t, Te.register(e, e.__wbg_ptr, e), e;
675
735
  }
676
736
  __destroy_into_raw() {
677
737
  const t = this.__wbg_ptr;
678
- return this.__wbg_ptr = 0, be.unregister(this), t;
738
+ return this.__wbg_ptr = 0, Te.unregister(this), t;
679
739
  }
680
740
  free() {
681
741
  const t = this.__destroy_into_raw();
@@ -701,7 +761,7 @@ let __tla = Promise.all([
701
761
  }
702
762
  get holesOffsets() {
703
763
  const t = a.symbolicfillarea_holesOffsets(this.__wbg_ptr);
704
- return D(t);
764
+ return P(t);
705
765
  }
706
766
  get repIdentifier() {
707
767
  let t, e;
@@ -709,7 +769,7 @@ let __tla = Promise.all([
709
769
  const i = a.__wbindgen_add_to_stack_pointer(-16);
710
770
  a.symbolicfillarea_repIdentifier(i, this.__wbg_ptr);
711
771
  var n = A().getInt32(i + 0, !0), s = A().getInt32(i + 4, !0);
712
- return t = n, e = s, J(n, s);
772
+ return t = n, e = s, K(n, s);
713
773
  } finally{
714
774
  a.__wbindgen_add_to_stack_pointer(16), a.__wbindgen_export2(t, e, 1);
715
775
  }
@@ -734,7 +794,7 @@ let __tla = Promise.all([
734
794
  }
735
795
  get points() {
736
796
  const t = a.symbolicfillarea_points(this.__wbg_ptr);
737
- return D(t);
797
+ return P(t);
738
798
  }
739
799
  get worldY() {
740
800
  return a.symbolicfillarea_worldY(this.__wbg_ptr);
@@ -745,22 +805,22 @@ let __tla = Promise.all([
745
805
  const i = a.__wbindgen_add_to_stack_pointer(-16);
746
806
  a.symbolicfillarea_ifcType(i, this.__wbg_ptr);
747
807
  var n = A().getInt32(i + 0, !0), s = A().getInt32(i + 4, !0);
748
- return t = n, e = s, J(n, s);
808
+ return t = n, e = s, K(n, s);
749
809
  } finally{
750
810
  a.__wbindgen_add_to_stack_pointer(16), a.__wbindgen_export2(t, e, 1);
751
811
  }
752
812
  }
753
813
  }
754
- Symbol.dispose && (Dt.prototype[Symbol.dispose] = Dt.prototype.free);
755
- class vt {
814
+ Symbol.dispose && ($t.prototype[Symbol.dispose] = $t.prototype.free);
815
+ class Vt {
756
816
  static __wrap(t) {
757
817
  t = t >>> 0;
758
- const e = Object.create(vt.prototype);
759
- return e.__wbg_ptr = t, Ce.register(e, e.__wbg_ptr, e), e;
818
+ const e = Object.create(Vt.prototype);
819
+ return e.__wbg_ptr = t, Fe.register(e, e.__wbg_ptr, e), e;
760
820
  }
761
821
  __destroy_into_raw() {
762
822
  const t = this.__wbg_ptr;
763
- return this.__wbg_ptr = 0, Ce.unregister(this), t;
823
+ return this.__wbg_ptr = 0, Fe.unregister(this), t;
764
824
  }
765
825
  free() {
766
826
  const t = this.__destroy_into_raw();
@@ -778,14 +838,14 @@ let __tla = Promise.all([
778
838
  const i = a.__wbindgen_add_to_stack_pointer(-16);
779
839
  a.symbolicpolyline_repIdentifier(i, this.__wbg_ptr);
780
840
  var n = A().getInt32(i + 0, !0), s = A().getInt32(i + 4, !0);
781
- return t = n, e = s, J(n, s);
841
+ return t = n, e = s, K(n, s);
782
842
  } finally{
783
843
  a.__wbindgen_add_to_stack_pointer(16), a.__wbindgen_export2(t, e, 1);
784
844
  }
785
845
  }
786
846
  get points() {
787
847
  const t = a.symbolicpolyline_points(this.__wbg_ptr);
788
- return D(t);
848
+ return P(t);
789
849
  }
790
850
  get worldY() {
791
851
  return a.symboliccircle_worldY(this.__wbg_ptr);
@@ -796,7 +856,7 @@ let __tla = Promise.all([
796
856
  const i = a.__wbindgen_add_to_stack_pointer(-16);
797
857
  a.symbolicpolyline_ifcType(i, this.__wbg_ptr);
798
858
  var n = A().getInt32(i + 0, !0), s = A().getInt32(i + 4, !0);
799
- return t = n, e = s, J(n, s);
859
+ return t = n, e = s, K(n, s);
800
860
  } finally{
801
861
  a.__wbindgen_add_to_stack_pointer(16), a.__wbindgen_export2(t, e, 1);
802
862
  }
@@ -805,16 +865,16 @@ let __tla = Promise.all([
805
865
  return a.symbolicpolyline_isClosed(this.__wbg_ptr) !== 0;
806
866
  }
807
867
  }
808
- Symbol.dispose && (vt.prototype[Symbol.dispose] = vt.prototype.free);
809
- class Gt {
868
+ Symbol.dispose && (Vt.prototype[Symbol.dispose] = Vt.prototype.free);
869
+ class zt {
810
870
  static __wrap(t) {
811
871
  t = t >>> 0;
812
- const e = Object.create(Gt.prototype);
813
- return e.__wbg_ptr = t, we.register(e, e.__wbg_ptr, e), e;
872
+ const e = Object.create(zt.prototype);
873
+ return e.__wbg_ptr = t, Re.register(e, e.__wbg_ptr, e), e;
814
874
  }
815
875
  __destroy_into_raw() {
816
876
  const t = this.__wbg_ptr;
817
- return this.__wbg_ptr = 0, we.unregister(this), t;
877
+ return this.__wbg_ptr = 0, Re.unregister(this), t;
818
878
  }
819
879
  free() {
820
880
  const t = this.__destroy_into_raw();
@@ -825,7 +885,7 @@ let __tla = Promise.all([
825
885
  }
826
886
  getCircle(t) {
827
887
  const e = a.symbolicrepresentationcollection_getCircle(this.__wbg_ptr, t);
828
- return e === 0 ? void 0 : Ut.__wrap(e);
888
+ return e === 0 ? void 0 : Gt.__wrap(e);
829
889
  }
830
890
  get textCount() {
831
891
  return a.symbolicrepresentationcollection_textCount(this.__wbg_ptr) >>> 0;
@@ -838,7 +898,7 @@ let __tla = Promise.all([
838
898
  }
839
899
  getPolyline(t) {
840
900
  const e = a.symbolicrepresentationcollection_getPolyline(this.__wbg_ptr, t);
841
- return e === 0 ? void 0 : vt.__wrap(e);
901
+ return e === 0 ? void 0 : Vt.__wrap(e);
842
902
  }
843
903
  get polylineCount() {
844
904
  return a.symbolicrepresentationcollection_polylineCount(this.__wbg_ptr) >>> 0;
@@ -847,7 +907,7 @@ let __tla = Promise.all([
847
907
  try {
848
908
  const s = a.__wbindgen_add_to_stack_pointer(-16);
849
909
  a.symbolicrepresentationcollection_getExpressIds(s, this.__wbg_ptr);
850
- var t = A().getInt32(s + 0, !0), e = A().getInt32(s + 4, !0), n = De(t, e).slice();
910
+ var t = A().getInt32(s + 0, !0), e = A().getInt32(s + 4, !0), n = $e(t, e).slice();
851
911
  return a.__wbindgen_export2(t, e * 4, 4), n;
852
912
  } finally{
853
913
  a.__wbindgen_add_to_stack_pointer(16);
@@ -855,26 +915,26 @@ let __tla = Promise.all([
855
915
  }
856
916
  getFill(t) {
857
917
  const e = a.symbolicrepresentationcollection_getFill(this.__wbg_ptr, t);
858
- return e === 0 ? void 0 : Dt.__wrap(e);
918
+ return e === 0 ? void 0 : $t.__wrap(e);
859
919
  }
860
920
  getText(t) {
861
921
  const e = a.symbolicrepresentationcollection_getText(this.__wbg_ptr, t);
862
- return e === 0 ? void 0 : $t.__wrap(e);
922
+ return e === 0 ? void 0 : Ht.__wrap(e);
863
923
  }
864
924
  get isEmpty() {
865
925
  return a.symbolicrepresentationcollection_isEmpty(this.__wbg_ptr) !== 0;
866
926
  }
867
927
  }
868
- Symbol.dispose && (Gt.prototype[Symbol.dispose] = Gt.prototype.free);
869
- class $t {
928
+ Symbol.dispose && (zt.prototype[Symbol.dispose] = zt.prototype.free);
929
+ class Ht {
870
930
  static __wrap(t) {
871
931
  t = t >>> 0;
872
- const e = Object.create($t.prototype);
873
- return e.__wbg_ptr = t, Te.register(e, e.__wbg_ptr, e), e;
932
+ const e = Object.create(Ht.prototype);
933
+ return e.__wbg_ptr = t, Se.register(e, e.__wbg_ptr, e), e;
874
934
  }
875
935
  __destroy_into_raw() {
876
936
  const t = this.__wbg_ptr;
877
- return this.__wbg_ptr = 0, Te.unregister(this), t;
937
+ return this.__wbg_ptr = 0, Se.unregister(this), t;
878
938
  }
879
939
  free() {
880
940
  const t = this.__destroy_into_raw();
@@ -889,7 +949,7 @@ let __tla = Promise.all([
889
949
  const i = a.__wbindgen_add_to_stack_pointer(-16);
890
950
  a.symbolictext_repIdentifier(i, this.__wbg_ptr);
891
951
  var n = A().getInt32(i + 0, !0), s = A().getInt32(i + 4, !0);
892
- return t = n, e = s, J(n, s);
952
+ return t = n, e = s, K(n, s);
893
953
  } finally{
894
954
  a.__wbindgen_add_to_stack_pointer(16), a.__wbindgen_export2(t, e, 1);
895
955
  }
@@ -927,7 +987,7 @@ let __tla = Promise.all([
927
987
  const i = a.__wbindgen_add_to_stack_pointer(-16);
928
988
  a.symbolictext_content(i, this.__wbg_ptr);
929
989
  var n = A().getInt32(i + 0, !0), s = A().getInt32(i + 4, !0);
930
- return t = n, e = s, J(n, s);
990
+ return t = n, e = s, K(n, s);
931
991
  } finally{
932
992
  a.__wbindgen_add_to_stack_pointer(16), a.__wbindgen_export2(t, e, 1);
933
993
  }
@@ -941,7 +1001,7 @@ let __tla = Promise.all([
941
1001
  const i = a.__wbindgen_add_to_stack_pointer(-16);
942
1002
  a.symbolictext_ifcType(i, this.__wbg_ptr);
943
1003
  var n = A().getInt32(i + 0, !0), s = A().getInt32(i + 4, !0);
944
- return t = n, e = s, J(n, s);
1004
+ return t = n, e = s, K(n, s);
945
1005
  } finally{
946
1006
  a.__wbindgen_add_to_stack_pointer(16), a.__wbindgen_export2(t, e, 1);
947
1007
  }
@@ -952,7 +1012,7 @@ let __tla = Promise.all([
952
1012
  const i = a.__wbindgen_add_to_stack_pointer(-16);
953
1013
  a.symbolictext_alignment(i, this.__wbg_ptr);
954
1014
  var n = A().getInt32(i + 0, !0), s = A().getInt32(i + 4, !0);
955
- return t = n, e = s, J(n, s);
1015
+ return t = n, e = s, K(n, s);
956
1016
  } finally{
957
1017
  a.__wbindgen_add_to_stack_pointer(16), a.__wbindgen_export2(t, e, 1);
958
1018
  }
@@ -961,18 +1021,22 @@ let __tla = Promise.all([
961
1021
  return a.symbolictext_targetPx(this.__wbg_ptr);
962
1022
  }
963
1023
  }
964
- Symbol.dispose && ($t.prototype[Symbol.dispose] = $t.prototype.free);
965
- const fn = new Set([
1024
+ Symbol.dispose && (Ht.prototype[Symbol.dispose] = Ht.prototype.free);
1025
+ ds = function(r, t, e, n) {
1026
+ const s = un(r, a.__wbindgen_export3), i = v, o = ft(t, a.__wbindgen_export3), c = v, l = a.meshOutline2d(s, i, o, c, e, n);
1027
+ return l === 0 ? void 0 : Ut.__wrap(l);
1028
+ };
1029
+ const In = new Set([
966
1030
  "basic",
967
1031
  "cors",
968
1032
  "default"
969
1033
  ]);
970
- async function un(r, t) {
1034
+ async function yn(r, t) {
971
1035
  if (typeof Response == "function" && r instanceof Response) {
972
1036
  if (typeof WebAssembly.instantiateStreaming == "function") try {
973
1037
  return await WebAssembly.instantiateStreaming(r, t);
974
1038
  } catch (n) {
975
- if (r.ok && fn.has(r.type) && r.headers.get("Content-Type") !== "application/wasm") console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", n);
1039
+ if (r.ok && In.has(r.type) && r.headers.get("Content-Type") !== "application/wasm") console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", n);
976
1040
  else throw n;
977
1041
  }
978
1042
  const e = await r.arrayBuffer();
@@ -985,50 +1049,50 @@ let __tla = Promise.all([
985
1049
  } : e;
986
1050
  }
987
1051
  }
988
- function hn() {
1052
+ function mn() {
989
1053
  const r = {};
990
1054
  return r.wbg = {}, r.wbg.__wbg_Error_52673b7de5a0ca89 = function(t, e) {
991
- const n = Error(J(t, e));
992
- return U(n);
1055
+ const n = Error(K(t, e));
1056
+ return B(n);
993
1057
  }, r.wbg.__wbg___wbindgen_is_function_8d400b8b1af978cd = function(t) {
994
- return typeof k(t) == "function";
1058
+ return typeof W(t) == "function";
995
1059
  }, r.wbg.__wbg___wbindgen_is_undefined_f6b95eab589e0269 = function(t) {
996
- return k(t) === void 0;
1060
+ return W(t) === void 0;
997
1061
  }, r.wbg.__wbg___wbindgen_memory_a342e963fbcabd68 = function() {
998
1062
  const t = a.memory;
999
- return U(t);
1063
+ return B(t);
1000
1064
  }, r.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e = function(t, e) {
1001
- throw new Error(J(t, e));
1065
+ throw new Error(K(t, e));
1002
1066
  }, r.wbg.__wbg__wbg_cb_unref_87dfb5aaa0cbcea7 = function(t) {
1003
- k(t)._wbg_cb_unref();
1067
+ W(t)._wbg_cb_unref();
1004
1068
  }, r.wbg.__wbg_call_3020136f7a2d6e44 = function() {
1005
- return Qt(function(t, e, n) {
1006
- const s = k(t).call(k(e), k(n));
1007
- return U(s);
1069
+ return Kt(function(t, e, n) {
1070
+ const s = W(t).call(W(e), W(n));
1071
+ return B(s);
1008
1072
  }, arguments);
1009
1073
  }, r.wbg.__wbg_call_abb4ff46ce38be40 = function() {
1010
- return Qt(function(t, e) {
1011
- const n = k(t).call(k(e));
1012
- return U(n);
1074
+ return Kt(function(t, e) {
1075
+ const n = W(t).call(W(e));
1076
+ return B(n);
1013
1077
  }, arguments);
1014
1078
  }, r.wbg.__wbg_error_7534b8e9a36f1ab4 = function(t, e) {
1015
1079
  let n, s;
1016
1080
  try {
1017
- n = t, s = e, console.error(J(t, e));
1081
+ n = t, s = e, console.error(K(t, e));
1018
1082
  } finally{
1019
1083
  a.__wbindgen_export2(n, s, 1);
1020
1084
  }
1021
1085
  }, r.wbg.__wbg_info_ce6bcc489c22f6f0 = function(t) {
1022
- console.info(k(t));
1086
+ console.info(W(t));
1023
1087
  }, r.wbg.__wbg_new_1ba21ce319a06297 = function() {
1024
1088
  const t = new Object;
1025
- return U(t);
1089
+ return B(t);
1026
1090
  }, r.wbg.__wbg_new_25f239778d6112b9 = function() {
1027
1091
  const t = new Array;
1028
- return U(t);
1092
+ return B(t);
1029
1093
  }, r.wbg.__wbg_new_8a6f238a6ece86ea = function() {
1030
1094
  const t = new Error;
1031
- return U(t);
1095
+ return B(t);
1032
1096
  }, r.wbg.__wbg_new_ff12d2b041fb48f1 = function(t, e) {
1033
1097
  try {
1034
1098
  var n = {
@@ -1038,125 +1102,129 @@ let __tla = Promise.all([
1038
1102
  const l = n.a;
1039
1103
  n.a = 0;
1040
1104
  try {
1041
- return dn(l, n.b, o, c);
1105
+ return _n(l, n.b, o, c);
1042
1106
  } finally{
1043
1107
  n.a = l;
1044
1108
  }
1045
1109
  };
1046
1110
  const i = new Promise(s);
1047
- return U(i);
1111
+ return B(i);
1048
1112
  } finally{
1049
1113
  n.a = n.b = 0;
1050
1114
  }
1051
1115
  }, r.wbg.__wbg_new_from_slice_41e2764a343e3cb1 = function(t, e) {
1052
- const n = new Float32Array(re(t, e));
1053
- return U(n);
1116
+ const n = new Float32Array(ae(t, e));
1117
+ return B(n);
1118
+ }, r.wbg.__wbg_new_from_slice_883d10a76ca46292 = function(t, e) {
1119
+ const n = new BigUint64Array(an(t, e));
1120
+ return B(n);
1054
1121
  }, r.wbg.__wbg_new_from_slice_db0691b69e9d3891 = function(t, e) {
1055
- const n = new Uint32Array(De(t, e));
1056
- return U(n);
1122
+ const n = new Uint32Array($e(t, e));
1123
+ return B(n);
1057
1124
  }, r.wbg.__wbg_new_from_slice_f9c22b9153b26992 = function(t, e) {
1058
- const n = new Uint8Array(nn(t, e));
1059
- return U(n);
1125
+ const n = new Uint8Array(cn(t, e));
1126
+ return B(n);
1060
1127
  }, r.wbg.__wbg_new_no_args_cb138f77cf6151ee = function(t, e) {
1061
- const n = new Function(J(t, e));
1062
- return U(n);
1128
+ const n = new Function(K(t, e));
1129
+ return B(n);
1063
1130
  }, r.wbg.__wbg_new_with_length_202b3db94ba5fc86 = function(t) {
1064
1131
  const e = new Uint32Array(t >>> 0);
1065
- return U(e);
1132
+ return B(e);
1066
1133
  }, r.wbg.__wbg_new_with_length_806b9e5b8290af7c = function(t) {
1067
1134
  const e = new Float64Array(t >>> 0);
1068
- return U(e);
1135
+ return B(e);
1069
1136
  }, r.wbg.__wbg_new_with_length_aa5eaf41d35235e5 = function(t) {
1070
1137
  const e = new Uint8Array(t >>> 0);
1071
- return U(e);
1138
+ return B(e);
1072
1139
  }, r.wbg.__wbg_queueMicrotask_9b549dfce8865860 = function(t) {
1073
- const e = k(t).queueMicrotask;
1074
- return U(e);
1140
+ const e = W(t).queueMicrotask;
1141
+ return B(e);
1075
1142
  }, r.wbg.__wbg_queueMicrotask_fca69f5bfad613a5 = function(t) {
1076
- queueMicrotask(k(t));
1143
+ queueMicrotask(W(t));
1077
1144
  }, r.wbg.__wbg_resolve_fd5bfbaa4ce36e1e = function(t) {
1078
- const e = Promise.resolve(k(t));
1079
- return U(e);
1145
+ const e = Promise.resolve(W(t));
1146
+ return B(e);
1080
1147
  }, r.wbg.__wbg_set_3f1d0b984ed272ed = function(t, e, n) {
1081
- k(t)[D(e)] = D(n);
1148
+ W(t)[P(e)] = P(n);
1082
1149
  }, r.wbg.__wbg_set_781438a03c0c3c81 = function() {
1083
- return Qt(function(t, e, n) {
1084
- return Reflect.set(k(t), k(e), k(n));
1150
+ return Kt(function(t, e, n) {
1151
+ return Reflect.set(W(t), W(e), W(n));
1085
1152
  }, arguments);
1086
1153
  }, r.wbg.__wbg_set_7df433eea03a5c14 = function(t, e, n) {
1087
- k(t)[e >>> 0] = D(n);
1154
+ W(t)[e >>> 0] = P(n);
1088
1155
  }, r.wbg.__wbg_set_index_021489b2916af13e = function(t, e, n) {
1089
- k(t)[e >>> 0] = n;
1156
+ W(t)[e >>> 0] = n;
1090
1157
  }, r.wbg.__wbg_set_index_04c4b93e64d08a52 = function(t, e, n) {
1091
- k(t)[e >>> 0] = n;
1158
+ W(t)[e >>> 0] = n;
1092
1159
  }, r.wbg.__wbg_set_index_42abe35f117e614e = function(t, e, n) {
1093
- k(t)[e >>> 0] = n >>> 0;
1160
+ W(t)[e >>> 0] = n >>> 0;
1094
1161
  }, r.wbg.__wbg_stack_0ed75d68575b0f3c = function(t, e) {
1095
- const n = k(e).stack, s = ct(n, a.__wbindgen_export3, a.__wbindgen_export4), i = G;
1162
+ const n = W(e).stack, s = lt(n, a.__wbindgen_export3, a.__wbindgen_export4), i = v;
1096
1163
  A().setInt32(t + 4, i, !0), A().setInt32(t + 0, s, !0);
1097
1164
  }, r.wbg.__wbg_static_accessor_GLOBAL_769e6b65d6557335 = function() {
1098
1165
  const t = typeof global > "u" ? null : global;
1099
- return zt(t) ? 0 : U(t);
1166
+ return bt(t) ? 0 : B(t);
1100
1167
  }, r.wbg.__wbg_static_accessor_GLOBAL_THIS_60cf02db4de8e1c1 = function() {
1101
1168
  const t = typeof globalThis > "u" ? null : globalThis;
1102
- return zt(t) ? 0 : U(t);
1169
+ return bt(t) ? 0 : B(t);
1103
1170
  }, r.wbg.__wbg_static_accessor_SELF_08f5a74c69739274 = function() {
1104
1171
  const t = typeof self > "u" ? null : self;
1105
- return zt(t) ? 0 : U(t);
1172
+ return bt(t) ? 0 : B(t);
1106
1173
  }, r.wbg.__wbg_static_accessor_WINDOW_a8924b26aa92d024 = function() {
1107
1174
  const t = typeof window > "u" ? null : window;
1108
- return zt(t) ? 0 : U(t);
1175
+ return bt(t) ? 0 : B(t);
1109
1176
  }, r.wbg.__wbg_then_4f95312d68691235 = function(t, e) {
1110
- const n = k(t).then(k(e));
1111
- return U(n);
1177
+ const n = W(t).then(W(e));
1178
+ return B(n);
1112
1179
  }, r.wbg.__wbg_warn_6e567d0d926ff881 = function(t) {
1113
- console.warn(k(t));
1180
+ console.warn(W(t));
1181
+ }, r.wbg.__wbindgen_cast_0093e2d96a856a3b = function(t, e) {
1182
+ const n = fn(t, e, a.__wasm_bindgen_func_elem_674, gn);
1183
+ return B(n);
1114
1184
  }, r.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(t, e) {
1115
- const n = J(t, e);
1116
- return U(n);
1117
- }, r.wbg.__wbindgen_cast_257c51b8abf9285e = function(t, e) {
1118
- const n = on(t, e, a.__wasm_bindgen_func_elem_653, ln);
1119
- return U(n);
1185
+ const n = K(t, e);
1186
+ return B(n);
1120
1187
  }, r.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(t) {
1121
1188
  const e = BigInt.asUintN(64, t);
1122
- return U(e);
1189
+ return B(e);
1123
1190
  }, r.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(t) {
1124
- return U(t);
1191
+ return B(t);
1125
1192
  }, r.wbg.__wbindgen_object_clone_ref = function(t) {
1126
- const e = k(t);
1127
- return U(e);
1193
+ const e = W(t);
1194
+ return B(e);
1128
1195
  }, r.wbg.__wbindgen_object_drop_ref = function(t) {
1129
- D(t);
1196
+ P(t);
1130
1197
  }, r;
1131
1198
  }
1132
- function pn(r, t) {
1133
- return a = r.exports, Ge.__wbindgen_wasm_module = t, _t = null, Tt = null, Ft = null, Rt = null, St = null, a.__wbindgen_start(), a;
1199
+ function En(r, t) {
1200
+ return a = r.exports, He.__wbindgen_wasm_module = t, Ft = null, _t = null, Rt = null, St = null, Nt = null, At = null, a.__wbindgen_start(), a;
1134
1201
  }
1135
- Ge = async function(r) {
1202
+ async function He(r) {
1136
1203
  if (a !== void 0) return a;
1137
- typeof r < "u" && (Object.getPrototypeOf(r) === Object.prototype ? { module_or_path: r } = r : console.warn("using deprecated parameters for the initialization function; pass a single object instead")), typeof r > "u" && (r = new URL("/assets/ifc-lite_bg-DsYUIHm3.wasm", import.meta.url));
1138
- const t = hn();
1204
+ typeof r < "u" && (Object.getPrototypeOf(r) === Object.prototype ? { module_or_path: r } = r : console.warn("using deprecated parameters for the initialization function; pass a single object instead")), typeof r > "u" && (r = new URL("/assets/ifc-lite_bg-BEA5DLmg.wasm", import.meta.url));
1205
+ const t = mn();
1139
1206
  (typeof r == "string" || typeof Request == "function" && r instanceof Request || typeof URL == "function" && r instanceof URL) && (r = fetch(r));
1140
- const { instance: e, module: n } = await un(await r, t);
1141
- return pn(e, n);
1142
- };
1143
- const tt = We("Geometry"), In = "IFC-Lite WASM cannot recover from a fatal runtime error within the same document lifetime. Reload the page or recreate the worker process before calling init() again.";
1144
- let Kt = null;
1145
- class _n {
1207
+ const { instance: e, module: n } = await yn(await r, t);
1208
+ return En(e, n);
1209
+ }
1210
+ const tt = Ye("Geometry"), bn = "IFC-Lite WASM cannot recover from a fatal runtime error within the same document lifetime. Reload the page or recreate the worker process before calling init() again.";
1211
+ let te = null;
1212
+ class Cn {
1146
1213
  ifcApi = null;
1147
1214
  initialized = !1;
1148
1215
  mergeLayers = !1;
1216
+ geometryHashTolerance = null;
1149
1217
  isWasmRuntimeError(t) {
1150
1218
  return t instanceof WebAssembly.RuntimeError;
1151
1219
  }
1152
1220
  markFatalWasmRuntimeError() {
1153
- Kt = new Error(In), this.reset();
1221
+ te = new Error(bn), this.reset();
1154
1222
  }
1155
1223
  async init() {
1156
1224
  if (!this.initialized) {
1157
- if (Kt) throw Kt;
1225
+ if (te) throw te;
1158
1226
  try {
1159
- await Ge(), tt.debug("Geometry processing: single-threaded WASM (N-worker pool handles parallelism)"), this.ifcApi = new oe, this.applyMergeLayers(), this.initialized = !0, tt.info("WASM geometry engine initialized");
1227
+ await He(), tt.debug("Geometry processing: single-threaded WASM (N-worker pool handles parallelism)"), this.ifcApi = new ce, this.applyMergeLayers(), this.applyComputeGeometryHashes(), this.initialized = !0, tt.info("WASM geometry engine initialized");
1160
1228
  } catch (t) {
1161
1229
  throw tt.error("Failed to initialize WASM geometry engine", t, {
1162
1230
  operation: "init"
@@ -1279,14 +1347,36 @@ let __tla = Promise.all([
1279
1347
  operation: "setMergeLayers"
1280
1348
  });
1281
1349
  }
1350
+ setComputeGeometryHashes(t) {
1351
+ this.geometryHashTolerance = t != null && t > 0 ? t : null, this.ifcApi && this.applyComputeGeometryHashes();
1352
+ }
1353
+ getComputeGeometryHashes() {
1354
+ return this.geometryHashTolerance;
1355
+ }
1356
+ applyComputeGeometryHashes() {
1357
+ if (!this.ifcApi) return;
1358
+ const t = this.ifcApi;
1359
+ if (typeof t.setComputeGeometryHashes != "function") {
1360
+ this.geometryHashTolerance != null && tt.warn("setComputeGeometryHashes not present on WASM API — geometry diff hashes unavailable until WASM is rebuilt", {
1361
+ operation: "setComputeGeometryHashes",
1362
+ data: {
1363
+ requested: this.geometryHashTolerance
1364
+ }
1365
+ });
1366
+ return;
1367
+ }
1368
+ t.setComputeGeometryHashes(this.geometryHashTolerance), tt.debug(`computeGeometryHashes=${this.geometryHashTolerance ?? "off"}`, {
1369
+ operation: "setComputeGeometryHashes"
1370
+ });
1371
+ }
1282
1372
  }
1283
- function $e() {
1373
+ function je() {
1284
1374
  return typeof window < "u" && "__TAURI_INTERNALS__" in window;
1285
1375
  }
1286
- async function gn() {
1287
- if ($e()) {
1288
- const { NativeBridge: r } = await je(async ()=>{
1289
- const { NativeBridge: t } = await import("./native-bridge-BX8_tHXE.js").then(async (m)=>{
1376
+ async function wn() {
1377
+ if (je()) {
1378
+ const { NativeBridge: r } = await Xe(async ()=>{
1379
+ const { NativeBridge: t } = await import("./native-bridge-DpB-dtEn.js").then(async (m)=>{
1290
1380
  await m.__tla;
1291
1381
  return m;
1292
1382
  });
@@ -1298,7 +1388,7 @@ let __tla = Promise.all([
1298
1388
  }
1299
1389
  throw new Error("createPlatformBridge() is native-only; the browser uses the WASM GeometryProcessor path directly.");
1300
1390
  }
1301
- class yn {
1391
+ class Tn {
1302
1392
  buildInterleavedBuffer(t) {
1303
1393
  const e = t.positions.length / 3, n = new Float32Array(e * 6);
1304
1394
  for(let s = 0; s < e; s++){
@@ -1317,7 +1407,7 @@ let __tla = Promise.all([
1317
1407
  };
1318
1408
  }
1319
1409
  }
1320
- class mn {
1410
+ class Fn {
1321
1411
  originShift = {
1322
1412
  x: 0,
1323
1413
  y: 0,
@@ -1352,8 +1442,8 @@ let __tla = Promise.all([
1352
1442
  for (const i of t){
1353
1443
  const o = i.positions;
1354
1444
  for(let c = 0; c < o.length; c += 3){
1355
- const l = o[c], d = o[c + 1], u = o[c + 2];
1356
- Number.isFinite(l) && Number.isFinite(d) && Number.isFinite(u) && Math.abs(l) < s && Math.abs(d) < s && Math.abs(u) < s && (n.min.x = Math.min(n.min.x, l), n.min.y = Math.min(n.min.y, d), n.min.z = Math.min(n.min.z, u), n.max.x = Math.max(n.max.x, l), n.max.y = Math.max(n.max.y, d), n.max.z = Math.max(n.max.z, u));
1445
+ const l = o[c], d = o[c + 1], f = o[c + 2];
1446
+ Number.isFinite(l) && Number.isFinite(d) && Number.isFinite(f) && Math.abs(l) < s && Math.abs(d) < s && Math.abs(f) < s && (n.min.x = Math.min(n.min.x, l), n.min.y = Math.min(n.min.y, d), n.min.z = Math.min(n.min.z, f), n.max.x = Math.max(n.max.x, l), n.max.y = Math.max(n.max.y, d), n.max.z = Math.max(n.max.z, f));
1357
1447
  }
1358
1448
  }
1359
1449
  return n;
@@ -1361,11 +1451,11 @@ let __tla = Promise.all([
1361
1451
  calculateBoundsFast(t) {
1362
1452
  let e = 1 / 0, n = 1 / 0, s = 1 / 0, i = -1 / 0, o = -1 / 0, c = -1 / 0;
1363
1453
  for (const l of t){
1364
- const d = l.positions, u = d.length;
1365
- if (u < 3) continue;
1366
- const f = d[0], p = d[1], g = d[2];
1367
- if (f < e && (e = f), p < n && (n = p), g < s && (s = g), f > i && (i = f), p > o && (o = p), g > c && (c = g), u >= 6) {
1368
- const h = d[u - 3], y = d[u - 2], E = d[u - 1];
1454
+ const d = l.positions, f = d.length;
1455
+ if (f < 3) continue;
1456
+ const u = d[0], p = d[1], I = d[2];
1457
+ if (u < e && (e = u), p < n && (n = p), I < s && (s = I), u > i && (i = u), p > o && (o = p), I > c && (c = I), f >= 6) {
1458
+ const h = d[f - 3], y = d[f - 2], E = d[f - 1];
1369
1459
  h < e && (e = h), y < n && (n = y), E < s && (s = E), h > i && (i = h), y > o && (o = y), E > c && (c = E);
1370
1460
  }
1371
1461
  }
@@ -1504,15 +1594,15 @@ let __tla = Promise.all([
1504
1594
  z: this.accumulatedBounds.max.z - this.accumulatedBounds.min.z
1505
1595
  }, i = Math.max(s.x, s.y, s.z), o = this.calculateCentroid(this.accumulatedBounds), c = Math.sqrt(o.x ** 2 + o.y ** 2 + o.z ** 2);
1506
1596
  let l = 0, d = 0;
1507
- const u = this.THRESHOLD;
1508
- for (const g of t){
1509
- const h = g.positions;
1597
+ const f = this.THRESHOLD;
1598
+ for (const I of t){
1599
+ const h = I.positions;
1510
1600
  if (h.length >= 3) {
1511
1601
  const y = Math.abs(h[0]), E = Math.abs(h[1]), C = Math.abs(h[2]);
1512
- Math.max(y, E, C) < u ? l++ : d++;
1602
+ Math.max(y, E, C) < f ? l++ : d++;
1513
1603
  }
1514
1604
  }
1515
- const f = l + d, p = f > 0 && l / f > .5;
1605
+ const u = l + d, p = u > 0 && l / u > .5;
1516
1606
  p && (this.wasmRtcDetected = !0, this.accumulatedBounds = this.calculateBounds(t, this.NORMAL_COORD_THRESHOLD)), (c > this.THRESHOLD || i > this.THRESHOLD) && !p && (this.originShift = o);
1517
1607
  }
1518
1608
  this.shiftCalculated = !0;
@@ -1605,8 +1695,8 @@ let __tla = Promise.all([
1605
1695
  }, this.wasmRtcDetected = !1, this.activeThreshold = this.MAX_REASONABLE_COORD, this.appliedWasmRtcOffset = null, this.lengthUnitScale = void 0;
1606
1696
  }
1607
1697
  }
1608
- En = ((r)=>(r.Fast = "fast", r.Balanced = "balanced", r.High = "high", r))(En || {});
1609
- function bn(r) {
1698
+ Rn = ((r)=>(r.Fast = "fast", r.Balanced = "balanced", r.High = "high", r))(Rn || {});
1699
+ function Sn(r) {
1610
1700
  const t = Math.max(0, r.fileSizeMB), e = Math.max(1, Math.floor(r.cores)), n = Math.max(1, r.deviceMemoryGB), s = e >= 10 ? Math.max(n, 16) : n, i = Math.max(0, Math.floor(r.totalJobs)), o = Math.max(1, Math.floor(r.minWorkers ?? 1)), c = Math.max(o, Math.floor(r.maxWorkers ?? 8));
1611
1701
  if (i === 0) return {
1612
1702
  count: 0,
@@ -1614,7 +1704,7 @@ let __tla = Promise.all([
1614
1704
  };
1615
1705
  let l;
1616
1706
  e >= 16 && s >= 16 ? l = Math.min(c, Math.floor(e / 2)) : e >= 12 && s >= 8 ? l = t > 512 ? 4 : 5 : e >= 10 && s >= 8 ? l = t > 512 ? 3 : 4 : e >= 8 && s >= 8 ? l = t > 512 ? 2 : 3 : l = Math.max(1, Math.min(2, Math.floor(e / 2)));
1617
- const d = s * 1024, u = Math.max(1024, d * .25), f = t * 2.5, p = Math.max(64, t * 1.5), g = d - u - f, h = g > 0 ? Math.max(1, Math.floor(g / p)) : 1, y = [
1707
+ const d = s * 1024, f = Math.max(1024, d * .25), u = t * 2.5, p = Math.max(64, t * 1.5), I = d - f - u, h = I > 0 ? Math.max(1, Math.floor(I / p)) : 1, y = [
1618
1708
  {
1619
1709
  value: l,
1620
1710
  reason: "cores"
@@ -1642,55 +1732,57 @@ let __tla = Promise.all([
1642
1732
  reason: E.reason
1643
1733
  };
1644
1734
  }
1645
- function Cn(r) {
1646
- return bn(r).count;
1735
+ function Nn(r) {
1736
+ return Sn(r).count;
1647
1737
  }
1648
- const wn = 3e4, Tn = 15e3, Fn = 15e3, Rn = 5e3, Sn = 60, Nn = 30, An = 30, On = 15;
1649
- as = function(r) {
1650
- const t = r.desktopStableWasm === !0, e = Math.max(0, Math.floor(r.batchCount)), n = Math.max(0, r.fileSizeMB), s = e > 0 ? t ? Rn : Fn : t ? Tn : wn, i = e > 0 ? t ? On : An : t ? Nn : Sn;
1651
- return Math.max(s, Math.round(s + n * i));
1738
+ const An = 3e4, On = 15e3, xn = 60, Ln = 30;
1739
+ fs = function(r) {
1740
+ const t = Math.max(0, Math.floor(r.batchCount)), e = Math.max(0, r.fileSizeMB), n = t > 0 ? On : An, s = t > 0 ? Ln : xn;
1741
+ return Math.max(n, Math.round(n + e * s));
1652
1742
  };
1653
- function xn(r, t) {
1743
+ function Mn(r, t) {
1654
1744
  if (typeof t == "number") return t;
1655
1745
  const e = t.fileSizeMB ? t.fileSizeMB : r.length / (1024 * 1024);
1656
1746
  return e < 10 ? 100 : e < 50 ? 200 : e < 100 ? 300 : e < 300 ? 500 : e < 500 ? 1500 : 3e3;
1657
1747
  }
1658
- function Fe(r) {
1748
+ function Ne(r) {
1659
1749
  const t = [];
1660
1750
  try {
1661
- for(let e = 0; e < r.length; e++){
1662
- const n = r.get(e);
1663
- if (n) try {
1664
- const s = n.shadingColor, i = s && s.length === 4 ? [
1665
- s[0],
1666
- s[1],
1667
- s[2],
1668
- s[3]
1669
- ] : void 0, o = {
1670
- expressId: n.expressId,
1671
- ifcType: n.ifcType,
1672
- positions: n.positions,
1673
- normals: n.normals,
1674
- indices: n.indices,
1751
+ const e = Pn(r);
1752
+ for(let n = 0; n < r.length; n++){
1753
+ const s = r.get(n);
1754
+ if (s) try {
1755
+ const i = s.shadingColor, o = i && i.length === 4 ? [
1756
+ i[0],
1757
+ i[1],
1758
+ i[2],
1759
+ i[3]
1760
+ ] : void 0, c = s.color, l = e.get(s.expressId), d = {
1761
+ expressId: s.expressId,
1762
+ ifcType: s.ifcType,
1763
+ positions: s.positions,
1764
+ normals: s.normals,
1765
+ indices: s.indices,
1675
1766
  color: [
1676
- n.color[0],
1677
- n.color[1],
1678
- n.color[2],
1679
- n.color[3]
1767
+ c[0],
1768
+ c[1],
1769
+ c[2],
1770
+ c[3]
1680
1771
  ],
1681
- ...i ? {
1682
- shadingColor: i
1683
- } : {}
1772
+ ...o ? {
1773
+ shadingColor: o
1774
+ } : {},
1775
+ geometryClass: s.geometryClass ?? 0
1684
1776
  };
1685
- n.hasTexture && (o.uvs = n.uvs, o.texture = {
1686
- rgba: n.textureRgba,
1687
- width: n.textureWidth,
1688
- height: n.textureHeight,
1689
- repeatS: n.textureRepeatS,
1690
- repeatT: n.textureRepeatT
1691
- }), t.push(o);
1777
+ s.hasTexture && (d.uvs = s.uvs, d.texture = {
1778
+ rgba: s.textureRgba,
1779
+ width: s.textureWidth,
1780
+ height: s.textureHeight,
1781
+ repeatS: s.textureRepeatS,
1782
+ repeatT: s.textureRepeatT
1783
+ }), l !== void 0 && (d.geometryHash = l), t.push(d);
1692
1784
  } finally{
1693
- n.free();
1785
+ s.free();
1694
1786
  }
1695
1787
  }
1696
1788
  } finally{
@@ -1698,20 +1790,29 @@ let __tla = Promise.all([
1698
1790
  }
1699
1791
  return t;
1700
1792
  }
1793
+ function Pn(r) {
1794
+ const t = new Map, e = r;
1795
+ if ((e.geometryHashCount ?? 0) === 0) return t;
1796
+ const s = e.geometryHashIds, i = e.geometryHashValues;
1797
+ if (!s || !i) return t;
1798
+ const o = Math.min(s.length, i.length);
1799
+ for(let c = 0; c < o; c++)t.set(s[c], i[c]);
1800
+ return t;
1801
+ }
1701
1802
  function Wt(r, t) {
1702
1803
  return t !== void 0 ? {
1703
1804
  ...r,
1704
1805
  buildingRotation: t
1705
1806
  } : r;
1706
1807
  }
1707
- const Ln = 8, Mn = 32768, Pn = 4, Bn = 8192, Un = 10;
1708
- function Re() {
1808
+ const Bn = 8, Un = 32768, vn = 4, Dn = 8192, Gn = 10;
1809
+ function Ae() {
1709
1810
  const r = globalThis.scheduler;
1710
1811
  return typeof r?.yield == "function" ? r.yield() : new Promise((t)=>{
1711
1812
  globalThis.setTimeout(t, 0);
1712
1813
  });
1713
1814
  }
1714
- function Se(r, t, e) {
1815
+ function Oe(r, t, e) {
1715
1816
  if (t.type === "colorUpdate") {
1716
1817
  const i = r[r.length - 1];
1717
1818
  if (i?.type === "colorUpdate") {
@@ -1722,17 +1823,17 @@ let __tla = Promise.all([
1722
1823
  return;
1723
1824
  }
1724
1825
  const n = r[r.length - 1];
1725
- if (n?.type === "batch" && (r.length >= Ln || e.queuedMeshes >= Mn)) {
1826
+ if (n?.type === "batch" && (r.length >= Bn || e.queuedMeshes >= Un)) {
1726
1827
  for(let i = 0; i < t.meshes.length; i++)n.meshes.push(t.meshes[i]);
1727
1828
  n.nativeTelemetry = t.nativeTelemetry, e.coalescedBatchCount += 1;
1728
1829
  } else r.push(t);
1729
1830
  e.queuedMeshes += t.meshes.length;
1730
1831
  }
1731
- async function* Ne(r, t, e, n) {
1832
+ async function* xe(r, t, e, n) {
1732
1833
  e.reset(), yield {
1733
1834
  type: "start",
1734
1835
  totalEstimate: t
1735
- }, await Re(), yield {
1836
+ }, await Ae(), yield {
1736
1837
  type: "model-open",
1737
1838
  modelID: 0
1738
1839
  };
@@ -1740,65 +1841,71 @@ let __tla = Promise.all([
1740
1841
  queuedMeshes: 0,
1741
1842
  coalescedBatchCount: 0
1742
1843
  };
1743
- let o = null, c = !1, l = null, d, u = 0;
1744
- const f = ()=>{
1844
+ let o = null, c = !1, l = null, d, f = 0;
1845
+ const u = ()=>{
1745
1846
  o && (o(), o = null);
1746
1847
  }, p = r({
1747
1848
  onBatch: (h)=>{
1748
- Se(s, {
1849
+ Oe(s, {
1749
1850
  type: "batch",
1750
1851
  meshes: h.meshes,
1751
1852
  nativeTelemetry: h.nativeTelemetry
1752
- }, i), f();
1853
+ }, i), u();
1753
1854
  },
1754
1855
  onColorUpdate: (h)=>{
1755
- Se(s, {
1856
+ Oe(s, {
1756
1857
  type: "colorUpdate",
1757
1858
  updates: new Map(h)
1758
- }, i), f();
1859
+ }, i), u();
1759
1860
  },
1760
1861
  onComplete: (h)=>{
1761
- n(h), d = h.totalMeshes, c = !0, f();
1862
+ n(h), d = h.totalMeshes, c = !0, u();
1762
1863
  },
1763
1864
  onError: (h)=>{
1764
- l = h, c = !0, f();
1865
+ l = h, c = !0, u();
1765
1866
  }
1766
1867
  });
1767
- for(; !c || s.length > 0;){
1768
- let h = 0, y = 0, E = performance.now();
1769
- for(; s.length > 0;){
1770
- const C = s.shift();
1771
- if (C.type === "colorUpdate") {
1868
+ try {
1869
+ for(; !c || s.length > 0;){
1870
+ let h = 0, y = 0, E = performance.now();
1871
+ for(; s.length > 0;){
1872
+ const C = s.shift();
1873
+ if (C.type === "colorUpdate") {
1874
+ yield {
1875
+ type: "colorUpdate",
1876
+ updates: C.updates
1877
+ };
1878
+ continue;
1879
+ }
1880
+ i.queuedMeshes = Math.max(0, i.queuedMeshes - C.meshes.length), e.processTrustedMeshesIncremental(C.meshes), f += C.meshes.length;
1881
+ const T = e.getCurrentCoordinateInfo();
1772
1882
  yield {
1773
- type: "colorUpdate",
1774
- updates: C.updates
1775
- };
1776
- continue;
1883
+ type: "batch",
1884
+ meshes: C.meshes,
1885
+ totalSoFar: f,
1886
+ coordinateInfo: T || void 0,
1887
+ nativeTelemetry: C.nativeTelemetry
1888
+ }, h += 1, y += C.meshes.length, s.length > 0 && (h >= vn || y >= Dn || performance.now() - E >= Gn) && (await Ae(), h = 0, y = 0, E = performance.now());
1777
1889
  }
1778
- i.queuedMeshes = Math.max(0, i.queuedMeshes - C.meshes.length), e.processTrustedMeshesIncremental(C.meshes), u += C.meshes.length;
1779
- const T = e.getCurrentCoordinateInfo();
1780
- yield {
1781
- type: "batch",
1782
- meshes: C.meshes,
1783
- totalSoFar: u,
1784
- coordinateInfo: T || void 0,
1785
- nativeTelemetry: C.nativeTelemetry
1786
- }, h += 1, y += C.meshes.length, s.length > 0 && (h >= Pn || y >= Bn || performance.now() - E >= Un) && (await Re(), h = 0, y = 0, E = performance.now());
1890
+ if (l) throw l;
1891
+ c || await new Promise((C)=>{
1892
+ o = C;
1893
+ });
1787
1894
  }
1788
- if (l) throw l;
1789
- c || await new Promise((C)=>{
1790
- o = C;
1791
- });
1895
+ } finally{
1896
+ try {
1897
+ await p;
1898
+ } catch {}
1792
1899
  }
1793
- await p, i.coalescedBatchCount > 0 && console.info(`[GeometryProcessor] Coalesced ${i.coalescedBatchCount} native batches while JS drained the queue`);
1794
- const g = e.getFinalCoordinateInfo();
1900
+ i.coalescedBatchCount > 0 && console.info(`[GeometryProcessor] Coalesced ${i.coalescedBatchCount} native batches while JS drained the queue`);
1901
+ const I = e.getFinalCoordinateInfo();
1795
1902
  yield {
1796
1903
  type: "complete",
1797
- totalMeshes: d ?? u,
1798
- coordinateInfo: g
1904
+ totalMeshes: d ?? f,
1905
+ coordinateInfo: I
1799
1906
  };
1800
1907
  }
1801
- async function* Dn(r, t, e, n, s) {
1908
+ async function* $n(r, t, e, n, s) {
1802
1909
  t.reset(), yield {
1803
1910
  type: "start",
1804
1911
  totalEstimate: r.length / 1e3
@@ -1809,320 +1916,339 @@ let __tla = Promise.all([
1809
1916
  let i;
1810
1917
  const o = r.buffer;
1811
1918
  n && n.byteLength === r.byteLength ? i = n : typeof SharedArrayBuffer < "u" && o instanceof SharedArrayBuffer && r.byteOffset === 0 && r.byteLength === o.byteLength ? i = o : (i = new SharedArrayBuffer(r.byteLength), new Uint8Array(i).set(r));
1812
- const c = ()=>new Worker(new URL("/assets/geometry.worker-BdH-E6NB.js", import.meta.url), {
1919
+ const c = ()=>new Worker(new URL("/assets/geometry.worker-TH3fCCoY.js", import.meta.url), {
1813
1920
  type: "module"
1814
- }), l = ()=>new Worker(new URL("/assets/geometry.worker-BdH-E6NB.js", import.meta.url), {
1921
+ }), l = ()=>new Worker(new URL("/assets/geometry.worker-TH3fCCoY.js", import.meta.url), {
1815
1922
  type: "module"
1816
1923
  }), d = [];
1817
- let u = null;
1818
- const f = ()=>{
1819
- u && (u(), u = null);
1924
+ let f = null;
1925
+ const u = ()=>{
1926
+ f && (f(), f = null);
1820
1927
  };
1821
- let p = null, g = 0, h = !1, y = null, E = null, C = 0, T = 0, $ = !1, x = !1;
1822
- const Y = [];
1823
- let O = !1, v = !1;
1824
- const b = [], S = (L, X)=>{
1825
- L.onmessage = (B)=>{
1826
- const M = B.data;
1827
- if (M.type === "ready") {
1828
- console.log(`[stream] worker[${X}] WASM ready @ ${Q()}ms`);
1928
+ let p = null, I = 0, h = !1, y = null, E = null, C = 0, T = 0, G = !1, x = !1;
1929
+ const k = [];
1930
+ let O = !1, D = !1;
1931
+ const b = [], S = (L, j)=>{
1932
+ L.onmessage = (X)=>{
1933
+ const U = X.data;
1934
+ if (U.type === "ready") {
1935
+ console.log(`[stream] worker[${j}] WASM ready @ ${Q()}ms`);
1829
1936
  return;
1830
1937
  }
1831
- if (M.type === "memory") {
1938
+ if (U.type === "memory") {
1832
1939
  d.push({
1833
1940
  type: "workerMemory",
1834
- workerIndex: X,
1835
- wasmHeapBytes: M.wasmHeapBytes,
1836
- meshBytes: M.meshBytes
1837
- }), f();
1941
+ workerIndex: j,
1942
+ wasmHeapBytes: U.wasmHeapBytes,
1943
+ meshBytes: U.meshBytes
1944
+ }), u();
1838
1945
  return;
1839
1946
  }
1840
- if (M.type === "batch") {
1841
- b[X] === void 0 && (b[X] = Q(), console.log(`[stream] worker[${X}] first batch @ ${Q()}ms (${M.meshes?.length ?? 0} meshes)`));
1842
- const q = M.meshes.map((P)=>({
1843
- expressId: P.expressId,
1844
- ifcType: P.ifcType,
1845
- positions: P.positions instanceof Float32Array ? P.positions : new Float32Array(P.positions),
1846
- normals: P.normals instanceof Float32Array ? P.normals : new Float32Array(P.normals),
1847
- indices: P.indices instanceof Uint32Array ? P.indices : new Uint32Array(P.indices),
1848
- color: P.color,
1849
- ...P.uvs ? {
1850
- uvs: P.uvs
1947
+ if (U.type === "batch") {
1948
+ b[j] === void 0 && (b[j] = Q(), console.log(`[stream] worker[${j}] first batch @ ${Q()}ms (${U.meshes?.length ?? 0} meshes)`));
1949
+ const q = U.meshes.map((M)=>({
1950
+ expressId: M.expressId,
1951
+ ifcType: M.ifcType,
1952
+ positions: M.positions instanceof Float32Array ? M.positions : new Float32Array(M.positions),
1953
+ normals: M.normals instanceof Float32Array ? M.normals : new Float32Array(M.normals),
1954
+ indices: M.indices instanceof Uint32Array ? M.indices : new Uint32Array(M.indices),
1955
+ color: M.color,
1956
+ ...M.uvs ? {
1957
+ uvs: M.uvs
1958
+ } : {},
1959
+ ...M.texture ? {
1960
+ texture: M.texture
1961
+ } : {},
1962
+ ...M.geometryHash !== void 0 ? {
1963
+ geometryHash: M.geometryHash
1851
1964
  } : {},
1852
- ...P.texture ? {
1853
- texture: P.texture
1965
+ ...M.geometryClass !== void 0 ? {
1966
+ geometryClass: M.geometryClass
1854
1967
  } : {}
1855
1968
  }));
1856
1969
  if (q.length > 0) {
1857
1970
  T += q.length, t.processMeshesIncremental(q);
1858
- const P = t.getCurrentCoordinateInfo();
1971
+ const M = t.getCurrentCoordinateInfo();
1859
1972
  d.push({
1860
1973
  type: "batch",
1861
1974
  meshes: q,
1862
1975
  totalSoFar: T,
1863
- coordinateInfo: P || void 0
1864
- }), f();
1976
+ coordinateInfo: M || void 0
1977
+ }), u();
1865
1978
  }
1866
1979
  return;
1867
1980
  }
1868
- if (M.type === "complete") {
1869
- C++, L.terminate(), f();
1981
+ if (U.type === "complete") {
1982
+ C++, L.terminate(), u();
1870
1983
  return;
1871
1984
  }
1872
- if (M.type === "error") {
1873
- E = new Error(`Geometry worker error: ${M.message}`), C++, L.terminate(), f();
1985
+ if (U.type === "error") {
1986
+ E = new Error(`Geometry worker error: ${U.message}`), C++, L.terminate(), u();
1874
1987
  return;
1875
1988
  }
1876
- }, L.onerror = (B)=>{
1877
- E = new Error(`Geometry worker failed: ${B.message}`), C++, L.terminate(), f();
1989
+ }, L.onerror = (X)=>{
1990
+ E = new Error(`Geometry worker failed: ${X.message}`), C++, L.terminate(), u();
1878
1991
  };
1879
- }, F = typeof navigator < "u" ? navigator.hardwareConcurrency ?? 2 : 2, m = typeof navigator < "u" ? navigator.deviceMemory ?? 8 : 8, _ = r.byteLength / (1024 * 1024), w = Math.max(1, Math.ceil(_ * 100)), I = Cn({
1992
+ }, F = typeof navigator < "u" ? navigator.hardwareConcurrency ?? 2 : 2, m = typeof navigator < "u" ? navigator.deviceMemory ?? 8 : 8, _ = r.byteLength / (1024 * 1024), w = Math.max(1, Math.ceil(_ * 100)), g = Nn({
1880
1993
  fileSizeMB: _,
1881
1994
  cores: F,
1882
1995
  deviceMemoryGB: m,
1883
1996
  totalJobs: w
1884
1997
  }), R = [];
1885
- for(let L = 0; L < I; L++){
1886
- const X = c();
1887
- R.push(X), S(X, L);
1888
- const B = s?.wasmUrls?.wasm;
1889
- X.postMessage({
1998
+ for(let L = 0; L < g; L++){
1999
+ const j = c();
2000
+ R.push(j), S(j, L);
2001
+ const X = s?.wasmUrls?.wasm;
2002
+ j.postMessage({
1890
2003
  type: "init",
1891
- ...B ? {
1892
- wasmUrl: B
2004
+ ...X ? {
2005
+ wasmUrl: X
1893
2006
  } : {}
1894
- }), X.postMessage({
2007
+ }), j.postMessage({
1895
2008
  type: "set-merge-layers",
1896
2009
  enabled: s?.mergeLayers === !0
2010
+ }), j.postMessage({
2011
+ type: "set-compute-geometry-hashes",
2012
+ tolerance: s?.geometryHashTolerance ?? null
1897
2013
  });
1898
2014
  }
1899
2015
  const N = ()=>{
1900
- if (!$) {
1901
- $ = !0;
2016
+ if (!G) {
2017
+ G = !0;
1902
2018
  for (const L of R)try {
1903
2019
  L.postMessage({
1904
2020
  type: "stream-end"
1905
2021
  });
1906
2022
  } catch {}
1907
2023
  }
1908
- }, V = ()=>{
2024
+ }, $ = ()=>{
1909
2025
  if (x || !p) return;
1910
2026
  x = !0;
1911
- const L = e != null, X = L ? e.x : p.rtcOffset[0], B = L ? e.y : p.rtcOffset[1], M = L ? e.z : p.rtcOffset[2], q = L ? !0 : p.needsShift;
2027
+ const L = e != null, j = L ? e.x : p.rtcOffset[0], X = L ? e.y : p.rtcOffset[1], U = L ? e.z : p.rtcOffset[2], q = L ? !0 : p.needsShift;
1912
2028
  t.setWasmMetadata(p.unitScale, q ? {
1913
- x: X,
1914
- y: B,
1915
- z: M
2029
+ x: j,
2030
+ y: X,
2031
+ z: U
1916
2032
  } : null), d.push({
1917
2033
  type: "rtcOffset",
1918
2034
  rtcOffset: {
1919
- x: X,
1920
- y: B,
1921
- z: M
2035
+ x: j,
2036
+ y: X,
2037
+ z: U
1922
2038
  },
1923
2039
  hasRtc: q
1924
- }), f();
1925
- const P = new Uint32Array(0), it = new Uint8Array(0);
1926
- for (const pt of R)pt.postMessage({
2040
+ }), u();
2041
+ const M = new Uint32Array(0), nt = new Uint8Array(0);
2042
+ for (const dt of R)dt.postMessage({
1927
2043
  type: "stream-start",
1928
2044
  sharedBuffer: i,
1929
2045
  unitScale: p.unitScale,
1930
- rtcX: X,
1931
- rtcY: B,
1932
- rtcZ: M,
2046
+ rtcX: j,
2047
+ rtcY: X,
2048
+ rtcZ: U,
1933
2049
  needsShift: q,
1934
- voidKeys: P,
1935
- voidCounts: P,
1936
- voidValues: P,
1937
- styleIds: P,
1938
- styleColors: it
2050
+ voidKeys: M,
2051
+ voidCounts: M,
2052
+ voidValues: M,
2053
+ styleIds: M,
2054
+ styleColors: nt
1939
2055
  });
1940
2056
  };
1941
- function z(L) {
2057
+ function V(L) {
1942
2058
  if (R.length === 0 || L.length === 0) return;
1943
- const X = Math.floor(L.length / 3);
1944
- if (X === 0) return;
1945
- const B = Math.ceil(X / R.length);
2059
+ const j = Math.floor(L.length / 3);
2060
+ if (j === 0) return;
2061
+ const X = Math.ceil(j / R.length);
1946
2062
  try {
1947
- for(let M = 0; M < R.length; M++){
1948
- const q = M * B * 3, P = Math.min(q + B * 3, L.length);
1949
- if (q >= P) continue;
1950
- const it = L.slice(q, P);
1951
- R[M].postMessage({
2063
+ for(let U = 0; U < R.length; U++){
2064
+ const q = U * X * 3, M = Math.min(q + X * 3, L.length);
2065
+ if (q >= M) continue;
2066
+ const nt = L.slice(q, M);
2067
+ R[U].postMessage({
1952
2068
  type: "stream-chunk",
1953
- jobsFlat: it
2069
+ jobsFlat: nt
1954
2070
  }, [
1955
- it.buffer
2071
+ nt.buffer
1956
2072
  ]);
1957
2073
  }
1958
- } catch (M) {
1959
- E = new Error(`Failed to dispatch jobs chunk: ${M instanceof Error ? M.message : String(M)}`), f();
2074
+ } catch (U) {
2075
+ E = new Error(`Failed to dispatch jobs chunk: ${U instanceof Error ? U.message : String(U)}`), u();
1960
2076
  }
1961
2077
  }
1962
- const W = (L)=>{
1963
- if (!x || !O || !v) {
1964
- Y.push(L);
2078
+ const z = (L)=>{
2079
+ if (!x || !O || !D) {
2080
+ k.push(L);
1965
2081
  return;
1966
2082
  }
1967
- z(L);
1968
- }, H = ()=>{
1969
- if (!(!x || !O || !v)) for(; Y.length > 0;)z(Y.shift());
1970
- }, j = performance.now(), Q = ()=>Math.round(performance.now() - j);
1971
- console.log(`[stream] processParallel start, fileSizeMB=${_.toFixed(1)} workerCount=${I}`);
1972
- const K = l();
1973
- s?.wasmUrls?.wasm && K.postMessage({
1974
- type: "init",
1975
- wasmUrl: s.wasmUrls.wasm
1976
- });
1977
- let at = 0, ht = 0, rt = -1;
1978
- K.onmessage = (L)=>{
1979
- const X = L.data;
1980
- if (X.type === "prepass-progress") {
1981
- d.push({
1982
- type: "progress",
1983
- phase: "prepass"
1984
- }), f();
1985
- return;
1986
- }
1987
- if (X.type === "prepass-stream") {
1988
- const B = X.event;
1989
- if (B.type === "meta") p = {
1990
- unitScale: B.unitScale,
1991
- rtcOffset: B.rtcOffset,
1992
- needsShift: B.needsShift,
1993
- buildingRotation: B.buildingRotation ?? null
1994
- }, console.log(`[stream] meta @ ${Q()}ms unitScale=${p.unitScale} rtc=[${p.rtcOffset[0].toFixed(0)},${p.rtcOffset[1].toFixed(0)},${p.rtcOffset[2].toFixed(0)}]`), V(), f();
1995
- else if (B.type === "jobs") {
1996
- const M = B.jobs, q = Math.floor(M.length / 3);
1997
- at++, ht += q, rt < 0 && (rt = Q(), console.log(`[stream] first jobs chunk @ ${rt}ms (${q} jobs)`)), (at % 10 === 1 || q < 1e3) && console.log(`[stream] chunk #${at} @ ${Q()}ms (+${q} jobs, total ${ht})`), W(M);
1998
- } else if (B.type === "styles") {
1999
- const M = B.styleIds, q = B.styleColors, P = B.voidKeys, it = B.voidCounts, pt = B.voidValues;
2000
- console.log(`[stream] styles @ ${Q()}ms (${M.length} styled, ${P.length} void hosts), draining ${Y.length} queued chunks`);
2001
- for (const qt of R)try {
2002
- const ft = M.slice(), yt = q.slice(), mt = P.slice(), Et = it.slice(), Vt = pt.slice();
2003
- qt.postMessage({
2004
- type: "set-styles",
2005
- styleIds: ft,
2006
- styleColors: yt,
2007
- voidKeys: mt,
2008
- voidCounts: Et,
2009
- voidValues: Vt
2010
- }, [
2011
- ft.buffer,
2012
- yt.buffer,
2013
- mt.buffer,
2014
- Et.buffer,
2015
- Vt.buffer
2016
- ]);
2017
- } catch (ft) {
2018
- console.warn("[stream] set-styles dispatch failed:", ft);
2019
- }
2020
- O = !0, H();
2021
- } else if (B.type === "entity-index") {
2022
- const M = B.ids, q = B.starts, P = B.lengths;
2023
- if (console.log(`[stream] entity-index @ ${Q()}ms (${M.length} entries)`), typeof SharedArrayBuffer < "u") {
2024
- const it = M.byteLength, pt = q.byteLength, qt = P.byteLength, ft = new SharedArrayBuffer(it), yt = new SharedArrayBuffer(pt), mt = new SharedArrayBuffer(qt);
2025
- new Uint32Array(ft).set(M), new Uint32Array(yt).set(q), new Uint32Array(mt).set(P);
2026
- for (const Et of R)try {
2027
- Et.postMessage({
2028
- type: "set-entity-index",
2029
- ids: new Uint32Array(ft),
2030
- starts: new Uint32Array(yt),
2031
- lengths: new Uint32Array(mt)
2032
- });
2033
- } catch (Vt) {
2034
- console.warn("[stream] set-entity-index dispatch failed:", Vt);
2035
- }
2036
- if (s?.onEntityIndex) try {
2037
- s.onEntityIndex(new Uint32Array(ft), new Uint32Array(yt), new Uint32Array(mt));
2038
- } catch (Et) {
2039
- console.warn("[stream] onEntityIndex callback failed:", Et);
2040
- }
2041
- } else {
2042
- for (const it of R)try {
2043
- it.postMessage({
2044
- type: "set-entity-index",
2045
- ids: M.slice(),
2046
- starts: q.slice(),
2047
- lengths: P.slice()
2048
- });
2049
- } catch (pt) {
2050
- console.warn("[stream] set-entity-index dispatch failed:", pt);
2083
+ V(L);
2084
+ }, Y = ()=>{
2085
+ if (!(!x || !O || !D)) for(; k.length > 0;)V(k.shift());
2086
+ }, H = performance.now(), Q = ()=>Math.round(performance.now() - H);
2087
+ console.log(`[stream] processParallel start, fileSizeMB=${_.toFixed(1)} workerCount=${g}`);
2088
+ const Z = l();
2089
+ try {
2090
+ s?.wasmUrls?.wasm && Z.postMessage({
2091
+ type: "init",
2092
+ wasmUrl: s.wasmUrls.wasm
2093
+ });
2094
+ let L = 0, j = 0, X = -1;
2095
+ Z.onmessage = (nt)=>{
2096
+ const dt = nt.data;
2097
+ if (dt.type === "prepass-progress") {
2098
+ d.push({
2099
+ type: "progress",
2100
+ phase: "prepass"
2101
+ }), u();
2102
+ return;
2103
+ }
2104
+ if (dt.type === "prepass-stream") {
2105
+ const J = dt.event;
2106
+ if (J.type === "meta") p = {
2107
+ unitScale: J.unitScale,
2108
+ rtcOffset: J.rtcOffset,
2109
+ needsShift: J.needsShift,
2110
+ buildingRotation: J.buildingRotation ?? null
2111
+ }, console.log(`[stream] meta @ ${Q()}ms unitScale=${p.unitScale} rtc=[${p.rtcOffset[0].toFixed(0)},${p.rtcOffset[1].toFixed(0)},${p.rtcOffset[2].toFixed(0)}]`), $(), u();
2112
+ else if (J.type === "jobs") {
2113
+ const ot = J.jobs, at = Math.floor(ot.length / 3);
2114
+ L++, j += at, X < 0 && (X = Q(), console.log(`[stream] first jobs chunk @ ${X}ms (${at} jobs)`)), (L % 10 === 1 || at < 1e3) && console.log(`[stream] chunk #${L} @ ${Q()}ms (+${at} jobs, total ${j})`), z(ot);
2115
+ } else if (J.type === "styles") {
2116
+ const ot = J.styleIds, at = J.styleColors, ht = J.voidKeys, pt = J.voidCounts, wt = J.voidValues;
2117
+ console.log(`[stream] styles @ ${Q()}ms (${ot.length} styled, ${ht.length} void hosts), draining ${k.length} queued chunks`);
2118
+ for (const Jt of R)try {
2119
+ const ut = ot.slice(), It = at.slice(), yt = ht.slice(), mt = pt.slice(), jt = wt.slice();
2120
+ Jt.postMessage({
2121
+ type: "set-styles",
2122
+ styleIds: ut,
2123
+ styleColors: It,
2124
+ voidKeys: yt,
2125
+ voidCounts: mt,
2126
+ voidValues: jt
2127
+ }, [
2128
+ ut.buffer,
2129
+ It.buffer,
2130
+ yt.buffer,
2131
+ mt.buffer,
2132
+ jt.buffer
2133
+ ]);
2134
+ } catch (ut) {
2135
+ console.warn("[stream] set-styles dispatch failed:", ut);
2051
2136
  }
2052
- if (s?.onEntityIndex) try {
2053
- s.onEntityIndex(M.slice(), q.slice(), P.slice());
2054
- } catch (it) {
2055
- console.warn("[stream] onEntityIndex callback failed:", it);
2137
+ O = !0, Y();
2138
+ } else if (J.type === "entity-index") {
2139
+ const ot = J.ids, at = J.starts, ht = J.lengths;
2140
+ if (console.log(`[stream] entity-index @ ${Q()}ms (${ot.length} entries)`), typeof SharedArrayBuffer < "u") {
2141
+ const pt = ot.byteLength, wt = at.byteLength, Jt = ht.byteLength, ut = new SharedArrayBuffer(pt), It = new SharedArrayBuffer(wt), yt = new SharedArrayBuffer(Jt);
2142
+ new Uint32Array(ut).set(ot), new Uint32Array(It).set(at), new Uint32Array(yt).set(ht);
2143
+ for (const mt of R)try {
2144
+ mt.postMessage({
2145
+ type: "set-entity-index",
2146
+ ids: new Uint32Array(ut),
2147
+ starts: new Uint32Array(It),
2148
+ lengths: new Uint32Array(yt)
2149
+ });
2150
+ } catch (jt) {
2151
+ console.warn("[stream] set-entity-index dispatch failed:", jt);
2152
+ }
2153
+ if (s?.onEntityIndex) try {
2154
+ s.onEntityIndex(new Uint32Array(ut), new Uint32Array(It), new Uint32Array(yt));
2155
+ } catch (mt) {
2156
+ console.warn("[stream] onEntityIndex callback failed:", mt);
2157
+ }
2158
+ } else {
2159
+ for (const pt of R)try {
2160
+ pt.postMessage({
2161
+ type: "set-entity-index",
2162
+ ids: ot.slice(),
2163
+ starts: at.slice(),
2164
+ lengths: ht.slice()
2165
+ });
2166
+ } catch (wt) {
2167
+ console.warn("[stream] set-entity-index dispatch failed:", wt);
2168
+ }
2169
+ if (s?.onEntityIndex) try {
2170
+ s.onEntityIndex(ot.slice(), at.slice(), ht.slice());
2171
+ } catch (pt) {
2172
+ console.warn("[stream] onEntityIndex callback failed:", pt);
2173
+ }
2056
2174
  }
2057
- }
2058
- v = !0, H();
2059
- } else B.type === "complete" && (g = B.totalJobs, console.log(`[stream] prepass complete @ ${Q()}ms totalJobs=${g} chunks=${at}`), lt || (lt = !0, dt()));
2060
- return;
2061
- }
2062
- if (X.type === "error") {
2063
- y = new Error(X.message), h = !0, K.terminate(), f();
2064
- return;
2065
- }
2066
- }, K.onerror = (L)=>{
2067
- y = new Error(`Pre-pass worker failed: ${L.message}`), h = !0, K.terminate(), f();
2068
- };
2069
- const dt = ()=>{
2070
- h = !0, x && N(), K.terminate(), f();
2071
- };
2072
- K.postMessage({
2073
- type: "prepass-streaming",
2074
- sharedBuffer: i,
2075
- chunkSize: 5e4
2076
- });
2077
- let lt = !1;
2078
- for(;;){
2079
- for(; d.length > 0;)yield d.shift();
2080
- if (E) {
2081
- for (const L of R)try {
2082
- L.terminate();
2083
- } catch {}
2084
- try {
2085
- K.terminate();
2086
- } catch {}
2087
- throw E;
2088
- }
2089
- if (y) {
2090
- for (const L of R)try {
2091
- L.terminate();
2092
- } catch {}
2093
- throw y;
2094
- }
2095
- if (h && !x && g === 0) {
2096
- for (const X of R)try {
2097
- X.terminate();
2098
- } catch {}
2099
- yield {
2100
- type: "complete",
2101
- totalMeshes: 0,
2102
- coordinateInfo: t.getFinalCoordinateInfo()
2103
- };
2104
- return;
2105
- }
2106
- if (h && x && C >= R.length && d.length === 0) break;
2107
- await new Promise((L)=>{
2108
- u = L;
2175
+ D = !0, Y();
2176
+ } else J.type === "complete" && (I = J.totalJobs, console.log(`[stream] prepass complete @ ${Q()}ms totalJobs=${I} chunks=${L}`), q || (q = !0, U()));
2177
+ return;
2178
+ }
2179
+ if (dt.type === "error") {
2180
+ y = new Error(dt.message), h = !0, Z.terminate(), u();
2181
+ return;
2182
+ }
2183
+ }, Z.onerror = (nt)=>{
2184
+ y = new Error(`Pre-pass worker failed: ${nt.message}`), h = !0, Z.terminate(), u();
2185
+ };
2186
+ const U = ()=>{
2187
+ h = !0, x && N(), Z.terminate(), u();
2188
+ };
2189
+ Z.postMessage({
2190
+ type: "prepass-streaming",
2191
+ sharedBuffer: i,
2192
+ chunkSize: 5e4
2109
2193
  });
2194
+ let q = !1;
2195
+ for(;;){
2196
+ for(; d.length > 0;)yield d.shift();
2197
+ if (E) {
2198
+ for (const nt of R)try {
2199
+ nt.terminate();
2200
+ } catch {}
2201
+ try {
2202
+ Z.terminate();
2203
+ } catch {}
2204
+ throw E;
2205
+ }
2206
+ if (y) {
2207
+ for (const nt of R)try {
2208
+ nt.terminate();
2209
+ } catch {}
2210
+ throw y;
2211
+ }
2212
+ if (h && !x && I === 0) {
2213
+ for (const dt of R)try {
2214
+ dt.terminate();
2215
+ } catch {}
2216
+ yield {
2217
+ type: "complete",
2218
+ totalMeshes: 0,
2219
+ coordinateInfo: t.getFinalCoordinateInfo()
2220
+ };
2221
+ return;
2222
+ }
2223
+ if (h && x && C >= R.length && d.length === 0) break;
2224
+ await new Promise((nt)=>{
2225
+ f = nt;
2226
+ });
2227
+ }
2228
+ const M = t.getFinalCoordinateInfo();
2229
+ yield {
2230
+ type: "complete",
2231
+ totalMeshes: T,
2232
+ coordinateInfo: M
2233
+ };
2234
+ } finally{
2235
+ for (const L of R)try {
2236
+ L.terminate();
2237
+ } catch {}
2238
+ try {
2239
+ Z.terminate();
2240
+ } catch {}
2110
2241
  }
2111
- const gt = t.getFinalCoordinateInfo();
2112
- yield {
2113
- type: "complete",
2114
- totalMeshes: T,
2115
- coordinateInfo: gt
2116
- };
2117
2242
  }
2118
- let wt = null;
2119
- function vn(r) {
2120
- if (wt) throw new Error(`GeometryProcessor ${r} cannot start while ${wt} is still running. Wait for the active stream to finish, or cancel it before starting another geometry operation.`);
2121
- return wt = r, ()=>{
2122
- wt === r && (wt = null);
2243
+ const Vn = .001;
2244
+ let Tt = null;
2245
+ function zn(r) {
2246
+ if (Tt) throw new Error(`GeometryProcessor ${r} cannot start while ${Tt} is still running. Wait for the active stream to finish, or cancel it before starting another geometry operation.`);
2247
+ return Tt = r, ()=>{
2248
+ Tt === r && (Tt = null);
2123
2249
  };
2124
2250
  }
2125
- cs = class {
2251
+ us = class {
2126
2252
  static largeFileByteStreamingThreshold = 256 * 1024 * 1024;
2127
2253
  bridge = null;
2128
2254
  platformBridge = null;
@@ -2132,10 +2258,10 @@ let __tla = Promise.all([
2132
2258
  lastNativeStats = null;
2133
2259
  mergeLayers;
2134
2260
  constructor(t = {}){
2135
- this.bufferBuilder = new yn, this.coordinateHandler = new mn, this.isNative = t.preferNative !== !1 && $e(), this.mergeLayers = t.mergeLayers === !0, t.quality, this.isNative || (this.bridge = new _n, this.bridge.setMergeLayers(this.mergeLayers));
2261
+ this.bufferBuilder = new Tn, this.coordinateHandler = new Fn, this.isNative = t.preferNative !== !1 && je(), this.mergeLayers = t.mergeLayers === !0, t.quality, this.isNative || (this.bridge = new Cn, this.bridge.setMergeLayers(this.mergeLayers));
2136
2262
  }
2137
2263
  async init() {
2138
- this.isNative ? (this.platformBridge = await gn(), await this.platformBridge.init(), console.log("[GeometryProcessor] Native bridge initialized")) : this.bridge && await this.bridge.init();
2264
+ this.isNative ? (this.platformBridge = await wn(), await this.platformBridge.init(), console.log("[GeometryProcessor] Native bridge initialized")) : this.bridge && await this.bridge.init();
2139
2265
  }
2140
2266
  async process(t, e) {
2141
2267
  let n;
@@ -2144,15 +2270,15 @@ let __tla = Promise.all([
2144
2270
  this.bridge?.isInitialized() || await this.init();
2145
2271
  const c = await this.collectMeshesMainThread(t);
2146
2272
  n = c.meshes;
2147
- const l = this.coordinateHandler.processMeshes(n), d = c.buildingRotation, u = {
2273
+ const l = this.coordinateHandler.processMeshes(n), d = c.buildingRotation, f = {
2148
2274
  ...l,
2149
2275
  buildingRotation: d
2150
- }, f = this.bufferBuilder.processMeshes(n);
2276
+ }, u = this.bufferBuilder.processMeshes(n);
2151
2277
  return {
2152
- meshes: f.meshes,
2153
- totalTriangles: f.totalTriangles,
2154
- totalVertices: f.totalVertices,
2155
- coordinateInfo: u
2278
+ meshes: u.meshes,
2279
+ totalTriangles: u.totalTriangles,
2280
+ totalVertices: u.totalVertices,
2281
+ coordinateInfo: f
2156
2282
  };
2157
2283
  }
2158
2284
  const s = this.coordinateHandler.processMeshes(n), i = this.bufferBuilder.processMeshes(n);
@@ -2189,7 +2315,7 @@ let __tla = Promise.all([
2189
2315
  const s = [], i = n.totalJobs ?? 0;
2190
2316
  if (n.jobs && i > 0) {
2191
2317
  const o = e.processGeometryBatch(t, n.jobs, n.unitScale, n.rtcOffset?.[0] ?? 0, n.rtcOffset?.[1] ?? 0, n.rtcOffset?.[2] ?? 0, n.needsShift, n.voidKeys, n.voidCounts, n.voidValues, n.styleIds, n.styleColors);
2192
- s.push(...Fe(o));
2318
+ s.push(...Ne(o));
2193
2319
  }
2194
2320
  return {
2195
2321
  meshes: s,
@@ -2228,10 +2354,10 @@ let __tla = Promise.all([
2228
2354
  };
2229
2355
  return;
2230
2356
  }
2231
- const o = xn(t, e), l = Math.max(o, Math.ceil(s.totalJobs / 30));
2357
+ const o = Mn(t, e), l = Math.max(o, Math.ceil(s.totalJobs / 30));
2232
2358
  let d = 0;
2233
- for(let f = 0; f < s.totalJobs; f += l){
2234
- const p = Math.min(f + l, s.totalJobs), g = s.jobs.slice(f * 3, p * 3), h = n.processGeometryBatch(t, g, s.unitScale, s.rtcOffset?.[0] ?? 0, s.rtcOffset?.[1] ?? 0, s.rtcOffset?.[2] ?? 0, s.needsShift, s.voidKeys, s.voidCounts, s.voidValues, s.styleIds, s.styleColors), y = Fe(h);
2359
+ for(let u = 0; u < s.totalJobs; u += l){
2360
+ const p = Math.min(u + l, s.totalJobs), I = s.jobs.slice(u * 3, p * 3), h = n.processGeometryBatch(t, I, s.unitScale, s.rtcOffset?.[0] ?? 0, s.rtcOffset?.[1] ?? 0, s.rtcOffset?.[2] ?? 0, s.needsShift, s.voidKeys, s.voidCounts, s.voidValues, s.styleIds, s.styleColors), y = Ne(h);
2235
2361
  if (y.length === 0) {
2236
2362
  await new Promise((T)=>setTimeout(T, 0));
2237
2363
  continue;
@@ -2245,18 +2371,18 @@ let __tla = Promise.all([
2245
2371
  coordinateInfo: C || void 0
2246
2372
  }, await new Promise((T)=>setTimeout(T, 0));
2247
2373
  }
2248
- const u = Wt(this.coordinateHandler.getFinalCoordinateInfo(), i);
2374
+ const f = Wt(this.coordinateHandler.getFinalCoordinateInfo(), i);
2249
2375
  yield {
2250
2376
  type: "complete",
2251
2377
  totalMeshes: d,
2252
- coordinateInfo: u
2378
+ coordinateInfo: f
2253
2379
  };
2254
2380
  } finally{
2255
2381
  n.clearPrePassCache?.();
2256
2382
  }
2257
2383
  }
2258
2384
  async *processStreaming(t, e, n = 25, s) {
2259
- const i = this.isNative ? null : vn("processStreaming");
2385
+ const i = this.isNative ? null : zn("processStreaming");
2260
2386
  try {
2261
2387
  yield* this.processStreamingUnlocked(t, e, n, s);
2262
2388
  } finally{
@@ -2273,8 +2399,8 @@ let __tla = Promise.all([
2273
2399
  modelID: 0
2274
2400
  }, console.time("[GeometryProcessor] native-streaming");
2275
2401
  const i = [];
2276
- let o = null, c = !1, l = null, d, u = 0;
2277
- const f = ()=>{
2402
+ let o = null, c = !1, l = null, d, f = 0;
2403
+ const u = ()=>{
2278
2404
  o && (o(), o = null);
2279
2405
  }, p = this.platformBridge.processGeometryStreaming(t, {
2280
2406
  onBatch: (h)=>{
@@ -2282,52 +2408,57 @@ let __tla = Promise.all([
2282
2408
  type: "batch",
2283
2409
  meshes: h.meshes,
2284
2410
  nativeTelemetry: h.nativeTelemetry
2285
- }), f();
2411
+ }), u();
2286
2412
  },
2287
2413
  onColorUpdate: (h)=>{
2288
2414
  i.push({
2289
2415
  type: "colorUpdate",
2290
2416
  updates: new Map(h)
2291
- }), f();
2417
+ }), u();
2292
2418
  },
2293
2419
  onComplete: (h)=>{
2294
- this.lastNativeStats = h, d = h.totalMeshes, c = !0, f();
2420
+ this.lastNativeStats = h, d = h.totalMeshes, c = !0, u();
2295
2421
  },
2296
2422
  onError: (h)=>{
2297
- l = h, c = !0, f();
2423
+ l = h, c = !0, u();
2298
2424
  }
2299
2425
  });
2300
- for(; !c || i.length > 0;){
2301
- for(; i.length > 0;){
2302
- const h = i.shift();
2303
- if (h.type === "colorUpdate") {
2426
+ try {
2427
+ for(; !c || i.length > 0;){
2428
+ for(; i.length > 0;){
2429
+ const h = i.shift();
2430
+ if (h.type === "colorUpdate") {
2431
+ yield {
2432
+ type: "colorUpdate",
2433
+ updates: h.updates
2434
+ };
2435
+ continue;
2436
+ }
2437
+ this.coordinateHandler.processMeshesIncremental(h.meshes), f += h.meshes.length;
2438
+ const y = this.coordinateHandler.getCurrentCoordinateInfo();
2304
2439
  yield {
2305
- type: "colorUpdate",
2306
- updates: h.updates
2440
+ type: "batch",
2441
+ meshes: h.meshes,
2442
+ totalSoFar: f,
2443
+ coordinateInfo: y || void 0,
2444
+ nativeTelemetry: h.nativeTelemetry
2307
2445
  };
2308
- continue;
2309
2446
  }
2310
- this.coordinateHandler.processMeshesIncremental(h.meshes), u += h.meshes.length;
2311
- const y = this.coordinateHandler.getCurrentCoordinateInfo();
2312
- yield {
2313
- type: "batch",
2314
- meshes: h.meshes,
2315
- totalSoFar: u,
2316
- coordinateInfo: y || void 0,
2317
- nativeTelemetry: h.nativeTelemetry
2318
- };
2447
+ if (l) throw l;
2448
+ c || await new Promise((h)=>{
2449
+ o = h;
2450
+ });
2319
2451
  }
2320
- if (l) throw l;
2321
- c || await new Promise((h)=>{
2322
- o = h;
2323
- });
2452
+ } finally{
2453
+ try {
2454
+ await p;
2455
+ } catch {}
2324
2456
  }
2325
- await p;
2326
- const g = this.coordinateHandler.getFinalCoordinateInfo();
2457
+ const I = this.coordinateHandler.getFinalCoordinateInfo();
2327
2458
  yield {
2328
2459
  type: "complete",
2329
- totalMeshes: d ?? u,
2330
- coordinateInfo: g
2460
+ totalMeshes: d ?? f,
2461
+ coordinateInfo: I
2331
2462
  }, console.timeEnd("[GeometryProcessor] native-streaming");
2332
2463
  } else {
2333
2464
  if (!this.bridge) throw new Error("WASM bridge not initialized");
@@ -2337,21 +2468,22 @@ let __tla = Promise.all([
2337
2468
  async *processStreamingPath(t, e = 0, n) {
2338
2469
  if (!this.isNative) throw new Error("File-path geometry streaming is only available in native desktop builds");
2339
2470
  if (this.platformBridge || await this.init(), !this.platformBridge?.processGeometryStreamingPath) throw new Error("Native platform bridge does not support file-path streaming");
2340
- yield* Ne((s)=>this.platformBridge.processGeometryStreamingPath(t, s, n), e > 0 ? e / 1e3 : 0, this.coordinateHandler, (s)=>{
2471
+ yield* xe((s)=>this.platformBridge.processGeometryStreamingPath(t, s, n), e > 0 ? e / 1e3 : 0, this.coordinateHandler, (s)=>{
2341
2472
  this.lastNativeStats = s;
2342
2473
  });
2343
2474
  }
2344
2475
  async *processStreamingCache(t) {
2345
2476
  if (!this.isNative) throw new Error("Native cached geometry streaming is only available in native desktop builds");
2346
2477
  if (this.platformBridge || await this.init(), !this.platformBridge?.processGeometryStreamingCache) throw new Error("Native platform bridge does not support cached geometry streaming");
2347
- yield* Ne((e)=>this.platformBridge.processGeometryStreamingCache(t, e), 0, this.coordinateHandler, (e)=>{
2478
+ yield* xe((e)=>this.platformBridge.processGeometryStreamingCache(t, e), 0, this.coordinateHandler, (e)=>{
2348
2479
  this.lastNativeStats = e;
2349
2480
  });
2350
2481
  }
2351
2482
  async *processParallel(t, e, n, s, i) {
2352
- this.bridge?.isInitialized() || await this.init(), yield* Dn(t, this.coordinateHandler, e, n, {
2483
+ this.bridge?.isInitialized() || await this.init(), yield* $n(t, this.coordinateHandler, e, n, {
2353
2484
  onEntityIndex: s,
2354
2485
  mergeLayers: this.mergeLayers,
2486
+ geometryHashTolerance: this.bridge?.getComputeGeometryHashes() ?? null,
2355
2487
  wasmUrls: i
2356
2488
  });
2357
2489
  }
@@ -2385,6 +2517,9 @@ let __tla = Promise.all([
2385
2517
  };
2386
2518
  } else typeof SharedArrayBuffer < "u" && typeof Worker < "u" && typeof navigator < "u" && (navigator.hardwareConcurrency ?? 1) > 1 ? yield* this.processParallel(t, e.sharedRtcOffset, e.existingSab, e.onEntityIndex, e.wasmUrls) : yield* this.processStreaming(t, e.entityIndex, s, e.sharedRtcOffset);
2387
2519
  }
2520
+ enableGeometryHashes(t = Vn) {
2521
+ this.bridge?.setComputeGeometryHashes(t);
2522
+ }
2388
2523
  getApi() {
2389
2524
  return !this.bridge || !this.bridge.isInitialized() ? null : this.bridge.getApi();
2390
2525
  }
@@ -2393,22 +2528,22 @@ let __tla = Promise.all([
2393
2528
  }
2394
2529
  parseSymbolicRepresentations(t) {
2395
2530
  if (!this.bridge || !this.bridge.isInitialized()) return null;
2396
- const e = nt(t);
2531
+ const e = it(t);
2397
2532
  return this.bridge.parseSymbolicRepresentations(e);
2398
2533
  }
2399
2534
  parseAlignmentLines(t) {
2400
2535
  if (!this.bridge || !this.bridge.isInitialized()) return null;
2401
- const e = nt(t);
2536
+ const e = it(t);
2402
2537
  return this.bridge.parseAlignmentLines(e);
2403
2538
  }
2404
2539
  parseGridLines(t) {
2405
2540
  if (!this.bridge || !this.bridge.isInitialized()) return null;
2406
- const e = nt(t);
2541
+ const e = it(t);
2407
2542
  return this.bridge.parseGridLines(e);
2408
2543
  }
2409
2544
  parseGridAxes(t) {
2410
2545
  if (!this.bridge || !this.bridge.isInitialized()) return null;
2411
- const e = nt(t), n = this.bridge.parseGridAxes(e);
2546
+ const e = it(t), n = this.bridge.parseGridAxes(e);
2412
2547
  try {
2413
2548
  const s = [];
2414
2549
  for(let i = 0; i < n.length; i++){
@@ -2441,12 +2576,12 @@ let __tla = Promise.all([
2441
2576
  }
2442
2577
  extractProfiles(t, e = 0) {
2443
2578
  if (!this.bridge || !this.bridge.isInitialized()) return null;
2444
- const n = nt(t);
2579
+ const n = it(t);
2445
2580
  return this.bridge.extractProfiles(n, e);
2446
2581
  }
2447
2582
  dispose() {}
2448
2583
  };
2449
- ls = class {
2584
+ hs = class {
2450
2585
  geometryResult;
2451
2586
  constructor(t){
2452
2587
  this.geometryResult = t;
@@ -2463,7 +2598,7 @@ let __tla = Promise.all([
2463
2598
  };
2464
2599
  }
2465
2600
  buildGLTF(t) {
2466
- const e = this.geometryResult.meshes, n = t.colorSource ?? "rendering", s = t.visibleOnly === !0, i = t.hiddenEntityIds ?? null, o = t.isolatedEntityIds ?? null, c = o !== null && o.size > 0, l = t.hiddenIfcTypes ?? null, d = (I)=>s ? !(l && I.ifcType && l.has(I.ifcType) || c && !o.has(I.expressId) || i && i.has(I.expressId)) : !0, u = (I)=>n === "shading" ? I.shadingColor ?? I.color : I.color, f = {
2601
+ const e = this.geometryResult.meshes, n = t.colorSource ?? "rendering", s = t.visibleOnly === !0, i = t.hiddenEntityIds ?? null, o = t.isolatedEntityIds ?? null, c = o !== null && o.size > 0, l = t.hiddenIfcTypes ?? null, d = (g)=>s ? !(l && g.ifcType && l.has(g.ifcType) || c && !o.has(g.expressId) || i && i.has(g.expressId)) : !0, f = (g)=>n === "shading" ? g.shadingColor ?? g.color : g.color, u = {
2467
2602
  asset: {
2468
2603
  version: "2.0",
2469
2604
  generator: "IFC-Lite"
@@ -2484,23 +2619,23 @@ let __tla = Promise.all([
2484
2619
  }
2485
2620
  ]
2486
2621
  };
2487
- t.includeMetadata && (f.asset.extras = {
2622
+ t.includeMetadata && (u.asset.extras = {
2488
2623
  meshCount: e.length,
2489
2624
  vertexCount: this.geometryResult.totalVertices,
2490
2625
  triangleCount: this.geometryResult.totalTriangles
2491
2626
  });
2492
- const p = new Map, g = [];
2493
- function h(I) {
2494
- const R = `${Math.round(I[0] * 100)},${Math.round(I[1] * 100)},${Math.round(I[2] * 100)},${Math.round(I[3] * 100)}`, N = p.get(R);
2627
+ const p = new Map, I = [];
2628
+ function h(g) {
2629
+ const R = `${Math.round(g[0] * 100)},${Math.round(g[1] * 100)},${Math.round(g[2] * 100)},${Math.round(g[3] * 100)}`, N = p.get(R);
2495
2630
  if (N !== void 0) return N;
2496
- const V = g.length;
2497
- return g.push({
2631
+ const $ = I.length;
2632
+ return I.push({
2498
2633
  pbrMetallicRoughness: {
2499
2634
  baseColorFactor: [
2500
- I[0],
2501
- I[1],
2502
- I[2],
2503
- I[3]
2635
+ g[0],
2636
+ g[1],
2637
+ g[2],
2638
+ g[3]
2504
2639
  ],
2505
2640
  metallicFactor: 0,
2506
2641
  roughnessFactor: 1
@@ -2508,146 +2643,146 @@ let __tla = Promise.all([
2508
2643
  extensions: {
2509
2644
  KHR_materials_unlit: {}
2510
2645
  },
2511
- ...I[3] < 1 ? {
2646
+ ...g[3] < 1 ? {
2512
2647
  alphaMode: "BLEND"
2513
2648
  } : {}
2514
- }), p.set(R, V), V;
2649
+ }), p.set(R, $), $;
2515
2650
  }
2516
2651
  const y = [];
2517
2652
  let E = 0, C = 0, T = 0;
2518
- for(let I = 0; I < e.length; I++){
2519
- const R = e[I];
2653
+ for(let g = 0; g < e.length; g++){
2654
+ const R = e[g];
2520
2655
  if (!d(R)) continue;
2521
- const N = R.positions, V = R.normals, z = R.indices;
2522
- if (!N.length || !V.length || !z.length || N.length % 3 !== 0 || V.length % 3 !== 0 || N.length !== V.length) continue;
2523
- let W = N[0], H = N[1], j = N[2], Q = N[0], K = N[1], at = N[2];
2524
- for(let rt = 3; rt < N.length; rt += 3){
2525
- const dt = N[rt], lt = N[rt + 1], gt = N[rt + 2];
2526
- dt < W && (W = dt), dt > Q && (Q = dt), lt < H && (H = lt), lt > K && (K = lt), gt < j && (j = gt), gt > at && (at = gt);
2656
+ const N = R.positions, $ = R.normals, V = R.indices;
2657
+ if (!N.length || !$.length || !V.length || N.length % 3 !== 0 || $.length % 3 !== 0 || N.length !== $.length) continue;
2658
+ let z = N[0], Y = N[1], H = N[2], Q = N[0], Z = N[1], L = N[2];
2659
+ for(let X = 3; X < N.length; X += 3){
2660
+ const U = N[X], q = N[X + 1], M = N[X + 2];
2661
+ U < z && (z = U), U > Q && (Q = U), q < Y && (Y = q), q > Z && (Z = q), M < H && (H = M), M > L && (L = M);
2527
2662
  }
2528
- const ht = u(R);
2663
+ const j = f(R);
2529
2664
  y.push({
2530
- meshIndex: I,
2665
+ meshIndex: g,
2531
2666
  posCount: N.length,
2532
- normCount: V.length,
2533
- idxCount: z.length,
2667
+ normCount: $.length,
2668
+ idxCount: V.length,
2534
2669
  posByteOffset: E * 4,
2535
2670
  normByteOffset: C * 4,
2536
2671
  idxByteOffset: T * 4,
2537
2672
  bounds: {
2538
2673
  min: [
2539
- W,
2540
- H,
2541
- j
2674
+ z,
2675
+ Y,
2676
+ H
2542
2677
  ],
2543
2678
  max: [
2544
2679
  Q,
2545
- K,
2546
- at
2680
+ Z,
2681
+ L
2547
2682
  ]
2548
2683
  },
2549
- materialIdx: ht ? h(ht) : void 0
2550
- }), E += N.length, C += V.length, T += z.length;
2684
+ materialIdx: j ? h(j) : void 0
2685
+ }), E += N.length, C += $.length, T += V.length;
2551
2686
  }
2552
2687
  if (E === 0 || C === 0 || T === 0) throw new Error("Cannot export GLB: no valid geometry data found");
2553
- const $ = new Float32Array(E), x = new Float32Array(C), Y = new Uint32Array(T);
2554
- let O = 0, v = 0, b = 0;
2688
+ const G = new Float32Array(E), x = new Float32Array(C), k = new Uint32Array(T);
2689
+ let O = 0, D = 0, b = 0;
2555
2690
  const S = [];
2556
- for (const I of y){
2557
- const R = e[I.meshIndex];
2558
- $.set(R.positions, O), x.set(R.normals, v), Y.set(R.indices, b), O += I.posCount, v += I.normCount, b += I.idxCount;
2559
- const N = f.accessors.length;
2560
- f.accessors.push({
2691
+ for (const g of y){
2692
+ const R = e[g.meshIndex];
2693
+ G.set(R.positions, O), x.set(R.normals, D), k.set(R.indices, b), O += g.posCount, D += g.normCount, b += g.idxCount;
2694
+ const N = u.accessors.length;
2695
+ u.accessors.push({
2561
2696
  bufferView: 0,
2562
- byteOffset: I.posByteOffset,
2697
+ byteOffset: g.posByteOffset,
2563
2698
  componentType: 5126,
2564
- count: I.posCount / 3,
2699
+ count: g.posCount / 3,
2565
2700
  type: "VEC3",
2566
- min: I.bounds.min,
2567
- max: I.bounds.max
2701
+ min: g.bounds.min,
2702
+ max: g.bounds.max
2568
2703
  });
2569
- const V = f.accessors.length;
2570
- f.accessors.push({
2704
+ const $ = u.accessors.length;
2705
+ u.accessors.push({
2571
2706
  bufferView: 1,
2572
- byteOffset: I.normByteOffset,
2707
+ byteOffset: g.normByteOffset,
2573
2708
  componentType: 5126,
2574
- count: I.normCount / 3,
2709
+ count: g.normCount / 3,
2575
2710
  type: "VEC3"
2576
2711
  });
2577
- const z = f.accessors.length;
2578
- f.accessors.push({
2712
+ const V = u.accessors.length;
2713
+ u.accessors.push({
2579
2714
  bufferView: 2,
2580
- byteOffset: I.idxByteOffset,
2715
+ byteOffset: g.idxByteOffset,
2581
2716
  componentType: 5125,
2582
- count: I.idxCount,
2717
+ count: g.idxCount,
2583
2718
  type: "SCALAR"
2584
2719
  });
2585
- const W = f.meshes.length;
2586
- f.meshes.push({
2720
+ const z = u.meshes.length;
2721
+ u.meshes.push({
2587
2722
  primitives: [
2588
2723
  {
2589
2724
  attributes: {
2590
2725
  POSITION: N,
2591
- NORMAL: V
2726
+ NORMAL: $
2592
2727
  },
2593
- indices: z,
2594
- ...I.materialIdx !== void 0 ? {
2595
- material: I.materialIdx
2728
+ indices: V,
2729
+ ...g.materialIdx !== void 0 ? {
2730
+ material: g.materialIdx
2596
2731
  } : {}
2597
2732
  }
2598
2733
  ]
2599
2734
  });
2600
- const H = f.nodes.length, j = {
2601
- mesh: W
2735
+ const Y = u.nodes.length, H = {
2736
+ mesh: z
2602
2737
  };
2603
- t.includeMetadata && R.expressId !== void 0 && (j.extras = R.modelIndex !== void 0 ? {
2738
+ t.includeMetadata && R.expressId !== void 0 && (H.extras = R.modelIndex !== void 0 ? {
2604
2739
  expressId: R.expressId,
2605
2740
  modelIndex: R.modelIndex
2606
2741
  } : {
2607
2742
  expressId: R.expressId
2608
- }), f.nodes.push(j), S.push(H);
2743
+ }), u.nodes.push(H), S.push(Y);
2609
2744
  }
2610
- f.scenes[0].nodes = S, g.length > 0 && (f.materials = g, f.extensionsUsed = [
2745
+ u.scenes[0].nodes = S, I.length > 0 && (u.materials = I, u.extensionsUsed = [
2611
2746
  "KHR_materials_unlit"
2612
2747
  ]);
2613
- const F = $.buffer, m = x.buffer, _ = Y.buffer, w = F.byteLength + m.byteLength + _.byteLength;
2614
- f.bufferViews.push({
2748
+ const F = G.buffer, m = x.buffer, _ = k.buffer, w = F.byteLength + m.byteLength + _.byteLength;
2749
+ u.bufferViews.push({
2615
2750
  buffer: 0,
2616
2751
  byteOffset: 0,
2617
2752
  byteLength: F.byteLength,
2618
2753
  byteStride: 12,
2619
2754
  target: 34962
2620
- }), f.bufferViews.push({
2755
+ }), u.bufferViews.push({
2621
2756
  buffer: 0,
2622
2757
  byteOffset: F.byteLength,
2623
2758
  byteLength: m.byteLength,
2624
2759
  byteStride: 12,
2625
2760
  target: 34962
2626
- }), f.bufferViews.push({
2761
+ }), u.bufferViews.push({
2627
2762
  buffer: 0,
2628
2763
  byteOffset: F.byteLength + m.byteLength,
2629
2764
  byteLength: _.byteLength,
2630
2765
  target: 34963
2631
- }), f.buffers[0].byteLength = w;
2632
- for (const I of f.accessors){
2633
- const R = f.bufferViews[I.bufferView];
2634
- if (!R) throw new Error(`Accessor references invalid bufferView ${I.bufferView}`);
2766
+ }), u.buffers[0].byteLength = w;
2767
+ for (const g of u.accessors){
2768
+ const R = u.bufferViews[g.bufferView];
2769
+ if (!R) throw new Error(`Accessor references invalid bufferView ${g.bufferView}`);
2635
2770
  let N = 0;
2636
- if (I.componentType === 5126) N = 4;
2637
- else if (I.componentType === 5125) N = 4;
2638
- else if (I.componentType === 5123) N = 2;
2639
- else if (I.componentType === 5120) N = 1;
2640
- else throw new Error(`Unsupported component type: ${I.componentType}`);
2641
- let V = 1;
2642
- if (I.type === "VEC3") V = 3;
2643
- else if (I.type === "VEC2") V = 2;
2644
- else if (I.type === "SCALAR") V = 1;
2645
- else throw new Error(`Unsupported accessor type: ${I.type}`);
2646
- const z = I.count * V * N, W = (I.byteOffset || 0) + z;
2647
- if (W > R.byteLength) throw new Error(`Accessor exceeds bufferView bounds: accessor byteOffset=${I.byteOffset || 0}, length=${z}, bufferView byteLength=${R.byteLength}, end=${W}`);
2771
+ if (g.componentType === 5126) N = 4;
2772
+ else if (g.componentType === 5125) N = 4;
2773
+ else if (g.componentType === 5123) N = 2;
2774
+ else if (g.componentType === 5120) N = 1;
2775
+ else throw new Error(`Unsupported component type: ${g.componentType}`);
2776
+ let $ = 1;
2777
+ if (g.type === "VEC3") $ = 3;
2778
+ else if (g.type === "VEC2") $ = 2;
2779
+ else if (g.type === "SCALAR") $ = 1;
2780
+ else throw new Error(`Unsupported accessor type: ${g.type}`);
2781
+ const V = g.count * $ * N, z = (g.byteOffset || 0) + V;
2782
+ if (z > R.byteLength) throw new Error(`Accessor exceeds bufferView bounds: accessor byteOffset=${g.byteOffset || 0}, length=${V}, bufferView byteLength=${R.byteLength}, end=${z}`);
2648
2783
  }
2649
2784
  return {
2650
- json: f,
2785
+ json: u,
2651
2786
  buffers: [
2652
2787
  new Uint8Array(F),
2653
2788
  new Uint8Array(m),
@@ -2662,23 +2797,23 @@ let __tla = Promise.all([
2662
2797
  return n;
2663
2798
  }
2664
2799
  packGLB(t, e) {
2665
- const n = JSON.stringify(t), s = new TextEncoder().encode(n), i = (4 - s.byteLength % 4) % 4, o = s.byteLength + i, c = this.combineBuffers(e), l = (4 - c.byteLength % 4) % 4, d = c.byteLength + l, u = 20 + o + 8 + d, f = new ArrayBuffer(u), p = new DataView(f), g = new Uint8Array(f);
2800
+ const n = JSON.stringify(t), s = new TextEncoder().encode(n), i = (4 - s.byteLength % 4) % 4, o = s.byteLength + i, c = this.combineBuffers(e), l = (4 - c.byteLength % 4) % 4, d = c.byteLength + l, f = 20 + o + 8 + d, u = new ArrayBuffer(f), p = new DataView(u), I = new Uint8Array(u);
2666
2801
  let h = 0;
2667
- p.setUint32(h, 1179937895, !0), h += 4, p.setUint32(h, 2, !0), h += 4, p.setUint32(h, u, !0), h += 4, p.setUint32(h, o, !0), h += 4, p.setUint32(h, 1313821514, !0), h += 4, g.set(s, h), h += s.byteLength;
2668
- for(let y = 0; y < i; y++)g[h++] = 32;
2669
- return p.setUint32(h, d, !0), h += 4, p.setUint32(h, 5130562, !0), h += 4, g.set(c, h), new Uint8Array(f);
2802
+ p.setUint32(h, 1179937895, !0), h += 4, p.setUint32(h, 2, !0), h += 4, p.setUint32(h, f, !0), h += 4, p.setUint32(h, o, !0), h += 4, p.setUint32(h, 1313821514, !0), h += 4, I.set(s, h), h += s.byteLength;
2803
+ for(let y = 0; y < i; y++)I[h++] = 32;
2804
+ return p.setUint32(h, d, !0), h += 4, p.setUint32(h, 5130562, !0), h += 4, I.set(c, h), new Uint8Array(u);
2670
2805
  }
2671
2806
  };
2672
- ds = class {
2807
+ ps = class {
2673
2808
  store;
2674
2809
  constructor(t){
2675
2810
  this.store = t;
2676
2811
  }
2677
2812
  getPropertiesForEntity(t) {
2678
- return this.store.onDemandPropertyMap && this.store.source?.length > 0 ? ke(this.store, t) : this.store.properties?.getForEntity(t) ?? [];
2813
+ return this.store.onDemandPropertyMap && this.store.source?.length > 0 ? qe(this.store, t) : this.store.properties?.getForEntity(t) ?? [];
2679
2814
  }
2680
2815
  getQuantitiesForEntity(t) {
2681
- return this.store.onDemandQuantityMap && this.store.source?.length > 0 ? Ye(this.store, t) : this.store.quantities?.getForEntity(t) ?? [];
2816
+ return this.store.onDemandQuantityMap && this.store.source?.length > 0 ? Qe(this.store, t) : this.store.quantities?.getForEntity(t) ?? [];
2682
2817
  }
2683
2818
  exportEntities(t, e = {}) {
2684
2819
  const n = e.delimiter ?? ",", s = e.includeProperties ?? !1, i = e.flattenProperties ?? !1, o = [
@@ -2691,42 +2826,42 @@ let __tla = Promise.all([
2691
2826
  "hasGeometry"
2692
2827
  ], c = new Map;
2693
2828
  if (s && i) {
2694
- const u = t ?? this.getAllEntityIds();
2695
- for (const f of u){
2696
- const p = this.getPropertiesForEntity(f);
2697
- for (const g of p){
2698
- c.has(g.name) || c.set(g.name, new Set);
2699
- for (const h of g.properties)c.get(g.name).add(h.name);
2829
+ const f = t ?? this.getAllEntityIds();
2830
+ for (const u of f){
2831
+ const p = this.getPropertiesForEntity(u);
2832
+ for (const I of p){
2833
+ c.has(I.name) || c.set(I.name, new Set);
2834
+ for (const h of I.properties)c.get(I.name).add(h.name);
2700
2835
  }
2701
2836
  }
2702
- for (const [f, p] of c)for (const g of p)o.push(`${f}_${g}`);
2837
+ for (const [u, p] of c)for (const I of p)o.push(`${u}_${I}`);
2703
2838
  }
2704
2839
  const l = [
2705
- this.joinRow(o.map((u)=>this.escapeValue(u)), n)
2840
+ this.joinRow(o.map((f)=>this.escapeValue(f)), n)
2706
2841
  ], d = t ?? this.getAllEntityIds();
2707
- for (const u of d){
2708
- const f = [
2709
- this.escapeValue(u),
2710
- this.escapeValue(this.store.entities.getGlobalId(u) || ""),
2711
- this.escapeValue(this.store.entities.getName(u) || ""),
2712
- this.escapeValue(this.store.entities.getTypeName(u) || ""),
2713
- this.escapeValue(this.store.entities.getDescription(u) || ""),
2714
- this.escapeValue(this.store.entities.getObjectType(u) || ""),
2715
- this.escapeValue(this.store.entities.hasGeometry(u) ? "true" : "false")
2842
+ for (const f of d){
2843
+ const u = [
2844
+ this.escapeValue(f),
2845
+ this.escapeValue(this.store.entities.getGlobalId(f) || ""),
2846
+ this.escapeValue(this.store.entities.getName(f) || ""),
2847
+ this.escapeValue(this.store.entities.getTypeName(f) || ""),
2848
+ this.escapeValue(this.store.entities.getDescription(f) || ""),
2849
+ this.escapeValue(this.store.entities.getObjectType(f) || ""),
2850
+ this.escapeValue(this.store.entities.hasGeometry(f) ? "true" : "false")
2716
2851
  ];
2717
2852
  if (s && i) {
2718
- const p = this.getPropertiesForEntity(u), g = new Map;
2853
+ const p = this.getPropertiesForEntity(f), I = new Map;
2719
2854
  for (const h of p){
2720
2855
  const y = new Map;
2721
2856
  for (const E of h.properties)y.set(E.name, E.value);
2722
- g.set(h.name, y);
2857
+ I.set(h.name, y);
2723
2858
  }
2724
2859
  for (const [h, y] of c)for (const E of y){
2725
- const C = g.get(h)?.get(E) ?? "";
2726
- f.push(this.escapeValue(C));
2860
+ const C = I.get(h)?.get(E) ?? "";
2861
+ u.push(this.escapeValue(C));
2727
2862
  }
2728
2863
  }
2729
- l.push(this.joinRow(f, n));
2864
+ l.push(this.joinRow(u, n));
2730
2865
  }
2731
2866
  return l.join(`
2732
2867
  `);
@@ -2747,17 +2882,17 @@ let __tla = Promise.all([
2747
2882
  for (const c of o){
2748
2883
  const l = this.getPropertiesForEntity(c);
2749
2884
  if (!l || l.length === 0) continue;
2750
- const d = this.store.entities.getGlobalId(c) || "", u = this.store.entities.getName(c) || "", f = this.store.entities.getTypeName(c) || "";
2751
- for (const p of l)if (!(!p.properties || p.properties.length === 0)) for (const g of p.properties){
2885
+ const d = this.store.entities.getGlobalId(c) || "", f = this.store.entities.getName(c) || "", u = this.store.entities.getTypeName(c) || "";
2886
+ for (const p of l)if (!(!p.properties || p.properties.length === 0)) for (const I of p.properties){
2752
2887
  const h = [
2753
2888
  this.escapeValue(c),
2754
2889
  this.escapeValue(d),
2755
- this.escapeValue(u),
2756
2890
  this.escapeValue(f),
2891
+ this.escapeValue(u),
2757
2892
  this.escapeValue(p.name || ""),
2758
- this.escapeValue(g.name || ""),
2759
- this.escapeValue(g.value),
2760
- this.escapeValue(g.type ?? "")
2893
+ this.escapeValue(I.name || ""),
2894
+ this.escapeValue(I.value),
2895
+ this.escapeValue(I.type ?? "")
2761
2896
  ];
2762
2897
  i.push(this.joinRow(h, n));
2763
2898
  }
@@ -2781,14 +2916,14 @@ let __tla = Promise.all([
2781
2916
  for (const l of c){
2782
2917
  const d = this.getQuantitiesForEntity(l);
2783
2918
  if (!d || d.length === 0) continue;
2784
- const u = this.store.entities.getGlobalId(l) || "", f = this.store.entities.getName(l) || "", p = this.store.entities.getTypeName(l) || "";
2785
- for (const g of d)if (!(!g.quantities || g.quantities.length === 0)) for (const h of g.quantities){
2919
+ const f = this.store.entities.getGlobalId(l) || "", u = this.store.entities.getName(l) || "", p = this.store.entities.getTypeName(l) || "";
2920
+ for (const I of d)if (!(!I.quantities || I.quantities.length === 0)) for (const h of I.quantities){
2786
2921
  const y = [
2787
2922
  this.escapeValue(l),
2788
- this.escapeValue(u),
2789
2923
  this.escapeValue(f),
2924
+ this.escapeValue(u),
2790
2925
  this.escapeValue(p),
2791
- this.escapeValue(g.name || ""),
2926
+ this.escapeValue(I.name || ""),
2792
2927
  this.escapeValue(h.name || ""),
2793
2928
  this.escapeValue(h.value),
2794
2929
  this.escapeValue(h.type ?? "")
@@ -2812,7 +2947,7 @@ let __tla = Promise.all([
2812
2947
  ], i = this.store.spatialHierarchy;
2813
2948
  if (!i?.project) return s[0];
2814
2949
  const o = (c, l, d)=>{
2815
- const u = [
2950
+ const f = [
2816
2951
  this.escapeValue(c.expressId),
2817
2952
  this.escapeValue(this.store.entities.getGlobalId(c.expressId) || ""),
2818
2953
  this.escapeValue(c.name || ""),
@@ -2820,7 +2955,7 @@ let __tla = Promise.all([
2820
2955
  this.escapeValue(l ?? ""),
2821
2956
  this.escapeValue(d)
2822
2957
  ];
2823
- if (s.push(this.joinRow(u, e)), c.children) for (const f of c.children)o(f, c.expressId, d + 1);
2958
+ if (s.push(this.joinRow(f, e)), c.children) for (const u of c.children)o(u, c.expressId, d + 1);
2824
2959
  };
2825
2960
  return o(i.project, null, 0), s.join(`
2826
2961
  `);
@@ -2832,15 +2967,15 @@ let __tla = Promise.all([
2832
2967
  }
2833
2968
  escapeValue(t) {
2834
2969
  if (t == null) return "";
2835
- const e = String(t);
2836
- return e.includes(",") || e.includes('"') || e.includes(`
2970
+ let e = String(t);
2971
+ return /^[=+\-@\t\r]/.test(e) && (e = `'${e}`), e.includes(",") || e.includes('"') || e.includes(`
2837
2972
  `) || e.includes("\r") ? `"${e.replace(/"/g, '""')}"` : e;
2838
2973
  }
2839
2974
  joinRow(t, e) {
2840
2975
  return t.join(e);
2841
2976
  }
2842
2977
  };
2843
- const Gn = 35, jt = 48, Ae = 57, $n = new Set([
2978
+ const Hn = 35, kt = 48, Le = 57, jn = new Set([
2844
2979
  "IFCOWNERHISTORY",
2845
2980
  "IFCAPPLICATION",
2846
2981
  "IFCPERSON",
@@ -2856,7 +2991,7 @@ let __tla = Promise.all([
2856
2991
  "IFCMONETARYUNIT",
2857
2992
  "IFCGEOMETRICREPRESENTATIONCONTEXT",
2858
2993
  "IFCGEOMETRICREPRESENTATIONSUBCONTEXT"
2859
- ]), Vn = new Set([
2994
+ ]), Wn = new Set([
2860
2995
  "IFCPROJECT",
2861
2996
  "IFCSITE",
2862
2997
  "IFCBUILDING",
@@ -2877,7 +3012,7 @@ let __tla = Promise.all([
2877
3012
  "IFCSPATIALZONE",
2878
3013
  "IFCEXTERNALSPATIALELEMENT",
2879
3014
  "IFCEXTERNALSPATIALSTRUCTUREELEMENT"
2880
- ]), zn = new Set([
3015
+ ]), kn = new Set([
2881
3016
  "IFCBEAM",
2882
3017
  "IFCBEAMSTANDARDCASE",
2883
3018
  "IFCBUILDINGELEMENT",
@@ -3085,45 +3220,45 @@ let __tla = Promise.all([
3085
3220
  "IFCSTRUCTURALSURFACEMEMBERVARYING",
3086
3221
  "IFCSTRUCTURALSURFACEREACTION"
3087
3222
  ]);
3088
- function Ht(r, t, e, n) {
3223
+ function qt(r, t, e, n) {
3089
3224
  const s = t + e;
3090
3225
  let i = t;
3091
- for(; i < s;)if (r[i] === Gn) {
3092
- if (i++, i < s && r[i] >= jt && r[i] <= Ae) {
3093
- let o = r[i] - jt;
3094
- for(i++; i < s && r[i] >= jt && r[i] <= Ae;)o = o * 10 + (r[i] - jt), i++;
3226
+ for(; i < s;)if (r[i] === Hn) {
3227
+ if (i++, i < s && r[i] >= kt && r[i] <= Le) {
3228
+ let o = r[i] - kt;
3229
+ for(i++; i < s && r[i] >= kt && r[i] <= Le;)o = o * 10 + (r[i] - kt), i++;
3095
3230
  n.push(o);
3096
3231
  }
3097
3232
  } else i++;
3098
3233
  }
3099
- function ae(r, t, e, n) {
3234
+ function le(r, t, e, n) {
3100
3235
  const s = new Set, i = [];
3101
3236
  for (const c of r)e.has(c) && !s.has(c) && (s.add(c), i.push(c));
3102
3237
  const o = [];
3103
3238
  for(; i.length > 0;){
3104
3239
  const c = i.pop(), l = e.get(c);
3105
3240
  if (l) {
3106
- o.length = 0, Ht(t, l.byteOffset, l.byteLength, o);
3241
+ o.length = 0, qt(t, l.byteOffset, l.byteLength, o);
3107
3242
  for(let d = 0; d < o.length; d++){
3108
- const u = o[d];
3109
- if (!s.has(u) && e.has(u)) {
3110
- if (n && n.has(u)) continue;
3111
- s.add(u), i.push(u);
3243
+ const f = o[d];
3244
+ if (!s.has(f) && e.has(f)) {
3245
+ if (n && n.has(f)) continue;
3246
+ s.add(f), i.push(f);
3112
3247
  }
3113
3248
  }
3114
3249
  }
3115
3250
  }
3116
3251
  return s;
3117
3252
  }
3118
- function ce(r, t, e) {
3253
+ function de(r, t, e) {
3119
3254
  const n = new Set, s = new Set;
3120
3255
  for (const [i, o] of r.entityIndex.byId){
3121
3256
  const c = o.type.toUpperCase();
3122
- if ($n.has(c)) {
3257
+ if (jn.has(c)) {
3123
3258
  n.add(i);
3124
3259
  continue;
3125
3260
  }
3126
- if (Vn.has(c)) {
3261
+ if (Wn.has(c)) {
3127
3262
  n.add(i);
3128
3263
  continue;
3129
3264
  }
@@ -3131,7 +3266,7 @@ let __tla = Promise.all([
3131
3266
  n.add(i);
3132
3267
  continue;
3133
3268
  }
3134
- if (zn.has(c)) {
3269
+ if (kn.has(c)) {
3135
3270
  const l = t.has(i), d = e !== null && !e.has(i);
3136
3271
  l || d ? s.add(i) : n.add(i);
3137
3272
  continue;
@@ -3145,12 +3280,12 @@ let __tla = Promise.all([
3145
3280
  continue;
3146
3281
  }
3147
3282
  }
3148
- return Wn(r, n, s), {
3283
+ return Yn(r, n, s), {
3149
3284
  roots: n,
3150
3285
  hiddenProductIds: s
3151
3286
  };
3152
3287
  }
3153
- function Wn(r, t, e) {
3288
+ function Yn(r, t, e) {
3154
3289
  const n = r.source;
3155
3290
  if (!n) return;
3156
3291
  const s = r.entityIndex.byType.get("IFCRELVOIDSELEMENT") ?? [];
@@ -3162,12 +3297,12 @@ let __tla = Promise.all([
3162
3297
  let l = c.byteOffset;
3163
3298
  const d = c.byteOffset + c.byteLength;
3164
3299
  for(; l < d && n[l] !== 40;)l++;
3165
- if (l >= d || (i.length = 0, Ht(n, l, d - l, i), i.length < 2)) continue;
3166
- const u = i[i.length - 2], f = i[i.length - 1];
3167
- e.has(u) && (e.add(f), t.delete(o), t.delete(f));
3300
+ if (l >= d || (i.length = 0, qt(n, l, d - l, i), i.length < 2)) continue;
3301
+ const f = i[i.length - 2], u = i[i.length - 1];
3302
+ e.has(f) && (e.add(u), t.delete(o), t.delete(u));
3168
3303
  }
3169
3304
  }
3170
- function le(r, t, e) {
3305
+ function fe(r, t, e) {
3171
3306
  const n = [], s = [], i = e.byType.get("IFCSTYLEDITEM") ?? [], o = e.byType.get("IFCSTYLEDREPRESENTATION") ?? [];
3172
3307
  for (const c of [
3173
3308
  i,
@@ -3176,26 +3311,26 @@ let __tla = Promise.all([
3176
3311
  if (r.has(l)) continue;
3177
3312
  const d = e.byId.get(l);
3178
3313
  if (!d) continue;
3179
- s.length = 0, Ht(t, d.byteOffset, d.byteLength, s);
3180
- let u = !1;
3181
- for(let f = 0; f < s.length; f++)if (r.has(s[f])) {
3182
- u = !0;
3314
+ s.length = 0, qt(t, d.byteOffset, d.byteLength, s);
3315
+ let f = !1;
3316
+ for(let u = 0; u < s.length; u++)if (r.has(s[u])) {
3317
+ f = !0;
3183
3318
  break;
3184
3319
  }
3185
- u && (r.add(l), n.push(l));
3320
+ f && (r.add(l), n.push(l));
3186
3321
  }
3187
3322
  for(; n.length > 0;){
3188
3323
  const c = n.pop(), l = e.byId.get(c);
3189
3324
  if (l) {
3190
- s.length = 0, Ht(t, l.byteOffset, l.byteLength, s);
3325
+ s.length = 0, qt(t, l.byteOffset, l.byteLength, s);
3191
3326
  for(let d = 0; d < s.length; d++){
3192
- const u = s[d];
3193
- !r.has(u) && e.byId.has(u) && (r.add(u), n.push(u));
3327
+ const f = s[d];
3328
+ !r.has(f) && e.byId.has(f) && (r.add(f), n.push(f));
3194
3329
  }
3195
3330
  }
3196
3331
  }
3197
3332
  }
3198
- const Oe = new Map([
3333
+ const Me = new Map([
3199
3334
  [
3200
3335
  "IFCELECTRICDISTRIBUTIONPOINT",
3201
3336
  "IFCELECTRICDISTRIBUTIONBOARD"
@@ -3208,7 +3343,7 @@ let __tla = Promise.all([
3208
3343
  "IFCEQUIPMENTELEMENT",
3209
3344
  "IFCBUILDINGELEMENTPROXY"
3210
3345
  ]
3211
- ]), xe = new Map([
3346
+ ]), Pe = new Map([
3212
3347
  [
3213
3348
  "IFCELECTRICDISTRIBUTIONBOARD",
3214
3349
  "IFCELECTRICDISTRIBUTIONPOINT"
@@ -3301,7 +3436,7 @@ let __tla = Promise.all([
3301
3436
  "IFCBUILTELEMENT",
3302
3437
  "IFCBUILDINGELEMENTPROXY"
3303
3438
  ]
3304
- ]), Zt = new Map([]), te = new Map([
3439
+ ]), ee = new Map([]), ne = new Map([
3305
3440
  [
3306
3441
  "IFCFACILITY",
3307
3442
  "IFCBUILDING"
@@ -3446,7 +3581,7 @@ let __tla = Promise.all([
3446
3581
  "IFCELECTRICFLOWTREATMENTDEVICE",
3447
3582
  "IFCFLOWTREATMENTDEVICE"
3448
3583
  ]
3449
- ]), jn = new Map([
3584
+ ]), Xn = new Map([
3450
3585
  [
3451
3586
  "IFCWALL",
3452
3587
  8
@@ -3568,34 +3703,34 @@ let __tla = Promise.all([
3568
3703
  8
3569
3704
  ]
3570
3705
  ]);
3571
- function Ve(r, t, e) {
3706
+ function We(r, t, e) {
3572
3707
  if (t === e) return r;
3573
3708
  const n = r.toUpperCase();
3574
- return kn(t, e)?.get(n) ?? n;
3709
+ return qn(t, e)?.get(n) ?? n;
3575
3710
  }
3576
- function kn(r, t) {
3577
- return r === "IFC2X3" && t === "IFC4" ? Oe : r === "IFC4" && t === "IFC2X3" ? xe : r === "IFC4" && t === "IFC4X3" ? Zt : r === "IFC4X3" && t === "IFC4" ? te : r === "IFC5" && t === "IFC4X3" || r === "IFC4X3" && t === "IFC5" ? null : r === "IFC5" && t === "IFC4" ? te : r === "IFC4" && t === "IFC5" ? Zt : r === "IFC2X3" && (t === "IFC4X3" || t === "IFC5") ? Le(Oe, Zt) : (r === "IFC4X3" || r === "IFC5") && t === "IFC2X3" ? Le(te, xe) : null;
3711
+ function qn(r, t) {
3712
+ return r === "IFC2X3" && t === "IFC4" ? Me : r === "IFC4" && t === "IFC2X3" ? Pe : r === "IFC4" && t === "IFC4X3" ? ee : r === "IFC4X3" && t === "IFC4" ? ne : r === "IFC5" && t === "IFC4X3" || r === "IFC4X3" && t === "IFC5" ? null : r === "IFC5" && t === "IFC4" ? ne : r === "IFC4" && t === "IFC5" ? ee : r === "IFC2X3" && (t === "IFC4X3" || t === "IFC5") ? Be(Me, ee) : (r === "IFC4X3" || r === "IFC5") && t === "IFC2X3" ? Be(ne, Pe) : null;
3578
3713
  }
3579
- function Le(r, t) {
3714
+ function Be(r, t) {
3580
3715
  const e = new Map;
3581
3716
  for (const [n, s] of r)e.set(n, t.get(s) ?? s);
3582
3717
  for (const [n, s] of t)e.has(n) || e.set(n, s);
3583
3718
  return e;
3584
3719
  }
3585
- function Xt(r, t, e) {
3720
+ function Qt(r, t, e) {
3586
3721
  if (t === e) return r;
3587
3722
  const n = r.match(/^(#\d+=)(\w+)\((.*)?\);?\s*$/);
3588
3723
  if (!n) return r;
3589
- const s = n[1], i = n[2].toUpperCase(), o = n[3] ?? "", c = Ve(i, t, e);
3590
- if (Yn(c, e)) return `${s}IFCPROXY('${qn()}',$,'${i}',$,$,$,$,.NOTDEFINED.,$);`;
3724
+ const s = n[1], i = n[2].toUpperCase(), o = n[3] ?? "", c = We(i, t, e);
3725
+ if (Qn(c, e)) return `${s}IFCPROXY('${Zn()}',$,'${i}',$,$,$,$,.NOTDEFINED.,$);`;
3591
3726
  let l = o;
3592
3727
  if (e === "IFC2X3") {
3593
- const d = jn.get(c);
3594
- d !== void 0 && (l = Hn(o, d));
3728
+ const d = Xn.get(c);
3729
+ d !== void 0 && (l = Jn(o, d));
3595
3730
  }
3596
3731
  return `${s}${c}(${l});`;
3597
3732
  }
3598
- function Yn(r, t) {
3733
+ function Qn(r, t) {
3599
3734
  return t === "IFC4X3" || t === "IFC5" ? !1 : new Set([
3600
3735
  "IFCALIGNMENTCANT",
3601
3736
  "IFCALIGNMENTHORIZONTAL",
@@ -3603,7 +3738,7 @@ let __tla = Promise.all([
3603
3738
  "IFCALIGNMENTSEGMENT"
3604
3739
  ]).has(r);
3605
3740
  }
3606
- function Hn(r, t) {
3741
+ function Jn(r, t) {
3607
3742
  if (!r.trim()) return r;
3608
3743
  const e = [];
3609
3744
  let n = 0, s = !1, i = "";
@@ -3625,70 +3760,70 @@ let __tla = Promise.all([
3625
3760
  }
3626
3761
  return e.push(i), e.length > t ? e.slice(0, t).join(",") : e.join(",");
3627
3762
  }
3628
- function de(r, t) {
3763
+ function ue(r, t) {
3629
3764
  return r !== t;
3630
3765
  }
3631
- let Xn = 0;
3632
- function qn() {
3633
- const r = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_$", t = Xn++;
3766
+ let Kn = 0;
3767
+ function Zn() {
3768
+ const r = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_$", t = Kn++;
3634
3769
  let e = "PROXY_", n = t;
3635
3770
  for(let s = 0; s < 16; s++)e += r[n % 64], n = Math.floor(n / 64) + s;
3636
3771
  return e;
3637
3772
  }
3638
- function st(r) {
3639
- return r.replace(/\\/g, "\\\\").replace(/'/g, "''");
3773
+ function rt(r) {
3774
+ return r.replace(/\\/g, "\\\\").replace(/'/g, "''").replace(/[\x00-\x1F\x7F]+/g, " ");
3640
3775
  }
3641
- function Z(r) {
3776
+ function et(r) {
3642
3777
  if (!Number.isFinite(r)) return "0.";
3643
3778
  const t = r.toString();
3644
3779
  return t.includes(".") ? t : t + ".";
3645
3780
  }
3646
- function Qn(r) {
3781
+ function ts(r) {
3647
3782
  switch(r){
3648
- case bt.Length:
3783
+ case Et.Length:
3649
3784
  return "IFCQUANTITYLENGTH";
3650
- case bt.Area:
3785
+ case Et.Area:
3651
3786
  return "IFCQUANTITYAREA";
3652
- case bt.Volume:
3787
+ case Et.Volume:
3653
3788
  return "IFCQUANTITYVOLUME";
3654
- case bt.Count:
3789
+ case Et.Count:
3655
3790
  return "IFCQUANTITYCOUNT";
3656
- case bt.Weight:
3791
+ case Et.Weight:
3657
3792
  return "IFCQUANTITYWEIGHT";
3658
- case bt.Time:
3793
+ case Et.Time:
3659
3794
  return "IFCQUANTITYTIME";
3660
3795
  default:
3661
3796
  return "IFCQUANTITYCOUNT";
3662
3797
  }
3663
3798
  }
3664
- function ze(r, t) {
3799
+ function ke(r, t) {
3665
3800
  if (r == null) return "$";
3666
3801
  switch(t){
3667
- case et.String:
3668
- case et.Label:
3669
- case et.Text:
3670
- return `IFCLABEL('${st(String(r))}')`;
3671
- case et.Identifier:
3672
- return `IFCIDENTIFIER('${st(String(r))}')`;
3673
- case et.Real:
3802
+ case st.String:
3803
+ case st.Label:
3804
+ case st.Text:
3805
+ return `IFCLABEL('${rt(String(r))}')`;
3806
+ case st.Identifier:
3807
+ return `IFCIDENTIFIER('${rt(String(r))}')`;
3808
+ case st.Real:
3674
3809
  {
3675
3810
  const e = Number(r);
3676
3811
  return Number.isFinite(e) ? `IFCREAL(${e.toString().includes(".") ? e : e + "."})` : "$";
3677
3812
  }
3678
- case et.Integer:
3813
+ case st.Integer:
3679
3814
  return `IFCINTEGER(${Math.round(Number(r))})`;
3680
- case et.Boolean:
3681
- case et.Logical:
3815
+ case st.Boolean:
3816
+ case st.Logical:
3682
3817
  return r === !0 ? "IFCBOOLEAN(.T.)" : r === !1 ? "IFCBOOLEAN(.F.)" : "IFCLOGICAL(.U.)";
3683
- case et.Enum:
3818
+ case st.Enum:
3684
3819
  return `.${String(r).toUpperCase()}.`;
3685
- case et.List:
3686
- return Array.isArray(r) ? `(${r.map((n)=>ze(n, et.String)).join(",")})` : "$";
3820
+ case st.List:
3821
+ return Array.isArray(r) ? `(${r.map((n)=>ke(n, st.String)).join(",")})` : "$";
3687
3822
  default:
3688
- return `IFCLABEL('${st(String(r))}')`;
3823
+ return `IFCLABEL('${rt(String(r))}')`;
3689
3824
  }
3690
3825
  }
3691
- function Jn(r, t) {
3826
+ function es(r, t) {
3692
3827
  const e = r.trim(), n = t.trim();
3693
3828
  if (r === "") return "$";
3694
3829
  if (e === "$" || e === "*" || /^#\d+$/.test(e)) return e;
@@ -3699,22 +3834,22 @@ let __tla = Promise.all([
3699
3834
  }
3700
3835
  if (/^-?\d+(?:\.\d+)?(?:E[+-]?\d+)?$/i.test(e) && /^-?\d/.test(n)) {
3701
3836
  const s = Number(e);
3702
- return Number.isFinite(s) ? n.includes(".") || /E/i.test(n) ? Z(s) : String(s) : "$";
3837
+ return Number.isFinite(s) ? n.includes(".") || /E/i.test(n) ? et(s) : String(s) : "$";
3703
3838
  }
3704
- return Ue(r);
3839
+ return Ge(r);
3705
3840
  }
3706
- function fe(r) {
3841
+ function he(r) {
3707
3842
  if (r == null) return "$";
3708
3843
  if (typeof r == "boolean") return r ? ".T." : ".F.";
3709
- if (typeof r == "number") return Number.isFinite(r) ? Number.isInteger(r) ? String(r) : Z(r) : "$";
3710
- if (Array.isArray(r)) return `(${r.map(fe).join(",")})`;
3844
+ if (typeof r == "number") return Number.isFinite(r) ? Number.isInteger(r) ? String(r) : et(r) : "$";
3845
+ if (Array.isArray(r)) return `(${r.map(he).join(",")})`;
3711
3846
  const t = String(r).trim();
3712
- return t === "$" || t === "*" || /^#\d+$/.test(t) ? t : /^\.[A-Z0-9_]+\.$/i.test(t) ? t.toUpperCase() : `'${st(String(r))}'`;
3847
+ return t === "$" || t === "*" || /^#\d+$/.test(t) ? t : /^\.[A-Z0-9_]+\.$/i.test(t) ? t.toUpperCase() : `'${rt(String(r))}'`;
3713
3848
  }
3714
- function Kn(r) {
3715
- return r.map(fe).join(",");
3849
+ function ns(r) {
3850
+ return r.map(he).join(",");
3716
3851
  }
3717
- function Me(r) {
3852
+ function Ue(r) {
3718
3853
  const t = [];
3719
3854
  let e = "", n = 0, s = !1;
3720
3855
  for(let i = 0; i < r.length; i++){
@@ -3739,7 +3874,7 @@ let __tla = Promise.all([
3739
3874
  }
3740
3875
  return e.trim() && t.push(e.trim()), t;
3741
3876
  }
3742
- function Zn(r) {
3877
+ function ss(r) {
3743
3878
  const t = [];
3744
3879
  let e = "", n = 0, s = !1;
3745
3880
  for(let i = 0; i < r.length; i++){
@@ -3764,7 +3899,7 @@ let __tla = Promise.all([
3764
3899
  }
3765
3900
  return t.push(e), t;
3766
3901
  }
3767
- ts = class {
3902
+ is = class {
3768
3903
  dataStore;
3769
3904
  mutationView;
3770
3905
  nextExpressId;
@@ -3772,121 +3907,121 @@ let __tla = Promise.all([
3772
3907
  constructor(t, e){
3773
3908
  this.dataStore = t, this.mutationView = e || null;
3774
3909
  const n = this.findMaxExpressId(), s = typeof e?.peekNextExpressId == "function" ? e.peekNextExpressId() - 1 : 0;
3775
- this.nextExpressId = Math.max(n, s) + 1, this.entityExtractor = t.source ? new He(t.source) : null;
3910
+ this.nextExpressId = Math.max(n, s) + 1, this.entityExtractor = t.source ? new Je(t.source) : null;
3776
3911
  }
3777
3912
  export(t) {
3778
3913
  const e = [];
3779
3914
  let n = 0, s = 0;
3780
- const i = t.schema || this.dataStore.schemaVersion || "IFC4", o = this.dataStore.schemaVersion || "IFC4", c = de(o, i);
3915
+ const i = t.schema || this.dataStore.schemaVersion || "IFC4", o = this.dataStore.schemaVersion || "IFC4", c = ue(o, i);
3781
3916
  if (i === "IFC2X3" && t.applyMutations !== !1 && t.georefMutations && (Object.keys(t.georefMutations.projectedCRS ?? {}).length > 0 || Object.keys(t.georefMutations.mapConversion ?? {}).length > 0)) throw new Error("Georeferencing creation and editing requires IFC4 or newer. IFC2X3 does not support IfcProjectedCRS or IfcMapConversion.");
3782
- const l = se({
3917
+ const l = re({
3783
3918
  schema: i,
3784
3919
  description: t.description || "Exported from ifc-lite",
3785
3920
  author: t.author || "",
3786
3921
  organization: t.organization || "",
3787
3922
  application: t.application || "ifc-lite",
3788
3923
  filename: t.filename || "export.ifc"
3789
- }), d = new Set, u = new Map, f = new Map, p = [], g = [], h = new Map, y = new Map, E = new Set, C = new Map, T = new Set, $ = new Set;
3924
+ }), d = new Set, f = new Map, u = new Map, p = [], I = [], h = new Map, y = new Map, E = new Set, C = new Map, T = new Set, G = new Set;
3790
3925
  if (this.mutationView && t.applyMutations !== !1) {
3791
3926
  const b = this.mutationView.getMutations(), S = new Map, F = new Map;
3792
3927
  for (const _ of b){
3793
3928
  if (_.type === "UPDATE_ATTRIBUTE" && _.attributeName) {
3794
- d.add(_.entityId), f.has(_.entityId) || f.set(_.entityId, new Map), f.get(_.entityId).set(_.attributeName, _.newValue == null ? "" : String(_.newValue));
3929
+ d.add(_.entityId), u.has(_.entityId) || u.set(_.entityId, new Map), u.get(_.entityId).set(_.attributeName, _.newValue == null ? "" : String(_.newValue));
3795
3930
  continue;
3796
3931
  }
3797
3932
  if (!_.psetName) continue;
3798
- const I = _.type === "CREATE_QUANTITY" || _.type === "UPDATE_QUANTITY" || _.type === "DELETE_QUANTITY" ? F : S;
3799
- I.has(_.entityId) || I.set(_.entityId, new Set), I.get(_.entityId).add(_.psetName);
3933
+ const g = _.type === "CREATE_QUANTITY" || _.type === "UPDATE_QUANTITY" || _.type === "DELETE_QUANTITY" ? F : S;
3934
+ g.has(_.entityId) || g.set(_.entityId, new Set), g.get(_.entityId).add(_.psetName);
3800
3935
  }
3801
3936
  const m = this.buildRelDefinesByPropertiesIndex();
3802
3937
  for (const [_, w] of S){
3803
- d.add(_), u.set(_, w), s++;
3804
- const R = this.mutationView.getForEntity(_).filter((z)=>w.has(z.name)), N = new Set;
3938
+ d.add(_), f.set(_, w), s++;
3939
+ const R = this.mutationView.getForEntity(_).filter((V)=>w.has(V.name)), N = new Set;
3805
3940
  R.length > 0 && p.push({
3806
3941
  entityId: _,
3807
3942
  psets: R
3808
3943
  });
3809
- const V = m.get(_);
3810
- if (V) for (const { relId: z, psetId: W } of V){
3811
- const H = this.getPropertySetName(W);
3812
- if (H && N.add(H), H && w.has(H)) {
3813
- $.add(z), T.add(W);
3814
- const j = this.getPropertyIdsInSet(W);
3815
- for (const Q of j)T.add(Q);
3944
+ const $ = m.get(_);
3945
+ if ($) for (const { relId: V, psetId: z } of $){
3946
+ const Y = this.getPropertySetName(z);
3947
+ if (Y && N.add(Y), Y && w.has(Y)) {
3948
+ G.add(V), T.add(z);
3949
+ const H = this.getPropertyIdsInSet(z);
3950
+ for (const Q of H)T.add(Q);
3816
3951
  }
3817
3952
  }
3818
3953
  if (this.isTypeEntity(_)) {
3819
- const z = this.getTypeOwnedHasPropertySetIds(_), W = new Set;
3820
- for (const H of z){
3821
- const j = this.getPropertySetName(H);
3822
- if (!j || !w.has(j)) continue;
3823
- W.add(j), T.add(H);
3824
- const Q = this.getPropertyIdsInSet(H);
3825
- for (const K of Q)T.add(K);
3954
+ const V = this.getTypeOwnedHasPropertySetIds(_), z = new Set;
3955
+ for (const Y of V){
3956
+ const H = this.getPropertySetName(Y);
3957
+ if (!H || !w.has(H)) continue;
3958
+ z.add(H), T.add(Y);
3959
+ const Q = this.getPropertyIdsInSet(Y);
3960
+ for (const Z of Q)T.add(Z);
3826
3961
  }
3827
- for (const H of w)N.has(H) || W.add(H);
3828
- W.size > 0 && (h.set(_, W), y.set(_, z), E.add(_));
3962
+ for (const Y of w)N.has(Y) || z.add(Y);
3963
+ z.size > 0 && (h.set(_, z), y.set(_, V), E.add(_));
3829
3964
  }
3830
3965
  }
3831
3966
  t.includeQuantities === !1 && F.clear();
3832
3967
  for (const [_, w] of F){
3833
- d.add(_), u.has(_) || s++;
3834
- const R = this.mutationView.getQuantitiesForEntity(_).filter((V)=>w.has(V.name));
3835
- R.length > 0 && g.push({
3968
+ d.add(_), f.has(_) || s++;
3969
+ const R = this.mutationView.getQuantitiesForEntity(_).filter(($)=>w.has($.name));
3970
+ R.length > 0 && I.push({
3836
3971
  entityId: _,
3837
3972
  qsets: R
3838
3973
  });
3839
3974
  const N = m.get(_);
3840
- if (N) for (const { relId: V, psetId: z } of N){
3841
- const W = this.getElementQuantityName(z);
3842
- if (W && w.has(W)) {
3843
- $.add(V), T.add(z);
3844
- const H = this.getPropertyIdsInSet(z);
3845
- for (const j of H)T.add(j);
3975
+ if (N) for (const { relId: $, psetId: V } of N){
3976
+ const z = this.getElementQuantityName(V);
3977
+ if (z && w.has(z)) {
3978
+ G.add($), T.add(V);
3979
+ const Y = this.getPropertyIdsInSet(V);
3980
+ for (const H of Y)T.add(H);
3846
3981
  }
3847
3982
  }
3848
3983
  }
3849
- for (const [_] of f)!S.has(_) && !F.has(_) && s++;
3984
+ for (const [_] of u)!S.has(_) && !F.has(_) && s++;
3850
3985
  }
3851
3986
  const x = [];
3852
3987
  if (t.applyMutations !== !1 && t.georefMutations) {
3853
3988
  const b = t.georefMutations, S = this.dataStore.entityIndex.byType.get("IFCPROJECTEDCRS"), F = this.dataStore.entityIndex.byType.get("IFCMAPCONVERSION");
3854
3989
  if (b.projectedCRS && S?.length) {
3855
3990
  const m = S[0];
3856
- f.has(m) || f.set(m, new Map);
3857
- const _ = f.get(m), w = b.projectedCRS;
3858
- let I = !1;
3859
- if (w.name !== void 0 && (_.set("Name", String(w.name)), I = !0), w.description !== void 0 && (_.set("Description", String(w.description)), I = !0), w.geodeticDatum !== void 0 && (_.set("GeodeticDatum", String(w.geodeticDatum)), I = !0), w.verticalDatum !== void 0 && (_.set("VerticalDatum", String(w.verticalDatum)), I = !0), w.mapProjection !== void 0 && (_.set("MapProjection", String(w.mapProjection)), I = !0), w.mapZone !== void 0 && (_.set("MapZone", String(w.mapZone)), I = !0), w.mapUnit !== void 0) {
3991
+ u.has(m) || u.set(m, new Map);
3992
+ const _ = u.get(m), w = b.projectedCRS;
3993
+ let g = !1;
3994
+ if (w.name !== void 0 && (_.set("Name", String(w.name)), g = !0), w.description !== void 0 && (_.set("Description", String(w.description)), g = !0), w.geodeticDatum !== void 0 && (_.set("GeodeticDatum", String(w.geodeticDatum)), g = !0), w.verticalDatum !== void 0 && (_.set("VerticalDatum", String(w.verticalDatum)), g = !0), w.mapProjection !== void 0 && (_.set("MapProjection", String(w.mapProjection)), g = !0), w.mapZone !== void 0 && (_.set("MapZone", String(w.mapZone)), g = !0), w.mapUnit !== void 0) {
3860
3995
  const R = this.resolveMapUnitReference(String(w.mapUnit), x);
3861
- _.set("MapUnit", `#${R}`), I = !0;
3996
+ _.set("MapUnit", `#${R}`), g = !0;
3862
3997
  }
3863
- I && !d.has(m) && (d.add(m), s++);
3998
+ g && !d.has(m) && (d.add(m), s++);
3864
3999
  }
3865
4000
  if (b.mapConversion && F?.length) {
3866
4001
  const m = F[0];
3867
- f.has(m) || f.set(m, new Map);
3868
- const _ = f.get(m), w = b.mapConversion;
3869
- let I = !1;
3870
- w.eastings !== void 0 && (_.set("Eastings", String(w.eastings)), I = !0), w.northings !== void 0 && (_.set("Northings", String(w.northings)), I = !0), w.orthogonalHeight !== void 0 && (_.set("OrthogonalHeight", String(w.orthogonalHeight)), I = !0), w.xAxisAbscissa !== void 0 && (_.set("XAxisAbscissa", String(w.xAxisAbscissa)), I = !0), w.xAxisOrdinate !== void 0 && (_.set("XAxisOrdinate", String(w.xAxisOrdinate)), I = !0), w.scale !== void 0 && (_.set("Scale", String(w.scale)), I = !0), I && !d.has(m) && (d.add(m), s++);
4002
+ u.has(m) || u.set(m, new Map);
4003
+ const _ = u.get(m), w = b.mapConversion;
4004
+ let g = !1;
4005
+ w.eastings !== void 0 && (_.set("Eastings", String(w.eastings)), g = !0), w.northings !== void 0 && (_.set("Northings", String(w.northings)), g = !0), w.orthogonalHeight !== void 0 && (_.set("OrthogonalHeight", String(w.orthogonalHeight)), g = !0), w.xAxisAbscissa !== void 0 && (_.set("XAxisAbscissa", String(w.xAxisAbscissa)), g = !0), w.xAxisOrdinate !== void 0 && (_.set("XAxisOrdinate", String(w.xAxisOrdinate)), g = !0), w.scale !== void 0 && (_.set("Scale", String(w.scale)), g = !0), g && !d.has(m) && (d.add(m), s++);
3871
4006
  }
3872
4007
  if (b.projectedCRS && !S?.length) {
3873
- const m = b.projectedCRS, _ = this.nextExpressId++, w = m.name ? `'${st(String(m.name))}'` : "$", I = m.description ? `'${st(String(m.description))}'` : "$", R = m.geodeticDatum ? `'${st(String(m.geodeticDatum))}'` : "$", N = m.verticalDatum ? `'${st(String(m.verticalDatum))}'` : "$", V = m.mapProjection ? `'${st(String(m.mapProjection))}'` : "$", z = m.mapZone ? `'${st(String(m.mapZone))}'` : "$", W = m.mapUnit ? `#${this.resolveMapUnitReference(String(m.mapUnit), x)}` : "$";
3874
- x.push(`#${_}=IFCPROJECTEDCRS(${w},${I},${R},${N},${V},${z},${W});`), n++;
3875
- const H = this.findPreferredGeometricRepresentationContextId();
3876
- if (H) {
3877
- const j = b.mapConversion || {}, Q = this.nextExpressId++, K = Z(Number(j.eastings) || 0), at = Z(Number(j.northings) || 0), ht = Z(Number(j.orthogonalHeight) || 0), rt = j.xAxisAbscissa !== void 0 ? Z(Number(j.xAxisAbscissa)) : "$", dt = j.xAxisOrdinate !== void 0 ? Z(Number(j.xAxisOrdinate)) : "$", lt = j.scale !== void 0 ? Z(Number(j.scale)) : "$";
3878
- x.push(`#${Q}=IFCMAPCONVERSION(#${H},#${_},${K},${at},${ht},${rt},${dt},${lt});`), n++;
4008
+ const m = b.projectedCRS, _ = this.nextExpressId++, w = m.name ? `'${rt(String(m.name))}'` : "$", g = m.description ? `'${rt(String(m.description))}'` : "$", R = m.geodeticDatum ? `'${rt(String(m.geodeticDatum))}'` : "$", N = m.verticalDatum ? `'${rt(String(m.verticalDatum))}'` : "$", $ = m.mapProjection ? `'${rt(String(m.mapProjection))}'` : "$", V = m.mapZone ? `'${rt(String(m.mapZone))}'` : "$", z = m.mapUnit ? `#${this.resolveMapUnitReference(String(m.mapUnit), x)}` : "$";
4009
+ x.push(`#${_}=IFCPROJECTEDCRS(${w},${g},${R},${N},${$},${V},${z});`), n++;
4010
+ const Y = this.findPreferredGeometricRepresentationContextId();
4011
+ if (Y) {
4012
+ const H = b.mapConversion || {}, Q = this.nextExpressId++, Z = et(Number(H.eastings) || 0), L = et(Number(H.northings) || 0), j = et(Number(H.orthogonalHeight) || 0), X = H.xAxisAbscissa !== void 0 ? et(Number(H.xAxisAbscissa)) : "$", U = H.xAxisOrdinate !== void 0 ? et(Number(H.xAxisOrdinate)) : "$", q = H.scale !== void 0 ? et(Number(H.scale)) : "$";
4013
+ x.push(`#${Q}=IFCMAPCONVERSION(#${Y},#${_},${Z},${L},${j},${X},${U},${q});`), n++;
3879
4014
  } else console.warn("[StepExporter] Cannot create IfcMapConversion: no IfcGeometricRepresentationContext found in source file");
3880
4015
  } else if (b.mapConversion && !F?.length && S?.length) {
3881
4016
  const m = this.findPreferredGeometricRepresentationContextId();
3882
4017
  if (m) {
3883
- const _ = b.mapConversion, w = this.nextExpressId++, I = Z(Number(_.eastings) || 0), R = Z(Number(_.northings) || 0), N = Z(Number(_.orthogonalHeight) || 0), V = _.xAxisAbscissa !== void 0 ? Z(Number(_.xAxisAbscissa)) : "$", z = _.xAxisOrdinate !== void 0 ? Z(Number(_.xAxisOrdinate)) : "$", W = _.scale !== void 0 ? Z(Number(_.scale)) : "$";
3884
- x.push(`#${w}=IFCMAPCONVERSION(#${m},#${S[0]},${I},${R},${N},${V},${z},${W});`), n++;
4018
+ const _ = b.mapConversion, w = this.nextExpressId++, g = et(Number(_.eastings) || 0), R = et(Number(_.northings) || 0), N = et(Number(_.orthogonalHeight) || 0), $ = _.xAxisAbscissa !== void 0 ? et(Number(_.xAxisAbscissa)) : "$", V = _.xAxisOrdinate !== void 0 ? et(Number(_.xAxisOrdinate)) : "$", z = _.scale !== void 0 ? et(Number(_.scale)) : "$";
4019
+ x.push(`#${w}=IFCMAPCONVERSION(#${m},#${S[0]},${g},${R},${N},${$},${V},${z});`), n++;
3885
4020
  } else console.warn("[StepExporter] Cannot create IfcMapConversion: no IfcGeometricRepresentationContext found in source file");
3886
4021
  }
3887
4022
  }
3888
- const Y = this.mutationView && t.applyMutations !== !1 && typeof this.mutationView.getNewEntities == "function" ? this.mutationView.getNewEntities().length : 0;
3889
- if (t.deltaOnly && d.size === 0 && Y === 0 && x.length === 0) {
4023
+ const k = this.mutationView && t.applyMutations !== !1 && typeof this.mutationView.getNewEntities == "function" ? this.mutationView.getNewEntities().length : 0;
4024
+ if (t.deltaOnly && d.size === 0 && k === 0 && x.length === 0) {
3890
4025
  const b = new TextEncoder().encode(l + `DATA;
3891
4026
  ENDSEC;
3892
4027
  END-ISO-10303-21;
@@ -3903,22 +4038,22 @@ END-ISO-10303-21;
3903
4038
  }
3904
4039
  let O = null;
3905
4040
  if (t.visibleOnly && this.dataStore.source) {
3906
- const { roots: b, hiddenProductIds: S } = ce(this.dataStore, t.hiddenEntityIds ?? new Set, t.isolatedEntityIds ?? null);
3907
- O = ae(b, this.dataStore.source, this.dataStore.entityIndex.byId, S), le(O, this.dataStore.source, this.dataStore.entityIndex);
4041
+ const { roots: b, hiddenProductIds: S } = de(this.dataStore, t.hiddenEntityIds ?? new Set, t.isolatedEntityIds ?? null);
4042
+ O = le(b, this.dataStore.source, this.dataStore.entityIndex.byId, S), fe(O, this.dataStore.source, this.dataStore.entityIndex);
3908
4043
  }
3909
4044
  if (!t.deltaOnly && this.dataStore.source) {
3910
4045
  const b = this.dataStore.source, S = !!this.mutationView && t.applyMutations !== !1;
3911
4046
  for (const [F, m] of this.dataStore.entityIndex.byId){
3912
- if (S && typeof this.mutationView.isDeleted == "function" && this.mutationView.isDeleted(F) || m.byteLength === 0 || m.byteOffset < 0 || O !== null && !O.has(F) || T.has(F) || $.has(F) || E.has(F)) continue;
4047
+ if (S && typeof this.mutationView.isDeleted == "function" && this.mutationView.isDeleted(F) || m.byteLength === 0 || m.byteOffset < 0 || O !== null && !O.has(F) || T.has(F) || G.has(F) || E.has(F)) continue;
3913
4048
  const _ = m.type.toUpperCase();
3914
4049
  if (t.includeGeometry === !1 && this.isGeometryEntity(_)) continue;
3915
- const w = nt(b, m.byteOffset, m.byteOffset + m.byteLength);
3916
- let I = f.has(F) ? this.applyAttributeMutations(w, _, f.get(F)) : w;
4050
+ const w = it(b, m.byteOffset, m.byteOffset + m.byteLength);
4051
+ let g = u.has(F) ? this.applyAttributeMutations(w, _, u.get(F)) : w;
3917
4052
  const R = S && typeof this.mutationView.getPositionalMutationsForEntity == "function" ? this.mutationView.getPositionalMutationsForEntity(F) : null;
3918
- if (R && R.size > 0 && (I = this.applyPositionalMutations(I, R), d.has(F) || (d.add(F), s++)), c) {
3919
- const N = Xt(I, o, i);
4053
+ if (R && R.size > 0 && (g = this.applyPositionalMutations(g, R), d.has(F) || (d.add(F), s++)), c) {
4054
+ const N = Qt(g, o, i);
3920
4055
  N !== null && e.push(N);
3921
- } else e.push(I);
4056
+ } else e.push(g);
3922
4057
  }
3923
4058
  }
3924
4059
  for (const { entityId: b, psets: S } of p){
@@ -3935,7 +4070,7 @@ END-ISO-10303-21;
3935
4070
  const F = this.rewriteTypeEntityHasPropertySets(b, y.get(b) ?? [], S, new Map);
3936
4071
  F && C.set(b, F);
3937
4072
  }
3938
- for (const { entityId: b, qsets: S } of g){
4073
+ for (const { entityId: b, qsets: S } of I){
3939
4074
  const F = this.generateQuantitySetEntities(b, S);
3940
4075
  e.push(...F.lines), n += F.count;
3941
4076
  }
@@ -3944,20 +4079,20 @@ END-ISO-10303-21;
3944
4079
  if (this.mutationView && t.applyMutations !== !1 && typeof this.mutationView.getNewEntities == "function") for (const b of this.mutationView.getNewEntities()){
3945
4080
  const S = b.type.toUpperCase();
3946
4081
  if (t.includeGeometry === !1 && this.isGeometryEntity(S) || O !== null && !O.has(b.expressId)) continue;
3947
- const F = `#${b.expressId}=${S}(${Kn(b.attributes)});`;
4082
+ const F = `#${b.expressId}=${S}(${ns(b.attributes)});`;
3948
4083
  if (c) {
3949
- const m = Xt(F, o, i);
4084
+ const m = Qt(F, o, i);
3950
4085
  m !== null && (e.push(m), n++);
3951
4086
  } else e.push(F), n++;
3952
4087
  }
3953
- const v = es(l, e);
4088
+ const D = rs(l, e);
3954
4089
  return {
3955
- content: v,
4090
+ content: D,
3956
4091
  stats: {
3957
4092
  entityCount: e.length,
3958
4093
  newEntityCount: n,
3959
4094
  modifiedEntityCount: s,
3960
- fileSize: v.byteLength
4095
+ fileSize: D.byteLength
3961
4096
  }
3962
4097
  };
3963
4098
  }
@@ -3995,20 +4130,20 @@ END-ISO-10303-21;
3995
4130
  const o = new Map;
3996
4131
  for (const c of e){
3997
4132
  const l = [];
3998
- for (const g of c.properties){
4133
+ for (const I of c.properties){
3999
4134
  const h = this.nextExpressId++;
4000
4135
  i++;
4001
- const y = ze(g.value, g.type), E = g.unit ? this.findUnitId(g.unit) : null, C = E !== null ? Qe(E) : null, T = `#${h}=IFCPROPERTYSINGLEVALUE('${st(g.name)}',$,${y},${C ? Ue(C) : "$"});`;
4136
+ const y = ke(I.value, I.type), E = I.unit ? this.findUnitId(I.unit) : null, C = E !== null ? tn(E) : null, T = `#${h}=IFCPROPERTYSINGLEVALUE('${rt(I.name)}',$,${y},${C ? Ge(C) : "$"});`;
4002
4137
  s.push(T), l.push(h);
4003
4138
  }
4004
4139
  const d = this.nextExpressId++;
4005
4140
  i++;
4006
- const u = l.map((g)=>`#${g}`).join(","), f = this.generateGlobalId(), p = `#${d}=IFCPROPERTYSET('${f}',$,'${st(c.name)}',$,(${u}));`;
4141
+ const f = l.map((I)=>`#${I}`).join(","), u = this.generateGlobalId(), p = `#${d}=IFCPROPERTYSET('${u}',$,'${rt(c.name)}',$,(${f}));`;
4007
4142
  if (s.push(p), n?.has(c.name)) o.set(c.name, d);
4008
4143
  else {
4009
- const g = this.nextExpressId++;
4144
+ const I = this.nextExpressId++;
4010
4145
  i++;
4011
- const h = this.generateGlobalId(), y = `#${g}=IFCRELDEFINESBYPROPERTIES('${h}',$,$,$,(#${t}),#${d});`;
4146
+ const h = this.generateGlobalId(), y = `#${I}=IFCRELDEFINESBYPROPERTIES('${h}',$,$,$,(#${t}),#${d});`;
4012
4147
  s.push(y);
4013
4148
  }
4014
4149
  }
@@ -4026,17 +4161,17 @@ END-ISO-10303-21;
4026
4161
  for (const h of i.quantities){
4027
4162
  const y = this.nextExpressId++;
4028
4163
  s++;
4029
- const E = Qn(h.type), C = Z(h.value), T = `#${y}=${E}('${st(h.name)}',$,$,${C},$);`;
4164
+ const E = ts(h.type), C = et(h.value), T = `#${y}=${E}('${rt(h.name)}',$,$,${C},$);`;
4030
4165
  n.push(T), o.push(y);
4031
4166
  }
4032
4167
  const c = this.nextExpressId++;
4033
4168
  s++;
4034
- const l = o.map((h)=>`#${h}`).join(","), d = this.generateGlobalId(), u = `#${c}=IFCELEMENTQUANTITY('${d}',$,'${st(i.name)}',$,$,(${l}));`;
4035
- n.push(u);
4036
- const f = this.nextExpressId++;
4169
+ const l = o.map((h)=>`#${h}`).join(","), d = this.generateGlobalId(), f = `#${c}=IFCELEMENTQUANTITY('${d}',$,'${rt(i.name)}',$,$,(${l}));`;
4170
+ n.push(f);
4171
+ const u = this.nextExpressId++;
4037
4172
  s++;
4038
- const p = this.generateGlobalId(), g = `#${f}=IFCRELDEFINESBYPROPERTIES('${p}',$,$,$,(#${t}),#${c});`;
4039
- n.push(g);
4173
+ const p = this.generateGlobalId(), I = `#${u}=IFCRELDEFINESBYPROPERTIES('${p}',$,$,$,(#${t}),#${c});`;
4174
+ n.push(I);
4040
4175
  }
4041
4176
  return {
4042
4177
  lines: n,
@@ -4046,22 +4181,22 @@ END-ISO-10303-21;
4046
4181
  applyAttributeMutations(t, e, n) {
4047
4182
  const s = t.indexOf("("), i = t.lastIndexOf(");");
4048
4183
  if (s < 0 || i < s) return t;
4049
- const o = Xe(e);
4184
+ const o = Ke(e);
4050
4185
  if (o.length === 0) return t;
4051
- const c = Me(t.slice(s + 1, i));
4186
+ const c = Ue(t.slice(s + 1, i));
4052
4187
  let l = !1;
4053
- for (const [d, u] of n){
4054
- const f = o.indexOf(d);
4055
- f < 0 || f >= c.length || (c[f] = Jn(u, c[f]), l = !0);
4188
+ for (const [d, f] of n){
4189
+ const u = o.indexOf(d);
4190
+ u < 0 || u >= c.length || (c[u] = es(f, c[u]), l = !0);
4056
4191
  }
4057
4192
  return l ? `${t.slice(0, s + 1)}${c.join(",")}${t.slice(i)}` : t;
4058
4193
  }
4059
4194
  applyPositionalMutations(t, e) {
4060
4195
  const n = t.indexOf("("), s = t.lastIndexOf(");");
4061
4196
  if (n < 0 || s < n) return t;
4062
- const i = Me(t.slice(n + 1, s));
4197
+ const i = Ue(t.slice(n + 1, s));
4063
4198
  let o = !1;
4064
- for (const [c, l] of e)c < 0 || c >= i.length || (i[c] = fe(l), o = !0);
4199
+ for (const [c, l] of e)c < 0 || c >= i.length || (i[c] = he(l), o = !0);
4065
4200
  return o ? `${t.slice(0, n + 1)}${i.join(",")}${t.slice(s)}` : t;
4066
4201
  }
4067
4202
  resolveMapUnitReference(t, e) {
@@ -4072,8 +4207,8 @@ END-ISO-10303-21;
4072
4207
  return e.push(`#${o}=IFCSIUNIT(*,.LENGTHUNIT.,$,.METRE.);`), o;
4073
4208
  }
4074
4209
  if (n === "FOOT" || n === "US SURVEY FOOT") {
4075
- const o = this.nextExpressId++, c = this.nextExpressId++, l = this.nextExpressId++, d = this.nextExpressId++, u = n === "US SURVEY FOOT" ? 1200 / 3937 : .3048, f = n === "US SURVEY FOOT" ? "US SURVEY FOOT" : "FOOT";
4076
- return e.push(`#${o}=IFCDIMENSIONALEXPONENTS(1,0,0,0,0,0,0);`), e.push(`#${c}=IFCSIUNIT(*,.LENGTHUNIT.,$,.METRE.);`), e.push(`#${l}=IFCMEASUREWITHUNIT(IFCLENGTHMEASURE(${Z(u)}),#${c});`), e.push(`#${d}=IFCCONVERSIONBASEDUNIT(#${o},.LENGTHUNIT.,'${f}',#${l});`), d;
4210
+ const o = this.nextExpressId++, c = this.nextExpressId++, l = this.nextExpressId++, d = this.nextExpressId++, f = n === "US SURVEY FOOT" ? 1200 / 3937 : .3048, u = n === "US SURVEY FOOT" ? "US SURVEY FOOT" : "FOOT";
4211
+ return e.push(`#${o}=IFCDIMENSIONALEXPONENTS(1,0,0,0,0,0,0);`), e.push(`#${c}=IFCSIUNIT(*,.LENGTHUNIT.,$,.METRE.);`), e.push(`#${l}=IFCMEASUREWITHUNIT(IFCLENGTHMEASURE(${et(f)}),#${c});`), e.push(`#${d}=IFCCONVERSIONBASEDUNIT(#${o},.LENGTHUNIT.,'${u}',#${l});`), d;
4077
4212
  }
4078
4213
  const i = this.nextExpressId++;
4079
4214
  return e.push(`#${i}=IFCSIUNIT(*,.LENGTHUNIT.,$,.METRE.);`), i;
@@ -4090,15 +4225,15 @@ END-ISO-10303-21;
4090
4225
  if (!Array.isArray(l)) return null;
4091
4226
  for (const d of l){
4092
4227
  if (typeof d != "number") continue;
4093
- const u = this.dataStore.entityIndex.byId.get(d), f = u ? this.entityExtractor.extractEntity(u) : null;
4094
- if (!f) continue;
4095
- const p = f.type.toUpperCase(), g = f.attributes ?? [];
4096
- if ((typeof g[1] == "string" ? g[1].replace(/\./g, "").toUpperCase() : "") === "LENGTHUNIT") {
4228
+ const f = this.dataStore.entityIndex.byId.get(d), u = f ? this.entityExtractor.extractEntity(f) : null;
4229
+ if (!u) continue;
4230
+ const p = u.type.toUpperCase(), I = u.attributes ?? [];
4231
+ if ((typeof I[1] == "string" ? I[1].replace(/\./g, "").toUpperCase() : "") === "LENGTHUNIT") {
4097
4232
  if (p === "IFCSIUNIT") {
4098
- const y = typeof g[2] == "string" ? g[2].replace(/\./g, "").toUpperCase() : "", E = typeof g[3] == "string" ? g[3].replace(/\./g, "").toUpperCase() : "", C = y ? `${y}${E}` : E;
4233
+ const y = typeof I[2] == "string" ? I[2].replace(/\./g, "").toUpperCase() : "", E = typeof I[3] == "string" ? I[3].replace(/\./g, "").toUpperCase() : "", C = y ? `${y}${E}` : E;
4099
4234
  if (t === "METRE" && (C === "METRE" || C === "METER")) return d;
4100
4235
  }
4101
- if (p === "IFCCONVERSIONBASEDUNIT" && (typeof g[2] == "string" ? this.normalizeMapUnitName(g[2]) : "") === t) return d;
4236
+ if (p === "IFCCONVERSIONBASEDUNIT" && (typeof I[2] == "string" ? this.normalizeMapUnitName(I[2]) : "") === t) return d;
4102
4237
  }
4103
4238
  }
4104
4239
  return null;
@@ -4116,7 +4251,7 @@ END-ISO-10303-21;
4116
4251
  return e ?? t[0] ?? null;
4117
4252
  }
4118
4253
  generateGlobalId() {
4119
- return qe();
4254
+ return Ze();
4120
4255
  }
4121
4256
  findMaxExpressId() {
4122
4257
  let t = 0;
@@ -4179,7 +4314,7 @@ END-ISO-10303-21;
4179
4314
  getRelatedEntities(t) {
4180
4315
  const e = this.dataStore.entityIndex.byId.get(t);
4181
4316
  if (!e || !this.dataStore.source) return [];
4182
- const s = nt(this.dataStore.source, e.byteOffset, e.byteOffset + e.byteLength).match(/\(([^)]+)\)\s*,\s*#(\d+)\s*\)\s*;/);
4317
+ const s = it(this.dataStore.source, e.byteOffset, e.byteOffset + e.byteLength).match(/\(([^)]+)\)\s*,\s*#(\d+)\s*\)\s*;/);
4183
4318
  if (!s) return [];
4184
4319
  const i = s[1], o = [], c = i.matchAll(/#(\d+)/g);
4185
4320
  for (const l of c)o.push(parseInt(l[1], 10));
@@ -4188,25 +4323,25 @@ END-ISO-10303-21;
4188
4323
  getRelatedPropertySet(t) {
4189
4324
  const e = this.dataStore.entityIndex.byId.get(t);
4190
4325
  if (!e || !this.dataStore.source) return null;
4191
- const s = nt(this.dataStore.source, e.byteOffset, e.byteOffset + e.byteLength).match(/,\s*#(\d+)\s*\)\s*;$/);
4326
+ const s = it(this.dataStore.source, e.byteOffset, e.byteOffset + e.byteLength).match(/,\s*#(\d+)\s*\)\s*;$/);
4192
4327
  return s ? parseInt(s[1], 10) : null;
4193
4328
  }
4194
4329
  getPropertySetName(t) {
4195
4330
  const e = this.dataStore.entityIndex.byId.get(t);
4196
4331
  if (!e || !this.dataStore.source) return null;
4197
- const s = nt(this.dataStore.source, e.byteOffset, e.byteOffset + e.byteLength).match(/IFCPROPERTYSET\s*\([^,]*,[^,]*,'([^']*)'/i);
4332
+ const s = it(this.dataStore.source, e.byteOffset, e.byteOffset + e.byteLength).match(/IFCPROPERTYSET\s*\([^,]*,[^,]*,'([^']*)'/i);
4198
4333
  return s ? s[1] : null;
4199
4334
  }
4200
4335
  getElementQuantityName(t) {
4201
4336
  const e = this.dataStore.entityIndex.byId.get(t);
4202
4337
  if (!e || !this.dataStore.source) return null;
4203
- const s = nt(this.dataStore.source, e.byteOffset, e.byteOffset + e.byteLength).match(/IFCELEMENTQUANTITY\s*\([^,]*,[^,]*,'([^']*)'/i);
4338
+ const s = it(this.dataStore.source, e.byteOffset, e.byteOffset + e.byteLength).match(/IFCELEMENTQUANTITY\s*\([^,]*,[^,]*,'([^']*)'/i);
4204
4339
  return s ? s[1] : null;
4205
4340
  }
4206
4341
  getPropertyIdsInSet(t) {
4207
4342
  const e = this.dataStore.entityIndex.byId.get(t);
4208
4343
  if (!e || !this.dataStore.source) return [];
4209
- const s = nt(this.dataStore.source, e.byteOffset, e.byteOffset + e.byteLength).match(/\(\s*(#[^)]+)\s*\)\s*\)\s*;$/);
4344
+ const s = it(this.dataStore.source, e.byteOffset, e.byteOffset + e.byteLength).match(/\(\s*(#[^)]+)\s*\)\s*\)\s*;$/);
4210
4345
  if (!s) return [];
4211
4346
  const i = s[1], o = [], c = i.matchAll(/#(\d+)/g);
4212
4347
  for (const l of c)o.push(parseInt(l[1], 10));
@@ -4227,8 +4362,8 @@ END-ISO-10303-21;
4227
4362
  for (const l of e){
4228
4363
  const d = this.getPropertySetName(l);
4229
4364
  if (d && n.has(d)) {
4230
- const u = s.get(d);
4231
- u !== void 0 && (i.push(u), o.add(d));
4365
+ const f = s.get(d);
4366
+ f !== void 0 && (i.push(f), o.add(d));
4232
4367
  continue;
4233
4368
  }
4234
4369
  i.push(l);
@@ -4240,20 +4375,20 @@ END-ISO-10303-21;
4240
4375
  replaceEntityAttribute(t, e, n) {
4241
4376
  const s = this.dataStore.entityIndex.byId.get(t);
4242
4377
  if (!s || !this.dataStore.source) return null;
4243
- const o = nt(this.dataStore.source, s.byteOffset, s.byteOffset + s.byteLength).match(/^(#\d+\s*=\s*\w+\()([\s\S]*)(\)\s*;)\s*$/);
4378
+ const o = it(this.dataStore.source, s.byteOffset, s.byteOffset + s.byteLength).match(/^(#\d+\s*=\s*\w+\()([\s\S]*)(\)\s*;)\s*$/);
4244
4379
  if (!o) return null;
4245
- const [, c, l, d] = o, u = Zn(l);
4246
- return e >= u.length ? null : (u[e] = n, `${c}${u.join(",")}${d}`);
4380
+ const [, c, l, d] = o, f = ss(l);
4381
+ return e >= f.length ? null : (f[e] = n, `${c}${f.join(",")}${d}`);
4247
4382
  }
4248
4383
  };
4249
- fs = function(r, t) {
4250
- const n = new ts(r).export({
4384
+ gs = function(r, t) {
4385
+ const n = new is(r).export({
4251
4386
  schema: "IFC4",
4252
4387
  ...t
4253
4388
  });
4254
4389
  return new TextDecoder().decode(n.content);
4255
4390
  };
4256
- function es(r, t) {
4391
+ function rs(r, t) {
4257
4392
  const e = new TextEncoder, n = e.encode(`${r}DATA;
4258
4393
  `), s = e.encode(`ENDSEC;
4259
4394
  END-ISO-10303-21;
@@ -4261,26 +4396,26 @@ END-ISO-10303-21;
4261
4396
  `);
4262
4397
  let o = n.byteLength + s.byteLength;
4263
4398
  const c = new Array(t.length);
4264
- for(let u = 0; u < t.length; u++)c[u] = e.encode(t[u]), o += c[u].byteLength + i.byteLength;
4399
+ for(let f = 0; f < t.length; f++)c[f] = e.encode(t[f]), o += c[f].byteLength + i.byteLength;
4265
4400
  const l = new Uint8Array(o);
4266
4401
  let d = 0;
4267
4402
  l.set(n, d), d += n.byteLength;
4268
- for(let u = 0; u < c.length; u++)l.set(c[u], d), d += c[u].byteLength, l.set(i, d), d += i.byteLength;
4403
+ for(let f = 0; f < c.length; f++)l.set(c[f], d), d += c[f].byteLength, l.set(i, d), d += i.byteLength;
4269
4404
  return l.set(s, d), l;
4270
4405
  }
4271
- const ns = /#(\d+)/g, ss = new Set([
4406
+ const os = new Set([
4272
4407
  "IFCUNITASSIGNMENT",
4273
4408
  "IFCGEOMETRICREPRESENTATIONCONTEXT",
4274
4409
  "IFCGEOMETRICREPRESENTATIONSUBCONTEXT"
4275
4410
  ]);
4276
- us = class {
4411
+ _s = class {
4277
4412
  models;
4278
4413
  constructor(t){
4279
4414
  if (t.length === 0) throw new Error("MergedExporter requires at least one model");
4280
4415
  this.models = t;
4281
4416
  }
4282
4417
  export(t) {
4283
- const e = t.onProgress, n = t.schema || "IFC4", s = se({
4418
+ const e = t.onProgress, n = t.schema || "IFC4", s = re({
4284
4419
  schema: n,
4285
4420
  description: t.description || `Merged export of ${this.models.length} models from ifc-lite`,
4286
4421
  author: t.author || "",
@@ -4296,39 +4431,39 @@ END-ISO-10303-21;
4296
4431
  for (const [C] of y.dataStore.entityIndex.byId)C > E && (E = C);
4297
4432
  o += E;
4298
4433
  }
4299
- const l = this.models[0], d = c.get(l.id), u = this.findInfrastructureEntities(l.dataStore), f = this.findEntitiesByType(l.dataStore, "IFCPROJECT"), p = this.buildSpatialLookup(l.dataStore);
4300
- let g = !0;
4434
+ const l = this.models[0], d = c.get(l.id), f = this.findInfrastructureEntities(l.dataStore), u = this.findEntitiesByType(l.dataStore, "IFCPROJECT"), p = this.buildSpatialLookup(l.dataStore);
4435
+ let I = !0;
4301
4436
  for (const y of this.models){
4302
4437
  const E = c.get(y.id), C = y.dataStore.source;
4303
4438
  if (!C || C.length === 0) continue;
4304
4439
  let T = null;
4305
4440
  if (t.visibleOnly) {
4306
- const Y = t.hiddenEntityIdsByModel?.get(y.id) ?? new Set, O = t.isolatedEntityIdsByModel?.get(y.id) ?? null, { roots: v, hiddenProductIds: b } = ce(y.dataStore, Y, O);
4307
- T = ae(v, C, y.dataStore.entityIndex.byId, b), le(T, C, y.dataStore.entityIndex);
4441
+ const k = t.hiddenEntityIdsByModel?.get(y.id) ?? new Set, O = t.isolatedEntityIdsByModel?.get(y.id) ?? null, { roots: D, hiddenProductIds: b } = de(y.dataStore, k, O);
4442
+ T = le(D, C, y.dataStore.entityIndex.byId, b), fe(T, C, y.dataStore.entityIndex);
4308
4443
  }
4309
- const $ = new Map, x = new Set;
4310
- if (!g) {
4311
- const Y = this.findEntitiesByType(y.dataStore, "IFCPROJECT");
4312
- if (f.length > 0) for (const v of Y)$.set(v, f[0] + d), x.add(v);
4444
+ const G = new Map, x = new Set;
4445
+ if (!I) {
4446
+ const k = this.findEntitiesByType(y.dataStore, "IFCPROJECT");
4447
+ if (u.length > 0) for (const D of k)G.set(D, u[0] + d), x.add(D);
4313
4448
  const O = this.findInfrastructureEntities(y.dataStore);
4314
- for (const [v, b] of u){
4315
- const S = O.get(v);
4316
- S && b.length > 0 && S.length > 0 && ($.set(S[0], b[0] + d), x.add(S[0]));
4449
+ for (const [D, b] of f){
4450
+ const S = O.get(D);
4451
+ S && b.length > 0 && S.length > 0 && (G.set(S[0], b[0] + d), x.add(S[0]));
4317
4452
  }
4318
- this.unifySpatialEntities(y.dataStore, p, d, $, x), this.skipRedundantRelAggregates(y.dataStore, $, x);
4453
+ this.unifySpatialEntities(y.dataStore, p, d, G, x), this.skipRedundantRelAggregates(y.dataStore, G, x);
4319
4454
  }
4320
- for (const [Y, O] of y.dataStore.entityIndex.byId){
4321
- if (T !== null && !T.has(Y) || x.has(Y)) continue;
4322
- const v = nt(C, O.byteOffset, O.byteOffset + O.byteLength);
4455
+ for (const [k, O] of y.dataStore.entityIndex.byId){
4456
+ if (T !== null && !T.has(k) || x.has(k)) continue;
4457
+ const D = it(C, O.byteOffset, O.byteOffset + O.byteLength);
4323
4458
  let b;
4324
- E === 0 && $.size === 0 ? b = v : b = this.remapEntityText(v, E, $);
4459
+ E === 0 && G.size === 0 ? b = D : b = this.remapEntityText(D, E, G);
4325
4460
  const S = y.dataStore.schemaVersion || "IFC4";
4326
- if (de(S, n)) {
4327
- const F = Xt(b, S, n);
4461
+ if (ue(S, n)) {
4462
+ const F = Qt(b, S, n);
4328
4463
  F !== null && i.push(F);
4329
4464
  } else i.push(b);
4330
4465
  }
4331
- g = !1;
4466
+ I = !1;
4332
4467
  }
4333
4468
  e && e({
4334
4469
  phase: "assembling",
@@ -4336,7 +4471,7 @@ END-ISO-10303-21;
4336
4471
  entitiesProcessed: i.length,
4337
4472
  entitiesTotal: i.length
4338
4473
  });
4339
- const h = Pe(s, i);
4474
+ const h = ve(s, i);
4340
4475
  return {
4341
4476
  content: h,
4342
4477
  stats: {
@@ -4347,7 +4482,7 @@ END-ISO-10303-21;
4347
4482
  };
4348
4483
  }
4349
4484
  async exportAsync(t) {
4350
- const e = t.onProgress, n = t.schema || "IFC4", s = se({
4485
+ const e = t.onProgress, n = t.schema || "IFC4", s = re({
4351
4486
  schema: n,
4352
4487
  description: t.description || `Merged export of ${this.models.length} models from ifc-lite`,
4353
4488
  author: t.author || "",
@@ -4361,11 +4496,11 @@ END-ISO-10303-21;
4361
4496
  const l = new Map;
4362
4497
  for (const T of this.models){
4363
4498
  l.set(T.id, c - 1);
4364
- let $ = 0;
4365
- for (const [x] of T.dataStore.entityIndex.byId)x > $ && ($ = x);
4366
- c += $;
4499
+ let G = 0;
4500
+ for (const [x] of T.dataStore.entityIndex.byId)x > G && (G = x);
4501
+ c += G;
4367
4502
  }
4368
- const d = this.models[0], u = l.get(d.id), f = this.findInfrastructureEntities(d.dataStore), p = this.findEntitiesByType(d.dataStore, "IFCPROJECT"), g = this.buildSpatialLookup(d.dataStore);
4503
+ const d = this.models[0], f = l.get(d.id), u = this.findInfrastructureEntities(d.dataStore), p = this.findEntitiesByType(d.dataStore, "IFCPROJECT"), I = this.buildSpatialLookup(d.dataStore);
4369
4504
  let h = !0, y = 0;
4370
4505
  const E = 2e3;
4371
4506
  e && e({
@@ -4375,7 +4510,7 @@ END-ISO-10303-21;
4375
4510
  entitiesTotal: o
4376
4511
  });
4377
4512
  for (const T of this.models){
4378
- const $ = l.get(T.id), x = T.dataStore.source;
4513
+ const G = l.get(T.id), x = T.dataStore.source;
4379
4514
  if (!x || x.length === 0) continue;
4380
4515
  e && e({
4381
4516
  phase: "entities",
@@ -4384,32 +4519,32 @@ END-ISO-10303-21;
4384
4519
  entitiesTotal: o,
4385
4520
  currentModel: T.name
4386
4521
  });
4387
- let Y = null;
4522
+ let k = null;
4388
4523
  if (t.visibleOnly) {
4389
- const S = t.hiddenEntityIdsByModel?.get(T.id) ?? new Set, F = t.isolatedEntityIdsByModel?.get(T.id) ?? null, { roots: m, hiddenProductIds: _ } = ce(T.dataStore, S, F);
4390
- Y = ae(m, x, T.dataStore.entityIndex.byId, _), le(Y, x, T.dataStore.entityIndex);
4524
+ const S = t.hiddenEntityIdsByModel?.get(T.id) ?? new Set, F = t.isolatedEntityIdsByModel?.get(T.id) ?? null, { roots: m, hiddenProductIds: _ } = de(T.dataStore, S, F);
4525
+ k = le(m, x, T.dataStore.entityIndex.byId, _), fe(k, x, T.dataStore.entityIndex);
4391
4526
  }
4392
- const O = new Map, v = new Set;
4527
+ const O = new Map, D = new Set;
4393
4528
  if (!h) {
4394
4529
  const S = this.findEntitiesByType(T.dataStore, "IFCPROJECT");
4395
- if (p.length > 0) for (const m of S)O.set(m, p[0] + u), v.add(m);
4530
+ if (p.length > 0) for (const m of S)O.set(m, p[0] + f), D.add(m);
4396
4531
  const F = this.findInfrastructureEntities(T.dataStore);
4397
- for (const [m, _] of f){
4532
+ for (const [m, _] of u){
4398
4533
  const w = F.get(m);
4399
- w && _.length > 0 && w.length > 0 && (O.set(w[0], _[0] + u), v.add(w[0]));
4534
+ w && _.length > 0 && w.length > 0 && (O.set(w[0], _[0] + f), D.add(w[0]));
4400
4535
  }
4401
- this.unifySpatialEntities(T.dataStore, g, u, O, v), this.skipRedundantRelAggregates(T.dataStore, O, v);
4536
+ this.unifySpatialEntities(T.dataStore, I, f, O, D), this.skipRedundantRelAggregates(T.dataStore, O, D);
4402
4537
  }
4403
4538
  let b = 0;
4404
4539
  for (const [S, F] of T.dataStore.entityIndex.byId){
4405
- if (Y !== null && !Y.has(S) || v.has(S)) continue;
4406
- const m = nt(x, F.byteOffset, F.byteOffset + F.byteLength);
4540
+ if (k !== null && !k.has(S) || D.has(S)) continue;
4541
+ const m = it(x, F.byteOffset, F.byteOffset + F.byteLength);
4407
4542
  let _;
4408
- $ === 0 && O.size === 0 ? _ = m : _ = this.remapEntityText(m, $, O);
4543
+ G === 0 && O.size === 0 ? _ = m : _ = this.remapEntityText(m, G, O);
4409
4544
  const w = T.dataStore.schemaVersion || "IFC4";
4410
- if (de(w, n)) {
4411
- const I = Xt(_, w, n);
4412
- I !== null && i.push(I);
4545
+ if (ue(w, n)) {
4546
+ const g = Qt(_, w, n);
4547
+ g !== null && i.push(g);
4413
4548
  } else i.push(_);
4414
4549
  b++, y++, b % E === 0 && (e && e({
4415
4550
  phase: "entities",
@@ -4417,7 +4552,7 @@ END-ISO-10303-21;
4417
4552
  entitiesProcessed: y,
4418
4553
  entitiesTotal: o,
4419
4554
  currentModel: T.name
4420
- }), await new Promise((I)=>setTimeout(I, 0)));
4555
+ }), await new Promise((g)=>setTimeout(g, 0)));
4421
4556
  }
4422
4557
  h = !1;
4423
4558
  }
@@ -4427,7 +4562,7 @@ END-ISO-10303-21;
4427
4562
  entitiesProcessed: o,
4428
4563
  entitiesTotal: o
4429
4564
  }), await new Promise((T)=>setTimeout(T, 0));
4430
- const C = Pe(s, i);
4565
+ const C = ve(s, i);
4431
4566
  return e && e({
4432
4567
  phase: "assembling",
4433
4568
  percent: 1,
@@ -4443,14 +4578,35 @@ END-ISO-10303-21;
4443
4578
  };
4444
4579
  }
4445
4580
  remapEntityText(t, e, n) {
4446
- return t.replace(ns, (s, i)=>{
4447
- const o = parseInt(i, 10), c = n.get(o);
4448
- return c !== void 0 ? `#${c}` : `#${o + e}`;
4449
- });
4581
+ const s = (c)=>{
4582
+ const l = n.get(c);
4583
+ return l !== void 0 ? `#${l}` : `#${c + e}`;
4584
+ };
4585
+ let i = "", o = !1;
4586
+ for(let c = 0; c < t.length; c++){
4587
+ const l = t[c];
4588
+ if (o) {
4589
+ i += l, l === "'" && (t[c + 1] === "'" ? (i += t[c + 1], c++) : o = !1);
4590
+ continue;
4591
+ }
4592
+ if (l === "'") {
4593
+ o = !0, i += l;
4594
+ continue;
4595
+ }
4596
+ if (l === "#" && t[c + 1] >= "0" && t[c + 1] <= "9") {
4597
+ let d = c + 1;
4598
+ for(; d < t.length && t[d] >= "0" && t[d] <= "9";)d++;
4599
+ const f = parseInt(t.slice(c + 1, d), 10);
4600
+ i += s(f), c = d - 1;
4601
+ continue;
4602
+ }
4603
+ i += l;
4604
+ }
4605
+ return i;
4450
4606
  }
4451
4607
  findInfrastructureEntities(t) {
4452
4608
  const e = new Map;
4453
- for (const n of ss){
4609
+ for (const n of os){
4454
4610
  const s = t.entityIndex.byType.get(n) ?? [];
4455
4611
  s.length > 0 && e.set(n, [
4456
4612
  ...s
@@ -4494,36 +4650,36 @@ END-ISO-10303-21;
4494
4650
  unifySpatialEntities(t, e, n, s, i) {
4495
4651
  const o = this.findEntitiesByType(t, "IFCSITE");
4496
4652
  for (const d of o){
4497
- const u = this.extractEntityName(d, t);
4498
- let f;
4499
- u && (f = e.sitesByName.get(u.toLowerCase())), f === void 0 && o.length === 1 && e.siteIds.length === 1 && (f = e.siteIds[0]), f !== void 0 && (s.set(d, f + n), i.add(d));
4653
+ const f = this.extractEntityName(d, t);
4654
+ let u;
4655
+ f && (u = e.sitesByName.get(f.toLowerCase())), u === void 0 && o.length === 1 && e.siteIds.length === 1 && (u = e.siteIds[0]), u !== void 0 && (s.set(d, u + n), i.add(d));
4500
4656
  }
4501
4657
  const c = this.findEntitiesByType(t, "IFCBUILDING");
4502
4658
  for (const d of c){
4503
- const u = this.extractEntityName(d, t);
4504
- let f;
4505
- u && (f = e.buildingsByName.get(u.toLowerCase())), f === void 0 && c.length === 1 && e.buildingIds.length === 1 && (f = e.buildingIds[0]), f !== void 0 && (s.set(d, f + n), i.add(d));
4659
+ const f = this.extractEntityName(d, t);
4660
+ let u;
4661
+ f && (u = e.buildingsByName.get(f.toLowerCase())), u === void 0 && c.length === 1 && e.buildingIds.length === 1 && (u = e.buildingIds[0]), u !== void 0 && (s.set(d, u + n), i.add(d));
4506
4662
  }
4507
4663
  const l = new Set;
4508
4664
  for (const d of this.findEntitiesByType(t, "IFCBUILDINGSTOREY")){
4509
- const u = this.extractEntityName(d, t);
4510
- let f;
4511
- if (u) {
4512
- const p = e.storeysByName.get(u.toLowerCase());
4513
- p !== void 0 && !l.has(p) && (f = p);
4665
+ const f = this.extractEntityName(d, t);
4666
+ let u;
4667
+ if (f) {
4668
+ const p = e.storeysByName.get(f.toLowerCase());
4669
+ p !== void 0 && !l.has(p) && (u = p);
4514
4670
  }
4515
- if (f === void 0) {
4671
+ if (u === void 0) {
4516
4672
  const p = this.extractStoreyElevation(d, t);
4517
- if (p !== void 0) for (const g of e.storeysByElevation){
4518
- if (l.has(g.expressId)) continue;
4519
- const h = Math.max(.5, Math.abs(g.elevation) * .01);
4520
- if (Math.abs(p - g.elevation) <= h) {
4521
- f = g.expressId;
4673
+ if (p !== void 0) for (const I of e.storeysByElevation){
4674
+ if (l.has(I.expressId)) continue;
4675
+ const h = Math.max(.5, Math.abs(I.elevation) * .01);
4676
+ if (Math.abs(p - I.elevation) <= h) {
4677
+ u = I.expressId;
4522
4678
  break;
4523
4679
  }
4524
4680
  }
4525
4681
  }
4526
- f !== void 0 && (l.add(f), s.set(d, f + n), i.add(d));
4682
+ u !== void 0 && (l.add(u), s.set(d, u + n), i.add(d));
4527
4683
  }
4528
4684
  }
4529
4685
  skipRedundantRelAggregates(t, e, n) {
@@ -4535,9 +4691,9 @@ END-ISO-10303-21;
4535
4691
  const c = this.extractStepAttribute(s, t, 5);
4536
4692
  if (!c) continue;
4537
4693
  const l = [], d = /#(\d+)/g;
4538
- let u;
4539
- for(; (u = d.exec(c)) !== null;)l.push(parseInt(u[1], 10));
4540
- l.length !== 0 && l.every((f)=>e.has(f)) && n.add(s);
4694
+ let f;
4695
+ for(; (f = d.exec(c)) !== null;)l.push(parseInt(f[1], 10));
4696
+ l.length !== 0 && l.every((u)=>e.has(u)) && n.add(s);
4541
4697
  }
4542
4698
  }
4543
4699
  extractEntityName(t, e) {
@@ -4545,7 +4701,7 @@ END-ISO-10303-21;
4545
4701
  if (!n || n === "$") return null;
4546
4702
  if (n.startsWith("'") && n.endsWith("'")) {
4547
4703
  const s = n.slice(1, -1).replace(/''/g, "'");
4548
- return Je(s);
4704
+ return en(s);
4549
4705
  }
4550
4706
  return null;
4551
4707
  }
@@ -4560,33 +4716,33 @@ END-ISO-10303-21;
4560
4716
  if (!s) return null;
4561
4717
  const i = e.entityIndex.byId.get(t);
4562
4718
  if (!i) return null;
4563
- const o = nt(s, i.byteOffset, i.byteOffset + i.byteLength), c = o.indexOf("(");
4719
+ const o = it(s, i.byteOffset, i.byteOffset + i.byteLength), c = o.indexOf("(");
4564
4720
  if (c === -1) return null;
4565
- let l = 0, d = 0, u = c + 1, f = !1;
4721
+ let l = 0, d = 0, f = c + 1, u = !1;
4566
4722
  for(let p = c + 1; p < o.length; p++){
4567
- const g = o[p];
4568
- if (g === "'" && !f) f = !0;
4569
- else if (g === "'" && f) {
4723
+ const I = o[p];
4724
+ if (I === "'" && !u) u = !0;
4725
+ else if (I === "'" && u) {
4570
4726
  if (p + 1 < o.length && o[p + 1] === "'") {
4571
4727
  p++;
4572
4728
  continue;
4573
4729
  }
4574
- f = !1;
4575
- } else if (!f) {
4576
- if (g === "(") l++;
4577
- else if (g === ")") {
4578
- if (l === 0) return d === n ? o.substring(u, p).trim() : null;
4730
+ u = !1;
4731
+ } else if (!u) {
4732
+ if (I === "(") l++;
4733
+ else if (I === ")") {
4734
+ if (l === 0) return d === n ? o.substring(f, p).trim() : null;
4579
4735
  l--;
4580
- } else if (g === "," && l === 0) {
4581
- if (d === n) return o.substring(u, p).trim();
4582
- d++, u = p + 1;
4736
+ } else if (I === "," && l === 0) {
4737
+ if (d === n) return o.substring(f, p).trim();
4738
+ d++, f = p + 1;
4583
4739
  }
4584
4740
  }
4585
4741
  }
4586
4742
  return null;
4587
4743
  }
4588
4744
  };
4589
- function Pe(r, t) {
4745
+ function ve(r, t) {
4590
4746
  const e = new TextEncoder, n = e.encode(`${r}DATA;
4591
4747
  `), s = e.encode(`ENDSEC;
4592
4748
  END-ISO-10303-21;
@@ -4594,20 +4750,20 @@ END-ISO-10303-21;
4594
4750
  `);
4595
4751
  let o = n.byteLength + s.byteLength;
4596
4752
  const c = new Array(t.length);
4597
- for(let u = 0; u < t.length; u++)c[u] = e.encode(t[u]), o += c[u].byteLength + i.byteLength;
4753
+ for(let f = 0; f < t.length; f++)c[f] = e.encode(t[f]), o += c[f].byteLength + i.byteLength;
4598
4754
  const l = new Uint8Array(o);
4599
4755
  let d = 0;
4600
4756
  l.set(n, d), d += n.byteLength;
4601
- for(let u = 0; u < c.length; u++)l.set(c[u], d), d += c[u].byteLength, l.set(i, d), d += i.byteLength;
4757
+ for(let f = 0; f < c.length; f++)l.set(c[f], d), d += c[f].byteLength, l.set(i, d), d += i.byteLength;
4602
4758
  return l.set(s, d), l;
4603
4759
  }
4604
- let ee;
4605
- ee = {
4760
+ let se;
4761
+ se = {
4606
4762
  IFC_CORE: "https://ifcx.dev/@standards.buildingsmart.org/ifc/core/ifc@v5a.ifcx",
4607
4763
  IFC_PROP: "https://ifcx.dev/@standards.buildingsmart.org/ifc/core/prop@v5a.ifcx",
4608
4764
  USD: "https://ifcx.dev/@openusd.org/usd@v1.ifcx"
4609
4765
  };
4610
- Be = new Set([
4766
+ De = new Set([
4611
4767
  "UsageType",
4612
4768
  "TypeName",
4613
4769
  "IsExternal",
@@ -4626,7 +4782,7 @@ END-ISO-10303-21;
4626
4782
  "CrossSectionArea",
4627
4783
  "Station"
4628
4784
  ]);
4629
- hs = class {
4785
+ Is = class {
4630
4786
  dataStore;
4631
4787
  mutationView;
4632
4788
  geometryResult;
@@ -4643,47 +4799,47 @@ END-ISO-10303-21;
4643
4799
  this.buildEntityMaps();
4644
4800
  const n = this.buildMeshLookup(t), s = this.buildVisibleSet(t), i = t.onlyTreeEntities !== !1 ? this.buildTreeEntitySet() : null, o = [];
4645
4801
  let c = 0, l = 0;
4646
- const { entities: d, strings: u } = this.dataStore;
4647
- let f = null;
4802
+ const { entities: d, strings: f } = this.dataStore;
4803
+ let u = null;
4648
4804
  for(let y = 0; y < d.count; y++){
4649
4805
  const E = d.expressId[y];
4650
4806
  if (s && !s.has(E) || i && !i.has(E)) continue;
4651
- const C = d.typeEnum[y], T = ie(C) || "IfcElement", $ = Ve(T.toUpperCase(), e, "IFC5"), x = rs($);
4652
- x === "IfcProject" && (f = E);
4653
- const Y = this.entityUuids.get(E) || ne(E), O = {};
4807
+ const C = d.typeEnum[y], T = oe(C) || "IfcElement", G = We(T.toUpperCase(), e, "IFC5"), x = cs(G);
4808
+ x === "IfcProject" && (u = E);
4809
+ const k = this.entityUuids.get(E) || ie(E), O = {};
4654
4810
  O["bsi::ifc::class"] = {
4655
4811
  code: x,
4656
4812
  uri: `https://identifier.buildingsmart.org/uri/buildingsmart/ifc/5/class/${x}`
4657
4813
  };
4658
- const v = u.get(d.name[y]) || this.spatialNodeNames.get(E);
4659
- v && (O["bsi::ifc::prop::Name"] = v);
4660
- const b = u.get(d.description[y]);
4814
+ const D = f.get(d.name[y]) || this.spatialNodeNames.get(E);
4815
+ D && (O["bsi::ifc::prop::Name"] = D);
4816
+ const b = f.get(d.description[y]);
4661
4817
  if (b && (O["bsi::ifc::prop::Description"] = b), t.includeProperties !== !1) {
4662
4818
  const m = this.getPropertiesForEntity(E, t);
4663
4819
  for (const [_, w] of Object.entries(m))O[_] = w, c++;
4664
4820
  }
4665
4821
  const S = {
4666
- path: Y
4822
+ path: k
4667
4823
  }, F = this.getChildrenForEntity(E);
4668
4824
  if (Object.keys(F).length > 0 && (S.children = F), t.includeGeometry !== !1) {
4669
4825
  const m = n.get(E);
4670
4826
  if (m && m.length > 0) {
4671
4827
  const _ = this.convertToUsdMesh(m);
4672
4828
  O["usd::usdgeom::mesh"] = _;
4673
- const [w, I, R, N] = m[0].color;
4829
+ const [w, g, R, N] = m[0].color;
4674
4830
  O["bsi::ifc::presentation::diffuseColor"] = [
4675
4831
  w,
4676
- I,
4832
+ g,
4677
4833
  R
4678
4834
  ], N < 1 && (O["bsi::ifc::presentation::opacity"] = N), l++;
4679
4835
  }
4680
4836
  }
4681
4837
  Object.keys(O).length > 0 && (S.attributes = O), o.push(S);
4682
4838
  }
4683
- if (f !== null) {
4684
- const y = this.entityUuids.get(f);
4839
+ if (u !== null) {
4840
+ const y = this.entityUuids.get(u);
4685
4841
  if (y) {
4686
- const E = this.childNames.get(f) || u.get(d.name[this.findEntityIndex(f)]) || "Project", C = ne(0);
4842
+ const E = this.childNames.get(u) || f.get(d.name[this.findEntityIndex(u)]) || "Project", C = ie(0);
4687
4843
  o.unshift({
4688
4844
  path: C,
4689
4845
  children: {
@@ -4693,7 +4849,7 @@ END-ISO-10303-21;
4693
4849
  });
4694
4850
  }
4695
4851
  }
4696
- const p = is(o), g = {
4852
+ const p = as(o), I = {
4697
4853
  header: {
4698
4854
  id: `ifcx_${Date.now()}_${Math.random().toString(36).substring(2, 9)}`,
4699
4855
  ifcxVersion: "ifcx_alpha",
@@ -4704,7 +4860,7 @@ END-ISO-10303-21;
4704
4860
  imports: p,
4705
4861
  schemas: {},
4706
4862
  data: o
4707
- }, h = t.prettyPrint !== !1 ? JSON.stringify(g, null, 2) : JSON.stringify(g);
4863
+ }, h = t.prettyPrint !== !1 ? JSON.stringify(I, null, 2) : JSON.stringify(I);
4708
4864
  return {
4709
4865
  content: h,
4710
4866
  stats: {
@@ -4724,18 +4880,18 @@ END-ISO-10303-21;
4724
4880
  const { spatialHierarchy: t, entities: e, strings: n } = this.dataStore;
4725
4881
  this.entityUuids.clear();
4726
4882
  for(let l = 0; l < e.count; l++){
4727
- const d = e.expressId[l], u = n.get(e.globalId[l]);
4728
- this.entityUuids.set(d, u || ne(d));
4883
+ const d = e.expressId[l], f = n.get(e.globalId[l]);
4884
+ this.entityUuids.set(d, f || ie(d));
4729
4885
  }
4730
4886
  const s = new Map, i = (l, d)=>{
4731
- if (d) for (const u of d)s.set(u, l);
4887
+ if (d) for (const f of d)s.set(f, l);
4732
4888
  };
4733
4889
  if (this.spatialChildIds.clear(), this.spatialNodeNames.clear(), t?.project) {
4734
4890
  const l = (d)=>{
4735
4891
  d.name && this.spatialNodeNames.set(d.expressId, d.name);
4736
- const u = [];
4737
- for (const f of d.children)s.set(f.expressId, d.expressId), u.push(f.expressId), l(f);
4738
- this.spatialChildIds.set(d.expressId, u);
4892
+ const f = [];
4893
+ for (const u of d.children)s.set(u.expressId, d.expressId), f.push(u.expressId), l(u);
4894
+ this.spatialChildIds.set(d.expressId, f);
4739
4895
  };
4740
4896
  l(t.project);
4741
4897
  }
@@ -4745,17 +4901,17 @@ END-ISO-10303-21;
4745
4901
  t.byBuilding,
4746
4902
  t.byStorey,
4747
4903
  t.bySpace
4748
- ])if (l) for (const [d, u] of l)i(d, u);
4904
+ ])if (l) for (const [d, f] of l)i(d, f);
4749
4905
  }
4750
4906
  const o = new Map;
4751
4907
  for(let l = 0; l < e.count; l++){
4752
4908
  const d = e.expressId[l];
4753
- let u = n.get(e.name[l]) || "";
4754
- if (u || (u = this.spatialNodeNames.get(d) || ""), !u) {
4755
- const f = ie(e.typeEnum[l]);
4756
- f !== "Unknown" && (u = f);
4909
+ let f = n.get(e.name[l]) || "";
4910
+ if (f || (f = this.spatialNodeNames.get(d) || ""), !f) {
4911
+ const u = oe(e.typeEnum[l]);
4912
+ u !== "Unknown" && (f = u);
4757
4913
  }
4758
- o.set(d, u);
4914
+ o.set(d, f);
4759
4915
  }
4760
4916
  const c = new Map;
4761
4917
  for (const [l, d] of s)c.has(d) || c.set(d, []), c.get(d).push(l);
@@ -4766,13 +4922,13 @@ END-ISO-10303-21;
4766
4922
  this.childNames.clear();
4767
4923
  for (const [, l] of c){
4768
4924
  const d = new Map;
4769
- for (const u of l){
4770
- const p = (o.get(u) || `e${u}`).replace(/[/\\]/g, "_").replace(/\s+/g, "_");
4925
+ for (const f of l){
4926
+ const p = (o.get(f) || `e${f}`).replace(/[/\\]/g, "_").replace(/\s+/g, "_");
4771
4927
  d.set(p, (d.get(p) || 0) + 1);
4772
4928
  }
4773
- for (const u of l){
4774
- const p = (o.get(u) || `e${u}`).replace(/[/\\]/g, "_").replace(/\s+/g, "_");
4775
- this.childNames.set(u, d.get(p) > 1 ? `${p}_${u}` : p);
4929
+ for (const f of l){
4930
+ const p = (o.get(f) || `e${f}`).replace(/[/\\]/g, "_").replace(/\s+/g, "_");
4931
+ this.childNames.set(f, d.get(p) > 1 ? `${p}_${f}` : p);
4776
4932
  }
4777
4933
  }
4778
4934
  }
@@ -4781,14 +4937,14 @@ END-ISO-10303-21;
4781
4937
  if (this.mutationView && e.applyMutations !== !1) {
4782
4938
  const s = this.mutationView.getForEntity(t);
4783
4939
  for (const i of s)for (const o of i.properties){
4784
- if (e.onlyKnownProperties !== !1 && !Be.has(o.name)) continue;
4940
+ if (e.onlyKnownProperties !== !1 && !De.has(o.name)) continue;
4785
4941
  const c = `bsi::ifc::prop::${o.name}`;
4786
4942
  n[c] = this.convertPropertyValue(o.value, o.type);
4787
4943
  }
4788
4944
  } else if (this.dataStore.properties) {
4789
4945
  const s = this.dataStore.properties.getForEntity(t);
4790
4946
  for (const i of s)for (const o of i.properties){
4791
- if (e.onlyKnownProperties !== !1 && !Be.has(o.name)) continue;
4947
+ if (e.onlyKnownProperties !== !1 && !De.has(o.name)) continue;
4792
4948
  const c = `bsi::ifc::prop::${o.name}`;
4793
4949
  n[c] = this.convertPropertyValue(o.value, o.type);
4794
4950
  }
@@ -4798,12 +4954,12 @@ END-ISO-10303-21;
4798
4954
  convertPropertyValue(t, e) {
4799
4955
  if (t == null) return null;
4800
4956
  switch(e){
4801
- case et.Real:
4957
+ case st.Real:
4802
4958
  return Number(t);
4803
- case et.Integer:
4959
+ case st.Integer:
4804
4960
  return Math.round(Number(t));
4805
- case et.Boolean:
4806
- case et.Logical:
4961
+ case st.Boolean:
4962
+ case st.Logical:
4807
4963
  return !!t;
4808
4964
  default:
4809
4965
  return t;
@@ -4887,7 +5043,7 @@ END-ISO-10303-21;
4887
5043
  return s;
4888
5044
  }
4889
5045
  };
4890
- function is(r) {
5046
+ function as(r) {
4891
5047
  let t = !1, e = !1, n = !1;
4892
5048
  for (const i of r)if (i.attributes) {
4893
5049
  for (const o of Object.keys(i.attributes))if (!t && (o === "bsi::ifc::class" || o.startsWith("bsi::ifc::presentation::") || o === "bsi::ifc::material" || o === "bsi::ifc::spaceBoundary") && (t = !0), !e && o.startsWith("bsi::ifc::prop::") && (e = !0), !n && o.startsWith("usd::") && (n = !0), t && e && n) break;
@@ -4895,21 +5051,21 @@ END-ISO-10303-21;
4895
5051
  }
4896
5052
  const s = [];
4897
5053
  return t && s.push({
4898
- uri: ee.IFC_CORE
5054
+ uri: se.IFC_CORE
4899
5055
  }), e && s.push({
4900
- uri: ee.IFC_PROP
5056
+ uri: se.IFC_PROP
4901
5057
  }), n && s.push({
4902
- uri: ee.USD
5058
+ uri: se.USD
4903
5059
  }), s;
4904
5060
  }
4905
- function ne(r) {
5061
+ function ie(r) {
4906
5062
  return `00000000-0000-4000-8000-${r.toString(16).padStart(12, "0")}`;
4907
5063
  }
4908
- function rs(r) {
4909
- const t = Ke(r), e = ie(t);
5064
+ function cs(r) {
5065
+ const t = nn(r), e = oe(t);
4910
5066
  if (e !== "Unknown") return e;
4911
5067
  const n = r.toLowerCase();
4912
5068
  return n.startsWith("ifc") ? "Ifc" + n.charAt(3).toUpperCase() + n.slice(4) : r;
4913
5069
  }
4914
5070
  });
4915
- export { ds as C, ls as G, Be as I, us as M, ts as S, Ge as _, cs as a, En as b, hs as c, oe as d, fs as e, as as g, __tla };
5071
+ export { ps as C, hs as G, De as I, _s as M, is as S, us as a, Rn as b, Is as c, gs as e, fs as g, ds as m, __tla };