@bldrs-ai/conway 1.378.1185 → 1.381.1195

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 (96) hide show
  1. package/compiled/Dist/ConwayGeomWasmNode.js +0 -0
  2. package/compiled/Dist/ConwayGeomWasmNodeMT.js +0 -0
  3. package/compiled/Dist/ConwayGeomWasmWeb.js +0 -0
  4. package/compiled/Dist/ConwayGeomWasmWebMT.wasm +0 -0
  5. package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmNode.js +0 -0
  6. package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmNodeMT.js +0 -0
  7. package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmWeb.js +0 -0
  8. package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmWebMT.wasm +0 -0
  9. package/compiled/examples/browser-bundled.cjs +682 -401
  10. package/compiled/examples/cli-bundled.cjs +71685 -70868
  11. package/compiled/examples/cli-step-bundled.cjs +12666 -12351
  12. package/compiled/examples/validator-bundled.cjs +682 -401
  13. package/compiled/src/AP214E3_2010/ap214_geometry_extraction.d.ts +12 -0
  14. package/compiled/src/AP214E3_2010/ap214_geometry_extraction.d.ts.map +1 -1
  15. package/compiled/src/AP214E3_2010/ap214_geometry_extraction.js +30 -4
  16. package/compiled/src/AP214E3_2010/ap214_occurrence_geometry.test.js +70 -1
  17. package/compiled/src/AP214E3_2010/ap214_step_parser.d.ts +16 -2
  18. package/compiled/src/AP214E3_2010/ap214_step_parser.d.ts.map +1 -1
  19. package/compiled/src/AP214E3_2010/ap214_step_parser.js +16 -2
  20. package/compiled/src/cli/cli_progress_renderer.d.ts +57 -0
  21. package/compiled/src/cli/cli_progress_renderer.d.ts.map +1 -0
  22. package/compiled/src/cli/cli_progress_renderer.js +97 -0
  23. package/compiled/src/compat/web-ifc/ifc_api.d.ts +49 -0
  24. package/compiled/src/compat/web-ifc/ifc_api.d.ts.map +1 -1
  25. package/compiled/src/compat/web-ifc/ifc_api.js +60 -1
  26. package/compiled/src/compat/web-ifc/ifc_api_model_passthrough_factory.d.ts +14 -0
  27. package/compiled/src/compat/web-ifc/ifc_api_model_passthrough_factory.d.ts.map +1 -1
  28. package/compiled/src/compat/web-ifc/ifc_api_model_passthrough_factory.js +44 -0
  29. package/compiled/src/compat/web-ifc/ifc_api_proxy_ap214.d.ts +71 -1
  30. package/compiled/src/compat/web-ifc/ifc_api_proxy_ap214.d.ts.map +1 -1
  31. package/compiled/src/compat/web-ifc/ifc_api_proxy_ap214.js +196 -49
  32. package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.d.ts +68 -1
  33. package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.d.ts.map +1 -1
  34. package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.js +202 -49
  35. package/compiled/src/compat/web-ifc/index.d.ts +2 -0
  36. package/compiled/src/compat/web-ifc/index.d.ts.map +1 -1
  37. package/compiled/src/compat/web-ifc/index.js +4 -0
  38. package/compiled/src/core/progress.d.ts +113 -0
  39. package/compiled/src/core/progress.d.ts.map +1 -0
  40. package/compiled/src/core/progress.js +111 -0
  41. package/compiled/src/core/progress.test.d.ts +2 -0
  42. package/compiled/src/core/progress.test.d.ts.map +1 -0
  43. package/compiled/src/core/progress.test.js +65 -0
  44. package/compiled/src/core/progress_log.d.ts +150 -0
  45. package/compiled/src/core/progress_log.d.ts.map +1 -0
  46. package/compiled/src/core/progress_log.js +293 -0
  47. package/compiled/src/core/progress_log.test.d.ts +2 -0
  48. package/compiled/src/core/progress_log.test.d.ts.map +1 -0
  49. package/compiled/src/core/progress_log.test.js +89 -0
  50. package/compiled/src/ifc/ifc_command_line_main.js +49 -6
  51. package/compiled/src/ifc/ifc_geometry_extraction.d.ts +53 -1
  52. package/compiled/src/ifc/ifc_geometry_extraction.d.ts.map +1 -1
  53. package/compiled/src/ifc/ifc_geometry_extraction.js +114 -6
  54. package/compiled/src/ifc/ifc_geometry_extraction_progress.test.d.ts +2 -0
  55. package/compiled/src/ifc/ifc_geometry_extraction_progress.test.d.ts.map +1 -0
  56. package/compiled/src/ifc/ifc_geometry_extraction_progress.test.js +55 -0
  57. package/compiled/src/ifc/ifc_step_parser.d.ts +16 -2
  58. package/compiled/src/ifc/ifc_step_parser.d.ts.map +1 -1
  59. package/compiled/src/ifc/ifc_step_parser.js +16 -2
  60. package/compiled/src/index.d.ts +4 -1
  61. package/compiled/src/index.d.ts.map +1 -1
  62. package/compiled/src/index.js +3 -1
  63. package/compiled/src/indexing/multi_index_set.d.ts +13 -0
  64. package/compiled/src/indexing/multi_index_set.d.ts.map +1 -1
  65. package/compiled/src/indexing/multi_index_set.js +44 -0
  66. package/compiled/src/loaders/conway_model_loader.d.ts +28 -1
  67. package/compiled/src/loaders/conway_model_loader.d.ts.map +1 -1
  68. package/compiled/src/loaders/conway_model_loader.js +64 -13
  69. package/compiled/src/loaders/loading_utilities.d.ts +13 -1
  70. package/compiled/src/loaders/loading_utilities.d.ts.map +1 -1
  71. package/compiled/src/loaders/loading_utilities.js +44 -0
  72. package/compiled/src/logging/logger.d.ts +74 -5
  73. package/compiled/src/logging/logger.d.ts.map +1 -1
  74. package/compiled/src/logging/logger.js +116 -3
  75. package/compiled/src/logging/logger.test.d.ts +2 -0
  76. package/compiled/src/logging/logger.test.d.ts.map +1 -0
  77. package/compiled/src/logging/logger.test.js +62 -0
  78. package/compiled/src/memory/memory.d.ts +8 -0
  79. package/compiled/src/memory/memory.d.ts.map +1 -1
  80. package/compiled/src/memory/memory.js +23 -0
  81. package/compiled/src/statistics/statistics.d.ts +38 -0
  82. package/compiled/src/statistics/statistics.d.ts.map +1 -1
  83. package/compiled/src/statistics/statistics.js +66 -2
  84. package/compiled/src/step/parsing/step_parser.d.ts +38 -2
  85. package/compiled/src/step/parsing/step_parser.d.ts.map +1 -1
  86. package/compiled/src/step/parsing/step_parser.js +67 -2
  87. package/compiled/src/step/parsing/step_parser_progress.test.d.ts +2 -0
  88. package/compiled/src/step/parsing/step_parser_progress.test.d.ts.map +1 -0
  89. package/compiled/src/step/parsing/step_parser_progress.test.js +70 -0
  90. package/compiled/src/step/step_model_base.d.ts +11 -0
  91. package/compiled/src/step/step_model_base.d.ts.map +1 -1
  92. package/compiled/src/step/step_model_base.js +15 -0
  93. package/compiled/src/version/version.d.ts.map +1 -1
  94. package/compiled/src/version/version.js +1 -1
  95. package/compiled/tsconfig.tsbuildinfo +1 -1
  96. package/package.json +1 -1
@@ -29,6 +29,566 @@ var import_process = require("process");
29
29
  var import_node_process = require("node:process");
30
30
  var readline = __toESM(require("node:readline"), 1);
31
31
 
32
+ // compiled/src/version/version.js
33
+ var versionString = "Conway v1.381.1195";
34
+
35
+ // compiled/dependencies/conway-geom/interface/conway_geometry.js
36
+ var wasmType = "";
37
+ var dynamicImport = new Function("module", "return import(module)");
38
+
39
+ // compiled/dependencies/conway-geom/interface/material_object.js
40
+ var BlendMode;
41
+ (function(BlendMode2) {
42
+ BlendMode2[BlendMode2["OPAQUE"] = 0] = "OPAQUE";
43
+ BlendMode2[BlendMode2["BLEND"] = 1] = "BLEND";
44
+ BlendMode2[BlendMode2["MASK"] = 2] = "MASK";
45
+ })(BlendMode || (BlendMode = {}));
46
+
47
+ // compiled/src/statistics/statistics.js
48
+ var Statistics = class {
49
+ // Getters and setters
50
+ /**
51
+ *
52
+ * @return {string | undefined} - load status or undefined
53
+ */
54
+ getLoadStatus() {
55
+ return this.loadStatus;
56
+ }
57
+ /**
58
+ *
59
+ * @param value - load status
60
+ */
61
+ setLoadStatus(value) {
62
+ this.loadStatus = value;
63
+ }
64
+ /**
65
+ *
66
+ * @return {string | undefined} - project name or undefined
67
+ */
68
+ getProjectName() {
69
+ return this.projectName;
70
+ }
71
+ /**
72
+ *
73
+ * @param value - project name
74
+ */
75
+ setProjectName(value) {
76
+ this.projectName = value;
77
+ }
78
+ /**
79
+ *
80
+ * @return {string | undefined} - version or undefined
81
+ */
82
+ getVersion() {
83
+ return this.version;
84
+ }
85
+ /**
86
+ *
87
+ * @param value - version
88
+ */
89
+ setVersion(value) {
90
+ this.version = value;
91
+ }
92
+ /**
93
+ *
94
+ * @return {number | undefined} - parse time or undefined
95
+ */
96
+ getParseTime() {
97
+ return this.parseTime;
98
+ }
99
+ /**
100
+ *
101
+ * @param value - parse time
102
+ */
103
+ setParseTime(value) {
104
+ this.parseTime = value;
105
+ }
106
+ /**
107
+ *
108
+ * @return {number | undefined} - geometry parse time or undefined
109
+ */
110
+ getGeometryTime() {
111
+ return this.geometryTime;
112
+ }
113
+ /**
114
+ *
115
+ * @param value - geometry parse time
116
+ */
117
+ setGeometryTime(value) {
118
+ this.geometryTime = value;
119
+ }
120
+ /**
121
+ *
122
+ * @return {number | undefined} - total execution time or undefined
123
+ */
124
+ getTotalTime() {
125
+ return this.totalTime;
126
+ }
127
+ /**
128
+ *
129
+ * @param value - total execution time
130
+ */
131
+ setTotalTime(value) {
132
+ this.totalTime = value;
133
+ }
134
+ /**
135
+ *
136
+ * @return {number | undefined} - geometry memory or undefined
137
+ */
138
+ getGeometryMemory() {
139
+ return this.geometryMemory;
140
+ }
141
+ /**
142
+ *
143
+ * @param value - geometry memory
144
+ */
145
+ setGeometryMemory(value) {
146
+ this.geometryMemory = value;
147
+ }
148
+ /**
149
+ *
150
+ * @return {string | undefined} - preprocessor version or undefined
151
+ */
152
+ getPreprocessorVersion() {
153
+ return this.preprocessorVersion;
154
+ }
155
+ /**
156
+ *
157
+ * @param value - preprocessor version
158
+ */
159
+ setPreprocessorVersion(value) {
160
+ this.preprocessorVersion = value;
161
+ }
162
+ /**
163
+ *
164
+ * @return {string | undefined} - originating system or undefined
165
+ */
166
+ getOriginatingSystem() {
167
+ return this.originatingSystem;
168
+ }
169
+ /**
170
+ *
171
+ * @param value - originating system
172
+ */
173
+ setOriginatingSystem(value) {
174
+ this.originatingSystem = value;
175
+ }
176
+ /**
177
+ *
178
+ * @return {string | undefined} - memory statistics or undefined
179
+ */
180
+ getMemoryStatistics() {
181
+ return this.memoryStatistics;
182
+ }
183
+ /**
184
+ *
185
+ * @param value - memory statistics
186
+ */
187
+ setMemoryStatistics(value) {
188
+ this.memoryStatistics = value;
189
+ }
190
+ /**
191
+ *
192
+ * @return {number | undefined} - number of products extracted
193
+ */
194
+ getProductCount() {
195
+ return this.productCount;
196
+ }
197
+ /**
198
+ *
199
+ * @param value - number of products extracted
200
+ */
201
+ setProductCount(value) {
202
+ this.productCount = value;
203
+ }
204
+ /**
205
+ *
206
+ * @return {Map<string, number> | undefined} - geometry type breakdown
207
+ * (entity type name -> count of unique geometry definitions extracted)
208
+ */
209
+ getGeometryTypeCounts() {
210
+ return this.geometryTypeCounts;
211
+ }
212
+ /**
213
+ *
214
+ * @param value - geometry type breakdown map
215
+ */
216
+ setGeometryTypeCounts(value) {
217
+ this.geometryTypeCounts = value;
218
+ }
219
+ /**
220
+ * Format the geometry-type breakdown as a compact sorted list, e.g.
221
+ * "IFCEXTRUDEDAREASOLID×3421 IFCFACETEDBREP×212 (+3 more)".
222
+ *
223
+ * @param maxEntries - cap on listed types (rest summarized)
224
+ * @return {string | undefined} the formatted breakdown, if any
225
+ */
226
+ // eslint-disable-next-line no-magic-numbers
227
+ formatGeometryTypeCounts(maxEntries = 12) {
228
+ if (this.geometryTypeCounts === void 0 || this.geometryTypeCounts.size === 0) {
229
+ return void 0;
230
+ }
231
+ const sorted = Array.from(this.geometryTypeCounts.entries()).sort((leftEntry, rightEntry) => rightEntry[1] - leftEntry[1]);
232
+ const shown = sorted.slice(0, maxEntries).map(([name, count]) => `${name}\xD7${count}`).join(" ");
233
+ const remainder = sorted.length - maxEntries;
234
+ return remainder > 0 ? `${shown} (+${remainder} more)` : shown;
235
+ }
236
+ /**
237
+ * prints statistics
238
+ */
239
+ printStatistics() {
240
+ console.log(this.format());
241
+ }
242
+ /**
243
+ * Format the load-summary line (Logger routes this through its sink so
244
+ * the CLI can keep stdout clean — issue #301).
245
+ *
246
+ * @return {string} the single-line load summary
247
+ */
248
+ format() {
249
+ const date = /* @__PURE__ */ new Date();
250
+ const options = {
251
+ year: "numeric",
252
+ month: "short",
253
+ day: "numeric",
254
+ hour: "2-digit",
255
+ minute: "2-digit",
256
+ second: "2-digit",
257
+ timeZone: "UTC"
258
+ };
259
+ const dateString = date.toLocaleDateString("en-US", options).replace(/,/g, "");
260
+ const versionMatch = versionString.match(/v(\d+\.\d+\.\d+)/);
261
+ let conwayVersionNumber;
262
+ if (versionMatch !== null) {
263
+ conwayVersionNumber = versionMatch[1];
264
+ } else {
265
+ conwayVersionNumber = "Version Not Found";
266
+ }
267
+ let versionStr;
268
+ if (this.version !== void 0) {
269
+ const match = this.version.match(/'([^']+)'/);
270
+ if (match) {
271
+ versionStr = match[1];
272
+ } else {
273
+ versionStr = "No match found";
274
+ }
275
+ } else {
276
+ versionStr = "Version not defined";
277
+ }
278
+ const products = this.productCount !== void 0 ? `Products: ${this.productCount}, ` : "";
279
+ const breakdown = this.formatGeometryTypeCounts();
280
+ const geometryTypes = breakdown !== void 0 ? `, Geometry Types: ${breakdown}` : "";
281
+ return `[${dateString}]: Load Status: ${this.loadStatus}, Project Name: ${this.projectName}, Version: ${versionStr}, Conway Version: ${conwayVersionNumber}-${wasmType}, Parse Time: ${this.parseTime} ms, Geometry Time: ${this.geometryTime} ms, Total Time: ${this.totalTime} ms, Geometry Memory: ${this.geometryMemory?.toFixed(3)} MB, ` + products + `Memory Statistics: ${this.memoryStatistics}, Preprocessor Version: ${this.preprocessorVersion}, Originating System: ${this.originatingSystem}` + geometryTypes;
282
+ }
283
+ };
284
+
285
+ // compiled/src/logging/logger.js
286
+ var LogLevel;
287
+ (function(LogLevel2) {
288
+ LogLevel2[LogLevel2["DEBUG"] = 0] = "DEBUG";
289
+ LogLevel2[LogLevel2["INFO"] = 1] = "INFO";
290
+ LogLevel2[LogLevel2["WARNING"] = 2] = "WARNING";
291
+ LogLevel2[LogLevel2["ERROR"] = 3] = "ERROR";
292
+ LogLevel2[LogLevel2["OFF"] = 4] = "OFF";
293
+ })(LogLevel || (LogLevel = {}));
294
+ var LOG_LEVEL_BY_NAME = {
295
+ "debug": LogLevel.DEBUG,
296
+ "info": LogLevel.INFO,
297
+ "warning": LogLevel.WARNING,
298
+ "error": LogLevel.ERROR
299
+ };
300
+ var defaultSink = (level, message) => {
301
+ switch (level) {
302
+ case "error":
303
+ console.error(message);
304
+ break;
305
+ case "warning":
306
+ console.warn(message);
307
+ break;
308
+ default:
309
+ console.log(message);
310
+ }
311
+ };
312
+ var Logger = class _Logger {
313
+ /**
314
+ * Detects environment and initializes wasm callbacks
315
+ */
316
+ static initializeWasmCallbacks() {
317
+ const environment = environment_default.environmentType;
318
+ if (environment === EnvironmentType.BROWSER) {
319
+ const globalScope = window;
320
+ globalScope.logInfo = _Logger.info;
321
+ globalScope.logWarning = _Logger.warning;
322
+ globalScope.logError = _Logger.error;
323
+ } else if (environment === EnvironmentType.NODE || environment === EnvironmentType.BOTH_FEATURES) {
324
+ const globalScope = global;
325
+ globalScope.logInfo = _Logger.info;
326
+ globalScope.logWarning = _Logger.warning;
327
+ globalScope.logError = _Logger.error;
328
+ }
329
+ }
330
+ /**
331
+ * Set the console-echo threshold. Embedders (e.g. Share) call this to
332
+ * quiet or expand conway's console output; the CLI maps -q/-v/-vv here.
333
+ *
334
+ * @param level - new threshold
335
+ */
336
+ static setLogLevel(level) {
337
+ _Logger.threshold = level;
338
+ }
339
+ /**
340
+ *
341
+ * @return {LogLevel} the current console-echo threshold
342
+ */
343
+ static getLogLevel() {
344
+ return _Logger.threshold;
345
+ }
346
+ /**
347
+ * Is a given level at or above the current threshold?
348
+ *
349
+ * @param level - level to test
350
+ * @return {boolean} true when messages at this level echo to the console
351
+ */
352
+ static isLevelEnabled(level) {
353
+ return level >= _Logger.threshold && _Logger.threshold !== LogLevel.OFF;
354
+ }
355
+ /**
356
+ * Replace the console sink (e.g. the CLI routes all echoes to stderr so
357
+ * stdout stays parseable). Pass undefined to restore the default.
358
+ *
359
+ * @param sink - replacement sink or undefined
360
+ */
361
+ static setSink(sink) {
362
+ _Logger.sink = sink ?? defaultSink;
363
+ }
364
+ /**
365
+ *
366
+ * @param message - log message
367
+ * @param level - log level
368
+ * @return {number} log index
369
+ */
370
+ static findLogIndex(message, level) {
371
+ return _Logger.logs.findIndex((log) => log.message === message && log.level === level);
372
+ }
373
+ /**
374
+ *
375
+ * @param level - log level
376
+ * @param message - log message
377
+ */
378
+ static log(level, message) {
379
+ const baseMessage = message.split(" expressID: ")[0];
380
+ const data = message.split(" expressID: ")[1];
381
+ const index = _Logger.findLogIndex(baseMessage, level);
382
+ let logEntry;
383
+ let firstOccurrence = false;
384
+ if (index >= 0) {
385
+ _Logger.logs[index].count += 1;
386
+ if (data !== void 0) {
387
+ _Logger.logs[index].expressIDs = _Logger.logs[index].expressIDs || /* @__PURE__ */ new Set();
388
+ _Logger.logs[index].expressIDs.add(data);
389
+ }
390
+ logEntry = _Logger.logs[index];
391
+ } else {
392
+ firstOccurrence = true;
393
+ logEntry = {
394
+ level,
395
+ message: baseMessage,
396
+ count: 1,
397
+ expressIDs: data ? /* @__PURE__ */ new Set([data]) : /* @__PURE__ */ new Set()
398
+ };
399
+ _Logger.logs.push(logEntry);
400
+ }
401
+ if (firstOccurrence && _Logger.isLevelEnabled(LOG_LEVEL_BY_NAME[level])) {
402
+ _Logger.sink(level, baseMessage);
403
+ }
404
+ _Logger.proxies.forEach((proxy) => proxy.log(logEntry));
405
+ }
406
+ /**
407
+ * Compresses similar logs to a single line
408
+ */
409
+ static compressLogs() {
410
+ const compressedLogs = [];
411
+ _Logger.logs.forEach((log) => {
412
+ const existingLog = compressedLogs.find((l) => l.message === log.message && l.level === log.level);
413
+ if (existingLog !== void 0) {
414
+ existingLog.count += log.count;
415
+ if (log.expressIDs !== void 0) {
416
+ log.expressIDs.forEach((d) => existingLog.expressIDs?.add(d));
417
+ }
418
+ } else {
419
+ compressedLogs.push({
420
+ ...log,
421
+ expressIDs: log.expressIDs ? new Set(log.expressIDs) : /* @__PURE__ */ new Set()
422
+ });
423
+ }
424
+ });
425
+ _Logger.logs = compressedLogs;
426
+ }
427
+ /**
428
+ *
429
+ * @param proxy - a log proxy
430
+ */
431
+ static addProxy(proxy) {
432
+ _Logger.proxies.push(proxy);
433
+ }
434
+ /**
435
+ * Remove a previously added proxy (no-op if absent).
436
+ *
437
+ * @param proxy - the proxy to remove
438
+ */
439
+ static removeProxy(proxy) {
440
+ const index = _Logger.proxies.indexOf(proxy);
441
+ if (index >= 0) {
442
+ _Logger.proxies.splice(index, 1);
443
+ }
444
+ }
445
+ /**
446
+ *
447
+ * @param message - log message
448
+ */
449
+ static debug(message) {
450
+ _Logger.log("debug", message);
451
+ }
452
+ /**
453
+ *
454
+ * @param message - log message
455
+ */
456
+ static info(message) {
457
+ _Logger.log("info", message);
458
+ }
459
+ /**
460
+ *
461
+ * @param modelID
462
+ * @return {Statistics | undefined}
463
+ */
464
+ static getStatistics(modelID) {
465
+ return this.statistics.get(modelID);
466
+ }
467
+ /**
468
+ * Create the statistics for a model ID.
469
+ *
470
+ * @param modelID The model ID to create statistics for
471
+ *
472
+ * @return {Statistics} The created statistics object.
473
+ */
474
+ static createStatistics(modelID) {
475
+ const statistics = new Statistics();
476
+ this.statistics.set(modelID, statistics);
477
+ return statistics;
478
+ }
479
+ /**
480
+ *
481
+ * @param modelID
482
+ */
483
+ static printStatistics(modelID) {
484
+ if (!_Logger.isLevelEnabled(LogLevel.INFO)) {
485
+ return;
486
+ }
487
+ const statistics_ = this.statistics.get(modelID);
488
+ if (statistics_ !== void 0) {
489
+ _Logger.sink("info", statistics_.format());
490
+ } else {
491
+ _Logger.error(`No statistics for modelID: ${modelID}`);
492
+ }
493
+ }
494
+ /**
495
+ * Compresses the logs if they haven't been compressed,
496
+ * then returns a list of just the errors.
497
+ *
498
+ * @return {LogEntry[]} The errors.
499
+ */
500
+ static getErrors() {
501
+ _Logger.compressLogs();
502
+ return this.logs.filter((where) => where.level === "error");
503
+ }
504
+ /**
505
+ *
506
+ * @param message - log message
507
+ */
508
+ static warning(message) {
509
+ _Logger.log("warning", message);
510
+ }
511
+ /**
512
+ *
513
+ * @param message - log message
514
+ */
515
+ static error(message) {
516
+ _Logger.log("error", message);
517
+ }
518
+ /**
519
+ *
520
+ * @return {LogEntry[]} - list of logs
521
+ */
522
+ static getLogs() {
523
+ return _Logger.logs;
524
+ }
525
+ /**
526
+ * Display the deduplicated log buffer in a table.
527
+ *
528
+ * Gated behind the DEBUG threshold by default — a clean load should leave
529
+ * a quiet console (issue #301); pass force for explicit dumps (CLI -v).
530
+ *
531
+ * @param force - dump regardless of the current threshold
532
+ */
533
+ static displayLogs(force = false) {
534
+ if (!force && !_Logger.isLevelEnabled(LogLevel.DEBUG)) {
535
+ return;
536
+ }
537
+ _Logger.compressLogs();
538
+ console.table(_Logger.logs);
539
+ }
540
+ /**
541
+ * clear logs
542
+ */
543
+ static clearLogs() {
544
+ _Logger.logs = [];
545
+ }
546
+ };
547
+ Logger.logs = [];
548
+ Logger.proxies = [];
549
+ Logger.statistics = /* @__PURE__ */ new Map();
550
+ Logger.threshold = LogLevel.INFO;
551
+ Logger.sink = defaultSink;
552
+ var logger_default = Logger;
553
+
554
+ // compiled/src/utilities/environment.js
555
+ var EnvironmentType;
556
+ (function(EnvironmentType2) {
557
+ EnvironmentType2[EnvironmentType2["BROWSER"] = 0] = "BROWSER";
558
+ EnvironmentType2[EnvironmentType2["NODE"] = 1] = "NODE";
559
+ EnvironmentType2[EnvironmentType2["BOTH_FEATURES"] = 2] = "BOTH_FEATURES";
560
+ EnvironmentType2[EnvironmentType2["UNKNOWN"] = 3] = "UNKNOWN";
561
+ })(EnvironmentType || (EnvironmentType = {}));
562
+ var Environment = class {
563
+ /**
564
+ * determines the runtime environment
565
+ */
566
+ static checkEnvironment() {
567
+ const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined";
568
+ const isNode = typeof global !== "undefined" && typeof global.process !== "undefined" && global.process.versions && global.process.versions.node;
569
+ if (isBrowser && isNode) {
570
+ logger_default.info("This environment has features of both Node.js and a web browser.");
571
+ this.environmentType = EnvironmentType.BOTH_FEATURES;
572
+ } else if (isNode) {
573
+ this.environmentType = EnvironmentType.NODE;
574
+ } else if (isBrowser) {
575
+ this.environmentType = EnvironmentType.BROWSER;
576
+ } else {
577
+ logger_default.info("ENVIRONMENT === unknown");
578
+ this.environmentType = EnvironmentType.UNKNOWN;
579
+ }
580
+ }
581
+ };
582
+ Environment.environmentType = EnvironmentType.UNKNOWN;
583
+ var environment_default = Environment;
584
+
585
+ // compiled/src/core/progress.js
586
+ function yieldToEventLoop() {
587
+ return new Promise((resolve) => {
588
+ setTimeout(resolve, 0);
589
+ });
590
+ }
591
+
32
592
  // compiled/src/parsing/token_parsing.js
33
593
  var encoder = new TextEncoder();
34
594
  function encodeToken(from) {
@@ -1734,6 +2294,8 @@ var binaryParser = hex_parser_default.Instance.step;
1734
2294
  var attributeMap = step_attribute_map_default.Instance.get;
1735
2295
  var commentParser2 = step_comment_parser_default.Instance.match;
1736
2296
  var stringParser2 = step_string_parser_default.Instance.match;
2297
+ var PARSE_PROGRESS_ELEMENT_MASK = 4095;
2298
+ var DEFAULT_PARSE_YIELD_INTERVAL_MS = 50;
1737
2299
  var StepHeaderParser = class _StepHeaderParser {
1738
2300
  /**
1739
2301
  * Get the singleton static instance of this.
@@ -1956,12 +2518,64 @@ var StepParser = class extends StepHeaderParser {
1956
2518
  return vtableBuilder.complete(cursor);
1957
2519
  }
1958
2520
  /**
1959
- * Parse the data block of a step file, indexing it.,
2521
+ * Parse the data block of a step file, indexing it.
2522
+ *
2523
+ * Synchronous driver over parseDataBlockIncremental — see
2524
+ * parseDataBlockAsync for the cooperative (repaint-friendly) variant.
2525
+ *
2526
+ * @param input The input parsing buffer, in the data section.
2527
+ * @param onProgress Optional byte-cursor progress callback, invoked
2528
+ * roughly every PARSE_PROGRESS_ELEMENT_MASK + 1 elements.
2529
+ * @return {BlockParseResult} The parsing result, including the index and result enum.
2530
+ */
2531
+ parseDataBlock(input2, onProgress) {
2532
+ const parser211 = this.parseDataBlockIncremental(input2);
2533
+ while (true) {
2534
+ const next = parser211.next();
2535
+ if (next.done === true) {
2536
+ return next.value;
2537
+ }
2538
+ onProgress?.(next.value);
2539
+ }
2540
+ }
2541
+ /**
2542
+ * Cooperative variant of parseDataBlock: identical parse (same generator
2543
+ * body), but periodically awaits a macrotask so the event loop can run —
2544
+ * browsers repaint progress UI, watchdog timers fire, and the tab is not
2545
+ * flagged as stalled during a large parse. Issue #301 §2.
1960
2546
  *
1961
2547
  * @param input The input parsing buffer, in the data section.
2548
+ * @param onProgress Optional byte-cursor progress callback.
2549
+ * @param yieldIntervalMs Minimum ms between event-loop yields.
2550
+ * @return {Promise<BlockParseResult>} The parsing result, including the
2551
+ * index and result enum.
2552
+ */
2553
+ async parseDataBlockAsync(input2, onProgress, yieldIntervalMs = DEFAULT_PARSE_YIELD_INTERVAL_MS) {
2554
+ const parser211 = this.parseDataBlockIncremental(input2);
2555
+ let lastYield = Date.now();
2556
+ while (true) {
2557
+ const next = parser211.next();
2558
+ if (next.done === true) {
2559
+ return next.value;
2560
+ }
2561
+ onProgress?.(next.value);
2562
+ if (Date.now() - lastYield >= yieldIntervalMs) {
2563
+ await yieldToEventLoop();
2564
+ lastYield = Date.now();
2565
+ }
2566
+ }
2567
+ }
2568
+ /**
2569
+ * Parse the data block of a step file, indexing it, suspending with the
2570
+ * current byte cursor every PARSE_PROGRESS_ELEMENT_MASK + 1 elements so
2571
+ * drivers can report progress (and optionally yield to the event loop)
2572
+ * without the loop body diverging between sync and async paths.
2573
+ *
2574
+ * @param input The input parsing buffer, in the data section.
2575
+ * @yields {number} The current byte cursor within the input buffer.
1962
2576
  * @return {BlockParseResult} The parsing result, including the index and result enum.
1963
2577
  */
1964
- parseDataBlock(input2) {
2578
+ *parseDataBlockIncremental(input2) {
1965
2579
  const indexResult = { elements: [] };
1966
2580
  const match = input2.match;
1967
2581
  const comment = () => match(commentParser2);
@@ -2097,7 +2711,11 @@ var StepParser = class extends StepHeaderParser {
2097
2711
  });
2098
2712
  }
2099
2713
  };
2714
+ let parsedElementCount = 0;
2100
2715
  while (input2.unfinished) {
2716
+ if ((++parsedElementCount & PARSE_PROGRESS_ELEMENT_MASK) === 0) {
2717
+ yield input2.cursor;
2718
+ }
2101
2719
  if (!charws(HASH2)) {
2102
2720
  if (tokenws(END_SECTION)) {
2103
2721
  return parseResult2(ParseResult.COMPLETE);
@@ -4820,6 +5438,20 @@ var StepModelBase = class {
4820
5438
  const distinctTypes = types.length === 1 ? types[0].query : new Set(types.flatMap((type) => type.query));
4821
5439
  return this.from(this.typeIndex.cursor(...distinctTypes), true);
4822
5440
  }
5441
+ /**
5442
+ * Count entities of a set of types (including sub-types) without iterating
5443
+ * or materializing them — reads the type index's prefix sums, so it's cheap
5444
+ * enough to call up front for progress totals (see core/progress.ts).
5445
+ * Multi-mapped elements can be counted once per matching mapping, so treat
5446
+ * this as an upper bound; see MultiIndexSet.count.
5447
+ *
5448
+ * @param types The list of types to count.
5449
+ * @return {number} The number of matching entities.
5450
+ */
5451
+ typeCount(...types) {
5452
+ const distinctTypes = types.length === 1 ? types[0].query : new Set(types.flatMap((type) => type.query));
5453
+ return this.typeIndex.count(...distinctTypes);
5454
+ }
4823
5455
  /**
4824
5456
  * Get the non empty type IDs for this.
4825
5457
  *
@@ -69269,6 +69901,12 @@ var SingleIndexSetCursor = class _SingleIndexSetCursor {
69269
69901
  };
69270
69902
 
69271
69903
  // compiled/src/indexing/multi_index_set.js
69904
+ function popCount32(value) {
69905
+ let result = value - (value >> 1 & 1431655765);
69906
+ result = (result & 858993459) + (result >> 2 & 858993459);
69907
+ result = result + (result >> 4) & 252645135;
69908
+ return result * 16843009 >> 24;
69909
+ }
69272
69910
  var MultiIndexSet = class {
69273
69911
  /**
69274
69912
  * Construct this with a prefix sum table and matching elements table.
@@ -69314,6 +69952,34 @@ var MultiIndexSet = class {
69314
69952
  const indexEnd = prefixSum[indexType + 1] * 2;
69315
69953
  return indexSetPointQuery32(localID, this.elements_, indexOffset, indexEnd);
69316
69954
  }
69955
+ /**
69956
+ * Count of items for a set of types without materializing entities —
69957
+ * popcounts the packed one-hot blocks per type (the prefix sums index
69958
+ * 32-element blocks, not items), so it's O(blocks), thousands of times
69959
+ * cheaper than iterating a cursor. Per-type ranges are disjoint, but an
69960
+ * element multi-mapped under several of the queried types counts once per
69961
+ * mapping (matching what a cursor union would visit), so treat multi-type
69962
+ * counts as an upper bound (fine for progress totals, its motivating use).
69963
+ *
69964
+ * @param indexTypes The list of types to count.
69965
+ * @return {number} The summed count for the given types.
69966
+ */
69967
+ count(...indexTypes) {
69968
+ const prefixSum = this.prefixSumTable_;
69969
+ const elements = this.elements_;
69970
+ let result = 0;
69971
+ for (const indexType of indexTypes) {
69972
+ if (indexType >= prefixSum.length - 1) {
69973
+ continue;
69974
+ }
69975
+ const blockStart = prefixSum[indexType] * 2;
69976
+ const blockEnd = prefixSum[indexType + 1] * 2;
69977
+ for (let where = blockStart; where < blockEnd; where += 2) {
69978
+ result += popCount32(elements[where + 1]);
69979
+ }
69980
+ }
69981
+ return result;
69982
+ }
69317
69983
  /**
69318
69984
  * Get a cursor that lets you iterate over the union of the sets of multiple indices.
69319
69985
  *
@@ -69411,18 +70077,6 @@ var CanonicalMeshType;
69411
70077
  CanonicalMeshType2[CanonicalMeshType2["BUFFER_GEOMETRY"] = 0] = "BUFFER_GEOMETRY";
69412
70078
  })(CanonicalMeshType || (CanonicalMeshType = {}));
69413
70079
 
69414
- // compiled/dependencies/conway-geom/interface/conway_geometry.js
69415
- var wasmType = "";
69416
- var dynamicImport = new Function("module", "return import(module)");
69417
-
69418
- // compiled/dependencies/conway-geom/interface/material_object.js
69419
- var BlendMode;
69420
- (function(BlendMode2) {
69421
- BlendMode2[BlendMode2["OPAQUE"] = 0] = "OPAQUE";
69422
- BlendMode2[BlendMode2["BLEND"] = 1] = "BLEND";
69423
- BlendMode2[BlendMode2["MASK"] = 2] = "MASK";
69424
- })(BlendMode || (BlendMode = {}));
69425
-
69426
70080
  // compiled/src/core/canonical_material.js
69427
70081
  var ROUGNESS_CONVERSION_FACTOR = 2;
69428
70082
  function roughnessToExponent(roughness) {
@@ -70035,403 +70689,30 @@ var IfcStepParser = class extends StepParser {
70035
70689
  * Parse data to the model
70036
70690
  *
70037
70691
  * @param input The parsing buffer, set to user data, to read.
70692
+ * @param onProgress Optional byte-cursor progress callback for the data parse.
70038
70693
  * @return {[ParseResult, IfcStepModel | undefined]} The parse result as well as the model,
70039
70694
  * if it can be extracted.
70040
70695
  */
70041
- parseDataToModel(input2) {
70042
- const [itemIndex, parseResult2] = this.parseDataBlock(input2);
70696
+ parseDataToModel(input2, onProgress) {
70697
+ const [itemIndex, parseResult2] = this.parseDataBlock(input2, onProgress);
70043
70698
  return [parseResult2, new IfcStepModel(input2.buffer, itemIndex.elements)];
70044
70699
  }
70045
- };
70046
- IfcStepParser.Instance = new IfcStepParser();
70047
- var ifc_step_parser_default = IfcStepParser;
70048
-
70049
- // compiled/src/version/version.js
70050
- var versionString = "Conway Web-Ifc Shim v1.378.1185";
70051
-
70052
- // compiled/src/statistics/statistics.js
70053
- var Statistics = class {
70054
- // Getters and setters
70055
- /**
70056
- *
70057
- * @return {string | undefined} - load status or undefined
70058
- */
70059
- getLoadStatus() {
70060
- return this.loadStatus;
70061
- }
70062
- /**
70063
- *
70064
- * @param value - load status
70065
- */
70066
- setLoadStatus(value) {
70067
- this.loadStatus = value;
70068
- }
70069
- /**
70070
- *
70071
- * @return {string | undefined} - project name or undefined
70072
- */
70073
- getProjectName() {
70074
- return this.projectName;
70075
- }
70076
- /**
70077
- *
70078
- * @param value - project name
70079
- */
70080
- setProjectName(value) {
70081
- this.projectName = value;
70082
- }
70083
- /**
70084
- *
70085
- * @return {string | undefined} - version or undefined
70086
- */
70087
- getVersion() {
70088
- return this.version;
70089
- }
70090
- /**
70091
- *
70092
- * @param value - version
70093
- */
70094
- setVersion(value) {
70095
- this.version = value;
70096
- }
70097
- /**
70098
- *
70099
- * @return {number | undefined} - parse time or undefined
70100
- */
70101
- getParseTime() {
70102
- return this.parseTime;
70103
- }
70104
- /**
70105
- *
70106
- * @param value - parse time
70107
- */
70108
- setParseTime(value) {
70109
- this.parseTime = value;
70110
- }
70111
- /**
70112
- *
70113
- * @return {number | undefined} - geometry parse time or undefined
70114
- */
70115
- getGeometryTime() {
70116
- return this.geometryTime;
70117
- }
70118
- /**
70119
- *
70120
- * @param value - geometry parse time
70121
- */
70122
- setGeometryTime(value) {
70123
- this.geometryTime = value;
70124
- }
70125
- /**
70126
- *
70127
- * @return {number | undefined} - total execution time or undefined
70128
- */
70129
- getTotalTime() {
70130
- return this.totalTime;
70131
- }
70132
- /**
70133
- *
70134
- * @param value - total execution time
70135
- */
70136
- setTotalTime(value) {
70137
- this.totalTime = value;
70138
- }
70139
- /**
70140
- *
70141
- * @return {number | undefined} - geometry memory or undefined
70142
- */
70143
- getGeometryMemory() {
70144
- return this.geometryMemory;
70145
- }
70146
- /**
70147
- *
70148
- * @param value - geometry memory
70149
- */
70150
- setGeometryMemory(value) {
70151
- this.geometryMemory = value;
70152
- }
70153
- /**
70154
- *
70155
- * @return {string | undefined} - preprocessor version or undefined
70156
- */
70157
- getPreprocessorVersion() {
70158
- return this.preprocessorVersion;
70159
- }
70160
- /**
70161
- *
70162
- * @param value - preprocessor version
70163
- */
70164
- setPreprocessorVersion(value) {
70165
- this.preprocessorVersion = value;
70166
- }
70167
- /**
70168
- *
70169
- * @return {string | undefined} - originating system or undefined
70170
- */
70171
- getOriginatingSystem() {
70172
- return this.originatingSystem;
70173
- }
70174
- /**
70175
- *
70176
- * @param value - originating system
70177
- */
70178
- setOriginatingSystem(value) {
70179
- this.originatingSystem = value;
70180
- }
70181
- /**
70182
- *
70183
- * @return {string | undefined} - memory statistics or undefined
70184
- */
70185
- getMemoryStatistics() {
70186
- return this.memoryStatistics;
70187
- }
70188
- /**
70189
- *
70190
- * @param value - memory statistics
70191
- */
70192
- setMemoryStatistics(value) {
70193
- this.memoryStatistics = value;
70194
- }
70195
- /**
70196
- * prints statistics
70197
- */
70198
- printStatistics() {
70199
- const date = /* @__PURE__ */ new Date();
70200
- const options = {
70201
- year: "numeric",
70202
- month: "short",
70203
- day: "numeric",
70204
- hour: "2-digit",
70205
- minute: "2-digit",
70206
- second: "2-digit",
70207
- timeZone: "UTC"
70208
- };
70209
- const dateString = date.toLocaleDateString("en-US", options).replace(/,/g, "");
70210
- const versionMatch = versionString.match(/v(\d+\.\d+\.\d+)/);
70211
- let conwayVersionNumber;
70212
- if (versionMatch !== null) {
70213
- conwayVersionNumber = versionMatch[1];
70214
- } else {
70215
- conwayVersionNumber = "Version Not Found";
70216
- }
70217
- let versionStr;
70218
- if (this.version !== void 0) {
70219
- const match = this.version.match(/'([^']+)'/);
70220
- if (match) {
70221
- versionStr = match[1];
70222
- } else {
70223
- versionStr = "No match found";
70224
- }
70225
- } else {
70226
- versionStr = "Version not defined";
70227
- }
70228
- console.log(`[${dateString}]: Load Status: ${this.loadStatus}, Project Name: ${this.projectName}, Version: ${versionStr}, Conway Version: ${conwayVersionNumber}-${wasmType}, Parse Time: ${this.parseTime} ms, Geometry Time: ${this.geometryTime} ms, Total Time: ${this.totalTime} ms, Geometry Memory: ${this.geometryMemory?.toFixed(3)} MB, Memory Statistics: ${this.memoryStatistics}, Preprocessor Version: ${this.preprocessorVersion}, Originating System: ${this.originatingSystem}`);
70229
- }
70230
- };
70231
-
70232
- // compiled/src/utilities/environment.js
70233
- var EnvironmentType;
70234
- (function(EnvironmentType2) {
70235
- EnvironmentType2[EnvironmentType2["BROWSER"] = 0] = "BROWSER";
70236
- EnvironmentType2[EnvironmentType2["NODE"] = 1] = "NODE";
70237
- EnvironmentType2[EnvironmentType2["BOTH_FEATURES"] = 2] = "BOTH_FEATURES";
70238
- EnvironmentType2[EnvironmentType2["UNKNOWN"] = 3] = "UNKNOWN";
70239
- })(EnvironmentType || (EnvironmentType = {}));
70240
- var Environment = class {
70241
- /**
70242
- * determines the runtime environment
70243
- */
70244
- static checkEnvironment() {
70245
- const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined";
70246
- const isNode = typeof global !== "undefined" && typeof global.process !== "undefined" && global.process.versions && global.process.versions.node;
70247
- if (isBrowser && isNode) {
70248
- logger_default.info("This environment has features of both Node.js and a web browser.");
70249
- this.environmentType = EnvironmentType.BOTH_FEATURES;
70250
- } else if (isNode) {
70251
- this.environmentType = EnvironmentType.NODE;
70252
- } else if (isBrowser) {
70253
- this.environmentType = EnvironmentType.BROWSER;
70254
- } else {
70255
- logger_default.info("ENVIRONMENT === unknown");
70256
- this.environmentType = EnvironmentType.UNKNOWN;
70257
- }
70258
- }
70259
- };
70260
- Environment.environmentType = EnvironmentType.UNKNOWN;
70261
- var environment_default = Environment;
70262
-
70263
- // compiled/src/logging/logger.js
70264
- var Logger = class _Logger {
70265
- /**
70266
- * Detects environment and initializes wasm callbacks
70267
- */
70268
- static initializeWasmCallbacks() {
70269
- const environment = environment_default.environmentType;
70270
- if (environment === EnvironmentType.BROWSER) {
70271
- const globalScope = window;
70272
- globalScope.logInfo = _Logger.info;
70273
- globalScope.logWarning = _Logger.warning;
70274
- globalScope.logError = _Logger.error;
70275
- } else if (environment === EnvironmentType.NODE || environment === EnvironmentType.BOTH_FEATURES) {
70276
- const globalScope = global;
70277
- globalScope.logInfo = _Logger.info;
70278
- globalScope.logWarning = _Logger.warning;
70279
- globalScope.logError = _Logger.error;
70280
- }
70281
- }
70282
- /**
70283
- *
70284
- * @param message - log message
70285
- * @param level - log level
70286
- * @return {number} log index
70287
- */
70288
- static findLogIndex(message, level) {
70289
- return _Logger.logs.findIndex((log) => log.message === message && log.level === level);
70290
- }
70291
- /**
70292
- *
70293
- * @param level - log level
70294
- * @param message - log message
70295
- */
70296
- static log(level, message) {
70297
- const baseMessage = message.split(" expressID: ")[0];
70298
- const data = message.split(" expressID: ")[1];
70299
- const index = _Logger.findLogIndex(baseMessage, level);
70300
- let logEntry;
70301
- if (index >= 0) {
70302
- _Logger.logs[index].count += 1;
70303
- if (data !== void 0) {
70304
- _Logger.logs[index].expressIDs = _Logger.logs[index].expressIDs || /* @__PURE__ */ new Set();
70305
- _Logger.logs[index].expressIDs.add(data);
70306
- }
70307
- logEntry = _Logger.logs[index];
70308
- } else {
70309
- logEntry = {
70310
- level,
70311
- message: baseMessage,
70312
- count: 1,
70313
- expressIDs: data ? /* @__PURE__ */ new Set([data]) : /* @__PURE__ */ new Set()
70314
- };
70315
- _Logger.logs.push(logEntry);
70316
- }
70317
- _Logger.proxies.forEach((proxy) => proxy.log(logEntry));
70318
- }
70319
- /**
70320
- * Compresses similar logs to a single line
70321
- */
70322
- static compressLogs() {
70323
- const compressedLogs = [];
70324
- _Logger.logs.forEach((log) => {
70325
- const existingLog = compressedLogs.find((l) => l.message === log.message && l.level === log.level);
70326
- if (existingLog !== void 0) {
70327
- existingLog.count += log.count;
70328
- if (log.expressIDs !== void 0) {
70329
- log.expressIDs.forEach((d) => existingLog.expressIDs?.add(d));
70330
- }
70331
- } else {
70332
- compressedLogs.push({
70333
- ...log,
70334
- expressIDs: log.expressIDs ? new Set(log.expressIDs) : /* @__PURE__ */ new Set()
70335
- });
70336
- }
70337
- });
70338
- _Logger.logs = compressedLogs;
70339
- }
70340
- /**
70341
- *
70342
- * @param proxy - a log proxy
70343
- */
70344
- static addProxy(proxy) {
70345
- _Logger.proxies.push(proxy);
70346
- }
70347
- /**
70348
- *
70349
- * @param message - log message
70350
- */
70351
- static info(message) {
70352
- _Logger.log("info", message);
70353
- }
70354
- /**
70355
- *
70356
- * @param modelID
70357
- * @return {Statistics | undefined}
70358
- */
70359
- static getStatistics(modelID) {
70360
- return this.statistics.get(modelID);
70361
- }
70362
- /**
70363
- * Create the statistics for a model ID.
70364
- *
70365
- * @param modelID The model ID to create statistics for
70366
- *
70367
- * @return {Statistics} The created statistics object.
70368
- */
70369
- static createStatistics(modelID) {
70370
- const statistics = new Statistics();
70371
- this.statistics.set(modelID, statistics);
70372
- return statistics;
70373
- }
70374
- /**
70375
- *
70376
- * @param modelID
70377
- */
70378
- static printStatistics(modelID) {
70379
- const statistics_ = this.statistics.get(modelID);
70380
- if (statistics_ !== void 0) {
70381
- statistics_.printStatistics();
70382
- } else {
70383
- _Logger.error(`No statistics for modelID: ${modelID}`);
70384
- }
70385
- }
70386
- /**
70387
- * Compresses the logs if they haven't been compressed,
70388
- * then returns a list of just the errors.
70389
- *
70390
- * @return {LogEntry[]} The errors.
70391
- */
70392
- static getErrors() {
70393
- _Logger.compressLogs();
70394
- return this.logs.filter((where) => where.level === "error");
70395
- }
70396
70700
  /**
70701
+ * Cooperative variant of parseDataToModel — periodically yields to the
70702
+ * event loop mid-parse (see StepParser.parseDataBlockAsync, issue #301 §2).
70397
70703
  *
70398
- * @param message - log message
70399
- */
70400
- static warning(message) {
70401
- _Logger.log("warning", message);
70402
- }
70403
- /**
70404
- *
70405
- * @param message - log message
70406
- */
70407
- static error(message) {
70408
- _Logger.log("error", message);
70409
- }
70410
- /**
70411
- *
70412
- * @return {LogEntry[]} - list of logs
70413
- */
70414
- static getLogs() {
70415
- return _Logger.logs;
70416
- }
70417
- /**
70418
- * display logs in a table
70419
- */
70420
- static displayLogs() {
70421
- _Logger.compressLogs();
70422
- console.table(_Logger.logs);
70423
- }
70424
- /**
70425
- * clear logs
70704
+ * @param input The parsing buffer, set to user data, to read.
70705
+ * @param onProgress Optional byte-cursor progress callback for the data parse.
70706
+ * @return {Promise<[ParseResult, IfcStepModel | undefined]>} The parse result as well
70707
+ * as the model, if it can be extracted.
70426
70708
  */
70427
- static clearLogs() {
70428
- _Logger.logs = [];
70709
+ async parseDataToModelAsync(input2, onProgress) {
70710
+ const [itemIndex, parseResult2] = await this.parseDataBlockAsync(input2, onProgress);
70711
+ return [parseResult2, new IfcStepModel(input2.buffer, itemIndex.elements)];
70429
70712
  }
70430
70713
  };
70431
- Logger.logs = [];
70432
- Logger.proxies = [];
70433
- Logger.statistics = /* @__PURE__ */ new Map();
70434
- var logger_default = Logger;
70714
+ IfcStepParser.Instance = new IfcStepParser();
70715
+ var ifc_step_parser_default = IfcStepParser;
70435
70716
 
70436
70717
  // compiled/examples/browser.js
70437
70718
  environment_default.checkEnvironment();