@2112-lab/central-plant 0.1.1 → 0.1.2

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.
@@ -1,114 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.js');
6
-
7
- /**
8
- * ConnectionManager class
9
- * Handles object connections in the pathfinding system with improved safety for missing data
10
- */
11
- var ConnectionManager = /*#__PURE__*/function () {
12
- function ConnectionManager(sceneManager) {
13
- _rollupPluginBabelHelpers.classCallCheck(this, ConnectionManager);
14
- this.sceneManager = sceneManager;
15
- }
16
-
17
- /**
18
- * Safely cluster connections by shared objects
19
- * @param {Array<Object>} connections - Array of connections between objects (or null/undefined)
20
- * @returns {Array<Object>} Array of clusters
21
- */
22
- return _rollupPluginBabelHelpers.createClass(ConnectionManager, [{
23
- key: "clusterConnections",
24
- value: function clusterConnections(connections) {
25
- // Safety check for undefined or non-array connections
26
- if (!connections || !Array.isArray(connections)) {
27
- console.warn('ConnectionManager: No valid connections provided');
28
- return [];
29
- }
30
- var clusters = new Map(); // Map of object UUID to its cluster
31
- var clusterMap = new Map(); // Map of cluster ID to set of object UUIDs
32
- var nextClusterId = 0;
33
-
34
- // Process each connection
35
- connections.forEach(function (conn) {
36
- // Safety check for invalid connection format
37
- if (!conn || _rollupPluginBabelHelpers["typeof"](conn) !== 'object' || !conn.from || !conn.to) {
38
- console.warn('ConnectionManager: Invalid connection format', conn);
39
- return;
40
- }
41
- var from = conn.from,
42
- to = conn.to;
43
-
44
- // If neither object is in a cluster, create new cluster
45
- if (!clusters.has(from) && !clusters.has(to)) {
46
- var clusterId = nextClusterId++;
47
- clusters.set(from, clusterId);
48
- clusters.set(to, clusterId);
49
- clusterMap.set(clusterId, new Set([from, to]));
50
- }
51
- // If only 'from' is in a cluster, add 'to' to that cluster
52
- else if (clusters.has(from) && !clusters.has(to)) {
53
- var _clusterId = clusters.get(from);
54
- clusters.set(to, _clusterId);
55
- clusterMap.get(_clusterId).add(to);
56
- }
57
- // If only 'to' is in a cluster, add 'from' to that cluster
58
- else if (!clusters.has(from) && clusters.has(to)) {
59
- var _clusterId2 = clusters.get(to);
60
- clusters.set(from, _clusterId2);
61
- clusterMap.get(_clusterId2).add(from);
62
- }
63
- // If both are in different clusters, merge the clusters
64
- else if (clusters.has(from) && clusters.has(to) && clusters.get(from) !== clusters.get(to)) {
65
- var fromCluster = clusters.get(from);
66
- var toCluster = clusters.get(to);
67
- var fromObjects = clusterMap.get(fromCluster);
68
- var toObjects = clusterMap.get(toCluster);
69
-
70
- // Merge all objects from 'to' cluster into 'from' cluster
71
- var _iterator = _rollupPluginBabelHelpers.createForOfIteratorHelper(toObjects),
72
- _step;
73
- try {
74
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
75
- var obj = _step.value;
76
- clusters.set(obj, fromCluster);
77
- fromObjects.add(obj);
78
- }
79
-
80
- // Delete the now-empty 'to' cluster
81
- } catch (err) {
82
- _iterator.e(err);
83
- } finally {
84
- _iterator.f();
85
- }
86
- clusterMap.delete(toCluster);
87
- }
88
- });
89
-
90
- // Convert clusters to array format
91
- var result = [];
92
- var _iterator2 = _rollupPluginBabelHelpers.createForOfIteratorHelper(clusterMap.entries()),
93
- _step2;
94
- try {
95
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
96
- var _step2$value = _rollupPluginBabelHelpers.slicedToArray(_step2.value, 2),
97
- clusterId = _step2$value[0],
98
- objectSet = _step2$value[1];
99
- result.push({
100
- id: clusterId,
101
- objects: Array.from(objectSet)
102
- });
103
- }
104
- } catch (err) {
105
- _iterator2.e(err);
106
- } finally {
107
- _iterator2.f();
108
- }
109
- return result;
110
- }
111
- }]);
112
- }();
113
-
114
- exports["default"] = ConnectionManager;
@@ -1,88 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.js');
6
- var ConnectionManager = require('./ConnectionManager.js');
7
-
8
- /**
9
- * Pathfinder class
10
- * Enhanced version with better error handling for missing data
11
- */
12
- var Pathfinder = /*#__PURE__*/function () {
13
- function Pathfinder(sceneData) {
14
- _rollupPluginBabelHelpers.classCallCheck(this, Pathfinder);
15
- this.sceneData = sceneData || {};
16
- this.connectionManager = new ConnectionManager["default"]();
17
- }
18
-
19
- /**
20
- * Find paths in the scene
21
- * @returns {Array} Array of paths
22
- */
23
- return _rollupPluginBabelHelpers.createClass(Pathfinder, [{
24
- key: "findPaths",
25
- value: function findPaths() {
26
- var _this = this;
27
- console.log('[DEBUG] Starting findPaths()');
28
- try {
29
- var connections = this.sceneData.connections;
30
-
31
- // Safety check for connections
32
- if (!connections || !Array.isArray(connections)) {
33
- console.warn('Pathfinder: No valid connections provided in scene data');
34
- return [];
35
- }
36
-
37
- // Create clusters from connections
38
- var clusters = this.connectionManager.clusterConnections(connections);
39
-
40
- // Return empty array if there are no valid clusters
41
- if (!clusters || !clusters.length) {
42
- console.log('Pathfinder: No valid connection clusters generated');
43
- return [];
44
- }
45
-
46
- // Process the clusters and generate paths
47
- // (Simplified implementation, the actual process would be more complex)
48
- var paths = [];
49
- clusters.forEach(function (cluster) {
50
- if (cluster && cluster.objects && Array.isArray(cluster.objects)) {
51
- // Generate path for this cluster
52
- var clusterPaths = _this._generatePathsForCluster(cluster);
53
- paths.push.apply(paths, _rollupPluginBabelHelpers.toConsumableArray(clusterPaths));
54
- }
55
- });
56
- return paths;
57
- } catch (error) {
58
- console.error('Pathfinder: Error finding paths:', error);
59
- return [];
60
- }
61
- }
62
-
63
- /**
64
- * Generate paths for a single cluster
65
- * @param {Object} cluster - The cluster to generate paths for
66
- * @returns {Array} Array of paths for this cluster
67
- * @private
68
- */
69
- }, {
70
- key: "_generatePathsForCluster",
71
- value: function _generatePathsForCluster(cluster) {
72
- // This is a placeholder implementation
73
- // In your actual system, this would use your existing pathfinding logic
74
- return cluster.objects.map(function (obj, index, arr) {
75
- if (index < arr.length - 1) {
76
- return {
77
- from: obj,
78
- to: arr[index + 1],
79
- path: [] // This would normally contain 3D points for the path
80
- };
81
- }
82
- return null;
83
- }).filter(Boolean);
84
- }
85
- }]);
86
- }();
87
-
88
- exports["default"] = Pathfinder;
@@ -1,488 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.js');
6
- require('three');
7
-
8
- function _interopNamespace(e) {
9
- if (e && e.__esModule) return e;
10
- var n = Object.create(null);
11
- if (e) {
12
- Object.keys(e).forEach(function (k) {
13
- if (k !== 'default') {
14
- var d = Object.getOwnPropertyDescriptor(e, k);
15
- Object.defineProperty(n, k, d.get ? d : {
16
- enumerable: true,
17
- get: function () { return e[k]; }
18
- });
19
- }
20
- });
21
- }
22
- n["default"] = e;
23
- return Object.freeze(n);
24
- }
25
-
26
- var ModelPreloader = /*#__PURE__*/function () {
27
- function ModelPreloader() {
28
- _rollupPluginBabelHelpers.classCallCheck(this, ModelPreloader);
29
- this.modelCache = new Map(); // Cache for loaded GLB models
30
- this.loadingPromises = new Map(); // Track ongoing loads to prevent duplicates
31
- this.isPreloading = false;
32
- this.preloadingPromise = null;
33
- this.componentDictionary = null;
34
-
35
- // Load GLTFLoader dynamically if available
36
- this.gltfLoader = null;
37
- this.initLoader();
38
- }
39
- return _rollupPluginBabelHelpers.createClass(ModelPreloader, [{
40
- key: "initLoader",
41
- value: function () {
42
- var _initLoader = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee() {
43
- var GLTFLoaderModule, _t;
44
- return _rollupPluginBabelHelpers.regenerator().w(function (_context) {
45
- while (1) switch (_context.n) {
46
- case 0:
47
- _context.p = 0;
48
- if (!(typeof window !== 'undefined')) {
49
- _context.n = 3;
50
- break;
51
- }
52
- _context.n = 1;
53
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('three')); });
54
- case 1:
55
- _context.v;
56
- _context.n = 2;
57
- return Promise.resolve().then(function () { return require('../node_modules/three/examples/jsm/loaders/GLTFLoader.js'); });
58
- case 2:
59
- GLTFLoaderModule = _context.v;
60
- this.gltfLoader = new GLTFLoaderModule.GLTFLoader();
61
- case 3:
62
- _context.n = 5;
63
- break;
64
- case 4:
65
- _context.p = 4;
66
- _t = _context.v;
67
- console.warn('Failed to initialize GLTFLoader:', _t);
68
- case 5:
69
- return _context.a(2);
70
- }
71
- }, _callee, this, [[0, 4]]);
72
- }));
73
- function initLoader() {
74
- return _initLoader.apply(this, arguments);
75
- }
76
- return initLoader;
77
- }()
78
- /**
79
- * Preload all models from the component dictionary
80
- * @param {Object} componentDictionary - The component dictionary object
81
- * @returns {Promise} Promise that resolves when all models are loaded
82
- */
83
- }, {
84
- key: "preloadAllModels",
85
- value: (function () {
86
- var _preloadAllModels = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee3(componentDictionary) {
87
- var _this = this;
88
- return _rollupPluginBabelHelpers.regenerator().w(function (_context4) {
89
- while (1) switch (_context4.n) {
90
- case 0:
91
- console.log('preloadAllModels called with:', componentDictionary ? "Dictionary of ".concat(Object.keys(componentDictionary).length, " components") : 'No dictionary provided');
92
- if (!this.isPreloading) {
93
- _context4.n = 1;
94
- break;
95
- }
96
- console.log('⏳ Preloading already in progress, returning existing promise');
97
- return _context4.a(2, this.preloadingPromise);
98
- case 1:
99
- if (componentDictionary) {
100
- _context4.n = 2;
101
- break;
102
- }
103
- console.error('❌ Component dictionary is required to preload models');
104
- return _context4.a(2, {
105
- total: 0,
106
- success: 0,
107
- failed: 1,
108
- skipped: 0,
109
- error: 'Component dictionary is required'
110
- });
111
- case 2:
112
- this.isPreloading = true;
113
- this.componentDictionary = componentDictionary;
114
-
115
- // Create a promise to track overall preloading
116
- this.preloadingPromise = new Promise(/*#__PURE__*/function () {
117
- var _ref = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee2(resolve) {
118
- var results, modelKeysSet, loadPromises, _iterator, _step, _loop, _t2, _t3;
119
- return _rollupPluginBabelHelpers.regenerator().w(function (_context3) {
120
- while (1) switch (_context3.n) {
121
- case 0:
122
- _context3.p = 0;
123
- console.log("\uD83D\uDE80 Starting preload of models from dictionary with ".concat(Object.keys(componentDictionary).length, " components"));
124
- results = {
125
- total: 0,
126
- success: 0,
127
- failed: 0,
128
- skipped: 0,
129
- modelKeys: []
130
- }; // Extract all unique model keys from the dictionary
131
- modelKeysSet = new Set();
132
- Object.values(componentDictionary).forEach(function (component) {
133
- if (component.modelKey) {
134
- modelKeysSet.add(component.modelKey);
135
- }
136
- });
137
- results.total = modelKeysSet.size;
138
- results.modelKeys = Array.from(modelKeysSet);
139
-
140
- // Load basic models first
141
- console.log("\uD83D\uDCE6 Found ".concat(results.total, " unique model keys to preload"));
142
-
143
- // Return early if no models to load
144
- if (!(results.total === 0)) {
145
- _context3.n = 1;
146
- break;
147
- }
148
- _this.isPreloading = false;
149
- resolve(results);
150
- return _context3.a(2);
151
- case 1:
152
- // Process each model key
153
- loadPromises = [];
154
- _iterator = _rollupPluginBabelHelpers.createForOfIteratorHelper(results.modelKeys);
155
- _context3.p = 2;
156
- _loop = /*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _loop() {
157
- var modelKey, modelUrl;
158
- return _rollupPluginBabelHelpers.regenerator().w(function (_context2) {
159
- while (1) switch (_context2.n) {
160
- case 0:
161
- modelKey = _step.value;
162
- modelUrl = _this.getModelUrlFromKey(modelKey);
163
- if (modelUrl) {
164
- loadPromises.push(_this.preloadModel(modelKey, modelUrl).then(function () {
165
- results.success++;
166
- }).catch(function (error) {
167
- console.error("\u274C Failed to preload model ".concat(modelKey, ":"), error);
168
- results.failed++;
169
- }));
170
- } else {
171
- console.warn("\u26A0\uFE0F No URL found for model key: ".concat(modelKey));
172
- results.skipped++;
173
- }
174
- case 1:
175
- return _context2.a(2);
176
- }
177
- }, _loop);
178
- });
179
- _iterator.s();
180
- case 3:
181
- if ((_step = _iterator.n()).done) {
182
- _context3.n = 5;
183
- break;
184
- }
185
- return _context3.d(_rollupPluginBabelHelpers.regeneratorValues(_loop()), 4);
186
- case 4:
187
- _context3.n = 3;
188
- break;
189
- case 5:
190
- _context3.n = 7;
191
- break;
192
- case 6:
193
- _context3.p = 6;
194
- _t2 = _context3.v;
195
- _iterator.e(_t2);
196
- case 7:
197
- _context3.p = 7;
198
- _iterator.f();
199
- return _context3.f(7);
200
- case 8:
201
- _context3.n = 9;
202
- return Promise.allSettled(loadPromises);
203
- case 9:
204
- console.log('✅ Model preloading completed with results:', results);
205
- _this.isPreloading = false;
206
- resolve(results);
207
- _context3.n = 11;
208
- break;
209
- case 10:
210
- _context3.p = 10;
211
- _t3 = _context3.v;
212
- console.error('❌ Error during model preloading:', _t3);
213
- _this.isPreloading = false;
214
- resolve({
215
- total: 0,
216
- success: 0,
217
- failed: 1,
218
- skipped: 0,
219
- error: _t3.message
220
- });
221
- case 11:
222
- return _context3.a(2);
223
- }
224
- }, _callee2, null, [[2, 6, 7, 8], [0, 10]]);
225
- }));
226
- return function (_x2) {
227
- return _ref.apply(this, arguments);
228
- };
229
- }());
230
- return _context4.a(2, this.preloadingPromise);
231
- }
232
- }, _callee3, this);
233
- }));
234
- function preloadAllModels(_x) {
235
- return _preloadAllModels.apply(this, arguments);
236
- }
237
- return preloadAllModels;
238
- }()
239
- /**
240
- * Load a component model by its ID
241
- * @param {string} componentId - The component ID from the dictionary
242
- * @param {Function} callback - Optional callback function to call when loading completes
243
- * @returns {Promise} Promise that resolves with the loaded model
244
- */
245
- )
246
- }, {
247
- key: "loadComponentById",
248
- value: (function () {
249
- var _loadComponentById = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee4(componentId, callback) {
250
- var component, modelUrl, model, _t4;
251
- return _rollupPluginBabelHelpers.regenerator().w(function (_context5) {
252
- while (1) switch (_context5.n) {
253
- case 0:
254
- if (this.componentDictionary) {
255
- _context5.n = 1;
256
- break;
257
- }
258
- console.warn('⚠️ No component dictionary available for loadComponentById');
259
- if (callback) callback(null);
260
- return _context5.a(2, null);
261
- case 1:
262
- component = this.componentDictionary[componentId];
263
- if (!(!component || !component.modelKey)) {
264
- _context5.n = 2;
265
- break;
266
- }
267
- console.warn("\u26A0\uFE0F No component or model key found for ID: ".concat(componentId));
268
- if (callback) callback(null);
269
- return _context5.a(2, null);
270
- case 2:
271
- _context5.p = 2;
272
- modelUrl = this.getModelUrlFromKey(component.modelKey);
273
- _context5.n = 3;
274
- return this.preloadModel(component.modelKey, modelUrl);
275
- case 3:
276
- model = _context5.v;
277
- if (callback) callback(model);
278
- return _context5.a(2, model);
279
- case 4:
280
- _context5.p = 4;
281
- _t4 = _context5.v;
282
- console.error("\u274C Failed to load component model for ID: ".concat(componentId), _t4);
283
- if (callback) callback(null);
284
- return _context5.a(2, null);
285
- }
286
- }, _callee4, this, [[2, 4]]);
287
- }));
288
- function loadComponentById(_x3, _x4) {
289
- return _loadComponentById.apply(this, arguments);
290
- }
291
- return loadComponentById;
292
- }()
293
- /**
294
- * Get a cached model by its key
295
- * @param {string} modelKey - The model key
296
- * @returns {Object|null} The loaded model or null if not found
297
- */
298
- )
299
- }, {
300
- key: "getCachedModel",
301
- value: function getCachedModel(modelKey) {
302
- return this.modelCache.get(modelKey) || null;
303
- }
304
-
305
- /**
306
- * Get all cache keys
307
- * @returns {Array} Array of model keys in the cache
308
- */
309
- }, {
310
- key: "getCacheKeys",
311
- value: function getCacheKeys() {
312
- return Array.from(this.modelCache.keys());
313
- }
314
-
315
- /**
316
- * Convert a model key to a URL
317
- * @param {string} modelKey - The model key from the dictionary
318
- * @returns {string} The URL for the model
319
- */
320
- }, {
321
- key: "getModelUrlFromKey",
322
- value: function getModelUrlFromKey(modelKey) {
323
- // The modelKey already includes the .glb extension from the component dictionary
324
- return modelKey;
325
- }
326
-
327
- /**
328
- * Preload a specific model
329
- * @param {string} modelKey - The model key
330
- * @param {string} modelUrl - The URL to the model
331
- * @returns {Promise} Promise that resolves with the loaded model
332
- */
333
- }, {
334
- key: "preloadModel",
335
- value: (function () {
336
- var _preloadModel = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee5(modelKey, modelUrl) {
337
- var _this2 = this;
338
- var loadPromise;
339
- return _rollupPluginBabelHelpers.regenerator().w(function (_context6) {
340
- while (1) switch (_context6.n) {
341
- case 0:
342
- if (this.gltfLoader) {
343
- _context6.n = 2;
344
- break;
345
- }
346
- _context6.n = 1;
347
- return this.initLoader();
348
- case 1:
349
- if (this.gltfLoader) {
350
- _context6.n = 2;
351
- break;
352
- }
353
- throw new Error('GLTFLoader is not available');
354
- case 2:
355
- if (!this.modelCache.has(modelKey)) {
356
- _context6.n = 3;
357
- break;
358
- }
359
- return _context6.a(2, this.modelCache.get(modelKey));
360
- case 3:
361
- if (!this.loadingPromises.has(modelKey)) {
362
- _context6.n = 4;
363
- break;
364
- }
365
- return _context6.a(2, this.loadingPromises.get(modelKey));
366
- case 4:
367
- // Start loading the model
368
- loadPromise = new Promise(function (resolve, reject) {
369
- _this2.gltfLoader.load(modelUrl, function (gltf) {
370
- console.log("\u2705 Successfully loaded model: ".concat(modelKey, " from ").concat(modelUrl));
371
- _this2.modelCache.set(modelKey, gltf);
372
- _this2.loadingPromises.delete(modelKey);
373
- resolve(gltf);
374
- }, function (progress) {
375
- // Optional progress callback
376
- if (progress.lengthComputable) {
377
- progress.loaded / progress.total * 100;
378
- // console.log(`📥 Loading ${modelKey}: ${percentComplete.toFixed(1)}%`);
379
- }
380
- }, function (error) {
381
- console.error("\u274C Failed to load model ".concat(modelKey, " from ").concat(modelUrl, ":"), error);
382
-
383
- // Add more detailed error information
384
- if (error.message && error.message.includes('404')) {
385
- console.error(" File not found. Check if the model exists at: ".concat(modelUrl));
386
- } else if (error.message && error.message.includes('JSON')) {
387
- console.error(" Invalid GLB file format. The file may be corrupted or is not a valid GLB/GLTF file.");
388
- }
389
- _this2.loadingPromises.delete(modelKey);
390
- reject(error);
391
- });
392
- }); // Store the loading promise
393
- this.loadingPromises.set(modelKey, loadPromise);
394
- return _context6.a(2, loadPromise);
395
- }
396
- }, _callee5, this);
397
- }));
398
- function preloadModel(_x5, _x6) {
399
- return _preloadModel.apply(this, arguments);
400
- }
401
- return preloadModel;
402
- }()
403
- /**
404
- * Get a model from the cache
405
- * @param {string} modelKey - The model key
406
- * @returns {Object|null} The loaded model or null if not found
407
- */
408
- )
409
- }, {
410
- key: "getModel",
411
- value: function getModel(modelKey) {
412
- return this.modelCache.get(modelKey) || null;
413
- }
414
-
415
- /**
416
- * Clear the model cache
417
- */
418
- }, {
419
- key: "clearCache",
420
- value: function clearCache() {
421
- this.modelCache.clear();
422
- }
423
-
424
- /**
425
- * Get statistics about the model cache
426
- * @returns {Object} Cache statistics
427
- */
428
- }, {
429
- key: "getCacheStats",
430
- value: function getCacheStats() {
431
- return {
432
- cacheSize: this.modelCache.size,
433
- cachedModels: Array.from(this.modelCache.keys()),
434
- loading: Array.from(this.loadingPromises.keys()),
435
- isPreloading: this.isPreloading
436
- };
437
- }
438
- }]);
439
- }(); // Create singleton instance with explicit methods
440
- var modelPreloader = new ModelPreloader();
441
-
442
- // Ensure the model preloader is fully initialized
443
- if (typeof window !== 'undefined') {
444
- // Only run in browser environment
445
- modelPreloader.initLoader().catch(function (err) {
446
- console.warn('Error initializing model preloader:', err);
447
- });
448
- }
449
-
450
- // Create a simple proxy object with all methods explicitly defined
451
- // This helps ensure webpack correctly recognizes all methods
452
- var explicitModelPreloader = {
453
- // Core methods from original implementation
454
- preloadAllModels: function preloadAllModels(componentDictionary) {
455
- return modelPreloader.preloadAllModels(componentDictionary);
456
- },
457
- preloadModel: function preloadModel(modelKey, modelUrl) {
458
- return modelPreloader.preloadModel(modelKey, modelUrl);
459
- },
460
- getModel: function getModel(modelKey) {
461
- return modelPreloader.getModel(modelKey);
462
- },
463
- clearCache: function clearCache() {
464
- return modelPreloader.clearCache();
465
- },
466
- getCacheStats: function getCacheStats() {
467
- return modelPreloader.getCacheStats();
468
- },
469
- getModelUrlFromKey: function getModelUrlFromKey(modelKey) {
470
- return modelPreloader.getModelUrlFromKey(modelKey);
471
- },
472
- // Added methods
473
- loadComponentById: function loadComponentById(componentId, callback) {
474
- return modelPreloader.loadComponentById(componentId, callback);
475
- },
476
- getCachedModel: function getCachedModel(modelKey) {
477
- return modelPreloader.getCachedModel(modelKey);
478
- },
479
- getCacheKeys: function getCacheKeys() {
480
- return modelPreloader.getCacheKeys();
481
- },
482
- // Original model cache access
483
- modelCache: modelPreloader.modelCache
484
- };
485
-
486
- exports.ModelPreloader = ModelPreloader;
487
- exports["default"] = explicitModelPreloader;
488
- exports.modelPreloader = explicitModelPreloader;