@2112-lab/central-plant 0.3.44 → 0.3.46

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.
@@ -37,7 +37,7 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
37
37
  * Initialize the CentralPlant manager
38
38
  *
39
39
  * @constructor
40
- * @version 0.3.44
40
+ * @version 0.3.46
41
41
  * @updated 2025-10-22
42
42
  *
43
43
  * @description Creates a new CentralPlant instance and initializes internal managers and utilities.
@@ -175,6 +175,32 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
175
175
  return this.internals.attachToComponent();
176
176
  }
177
177
 
178
+ /**
179
+ * Check if an object in the scene collides with any other objects
180
+ * @param {string} objectId - The UUID or originalUuid of the object to check
181
+ * @returns {Object|null} Collision info if detected, null otherwise
182
+ */
183
+ }, {
184
+ key: "checkCollision",
185
+ value: function checkCollision(objectId) {
186
+ if (!this.sceneViewer || !this.managers.collisionManager) {
187
+ console.warn('⚠️ checkCollision(): Scene viewer or collision manager not available');
188
+ return null;
189
+ }
190
+ var targetObject = null;
191
+ this.sceneViewer.scene.traverse(function (child) {
192
+ var _child$userData;
193
+ if (child.uuid === objectId || ((_child$userData = child.userData) === null || _child$userData === void 0 ? void 0 : _child$userData.originalUuid) === objectId) {
194
+ targetObject = child;
195
+ }
196
+ });
197
+ if (!targetObject) {
198
+ console.warn("\u26A0\uFE0F checkCollision(): Object with ID '".concat(objectId, "' not found"));
199
+ return null;
200
+ }
201
+ return this.managers.collisionManager.checkCollision(targetObject);
202
+ }
203
+
178
204
  /**
179
205
  * Initialize specific managers that need to be created after scene setup
180
206
  * @returns {boolean} True if post-scene managers were initialized successfully, false otherwise
@@ -855,6 +881,104 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
855
881
  return this.internals.addConnection(fromConnectorId, toConnectorId);
856
882
  }
857
883
 
884
+ /**
885
+ * Randomly connect available component connectors in the scene.
886
+ * Attempts to pair as many free connectors as possible.
887
+ * @returns {Array<Object>} List of added connections.
888
+ */
889
+ }, {
890
+ key: "addRandomConnections",
891
+ value: (function () {
892
+ var _addRandomConnections = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee3() {
893
+ var _this$sceneViewer4;
894
+ var connectors, scene, currentConns, busyConnectorIds, freeConnectors, i, j, _ref, added, from, _i, to, isCompatible, isDifferentParent, conn;
895
+ return _rollupPluginBabelHelpers.regenerator().w(function (_context3) {
896
+ while (1) switch (_context3.n) {
897
+ case 0:
898
+ connectors = [];
899
+ scene = (_this$sceneViewer4 = this.sceneViewer) === null || _this$sceneViewer4 === void 0 ? void 0 : _this$sceneViewer4.scene;
900
+ if (scene) {
901
+ _context3.n = 1;
902
+ break;
903
+ }
904
+ return _context3.a(2, []);
905
+ case 1:
906
+ // Find all free connectors in the scene
907
+ scene.traverse(function (obj) {
908
+ var _obj$userData;
909
+ if (((_obj$userData = obj.userData) === null || _obj$userData === void 0 ? void 0 : _obj$userData.objectType) === 'connector' && obj.uuid) {
910
+ connectors.push({
911
+ uuid: obj.uuid,
912
+ flow: obj.userData.flow || 'bi',
913
+ parent: obj.parent
914
+ });
915
+ }
916
+ });
917
+
918
+ // Get current connections to avoid double-connecting
919
+ currentConns = this.getConnections();
920
+ busyConnectorIds = new Set();
921
+ currentConns.forEach(function (conn) {
922
+ busyConnectorIds.add(conn.from);
923
+ busyConnectorIds.add(conn.to);
924
+ });
925
+ freeConnectors = connectors.filter(function (c) {
926
+ return !busyConnectorIds.has(c.uuid);
927
+ }); // Shuffle free connectors
928
+ for (i = freeConnectors.length - 1; i > 0; i--) {
929
+ j = Math.floor(Math.random() * (i + 1));
930
+ _ref = [freeConnectors[j], freeConnectors[i]];
931
+ freeConnectors[i] = _ref[0];
932
+ freeConnectors[j] = _ref[1];
933
+ }
934
+ added = []; // Greedy pairing
935
+ case 2:
936
+ if (!(freeConnectors.length >= 2)) {
937
+ _context3.n = 6;
938
+ break;
939
+ }
940
+ from = freeConnectors.pop();
941
+ _i = 0;
942
+ case 3:
943
+ if (!(_i < freeConnectors.length)) {
944
+ _context3.n = 5;
945
+ break;
946
+ }
947
+ to = freeConnectors[_i]; // Basic flow compatibility check (CentralPlantInternals.addConnection does this too)
948
+ isCompatible = from.flow === 'bi' || to.flow === 'bi' || from.flow !== to.flow;
949
+ isDifferentParent = from.parent !== to.parent;
950
+ if (!(isCompatible && isDifferentParent)) {
951
+ _context3.n = 4;
952
+ break;
953
+ }
954
+ conn = this.addConnection(from.uuid, to.uuid);
955
+ if (!conn) {
956
+ _context3.n = 4;
957
+ break;
958
+ }
959
+ added.push(conn);
960
+ freeConnectors.splice(_i, 1);
961
+ return _context3.a(3, 5);
962
+ case 4:
963
+ _i++;
964
+ _context3.n = 3;
965
+ break;
966
+ case 5:
967
+ _context3.n = 2;
968
+ break;
969
+ case 6:
970
+ if (added.length > 0) {
971
+ this.updatePaths();
972
+ }
973
+ return _context3.a(2, added);
974
+ }
975
+ }, _callee3, this);
976
+ }));
977
+ function addRandomConnections() {
978
+ return _addRandomConnections.apply(this, arguments);
979
+ }
980
+ return addRandomConnections;
981
+ }()
858
982
  /**
859
983
  * Remove a connection between two component connectors
860
984
  * @param {string} fromConnectorId - The UUID of the source connector
@@ -876,6 +1000,7 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
876
1000
  * centralPlant.updatePaths();
877
1001
  * }
878
1002
  */
1003
+ )
879
1004
  }, {
880
1005
  key: "removeConnection",
881
1006
  value: function removeConnection(fromConnectorId, toConnectorId) {
@@ -1080,8 +1205,8 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
1080
1205
  }, {
1081
1206
  key: "_dispatchIoState",
1082
1207
  value: function _dispatchIoState(attachmentId, stateId, value, parentUuid) {
1083
- var _this$managers, _this$sceneViewer4, _this$sceneViewer5, _this$managers2, _this$sceneViewer6, _this$sceneViewer7, _this$sceneViewer8;
1084
- var tooltipMgr = ((_this$managers = this.managers) === null || _this$managers === void 0 ? void 0 : _this$managers.componentTooltipManager) || ((_this$sceneViewer4 = this.sceneViewer) === null || _this$sceneViewer4 === void 0 ? void 0 : _this$sceneViewer4.componentTooltipManager) || ((_this$sceneViewer5 = this.sceneViewer) === null || _this$sceneViewer5 === void 0 || (_this$sceneViewer5 = _this$sceneViewer5.managers) === null || _this$sceneViewer5 === void 0 ? void 0 : _this$sceneViewer5.componentTooltipManager);
1208
+ var _this$managers, _this$sceneViewer5, _this$sceneViewer6, _this$managers2, _this$sceneViewer7, _this$sceneViewer8, _this$sceneViewer9;
1209
+ var tooltipMgr = ((_this$managers = this.managers) === null || _this$managers === void 0 ? void 0 : _this$managers.componentTooltipManager) || ((_this$sceneViewer5 = this.sceneViewer) === null || _this$sceneViewer5 === void 0 ? void 0 : _this$sceneViewer5.componentTooltipManager) || ((_this$sceneViewer6 = this.sceneViewer) === null || _this$sceneViewer6 === void 0 || (_this$sceneViewer6 = _this$sceneViewer6.managers) === null || _this$sceneViewer6 === void 0 ? void 0 : _this$sceneViewer6.componentTooltipManager);
1085
1210
  var stateAdapter = tooltipMgr === null || tooltipMgr === void 0 ? void 0 : tooltipMgr._stateAdapter;
1086
1211
  if (stateAdapter !== null && stateAdapter !== void 0 && stateAdapter.setState) {
1087
1212
  var scopedKey = behaviorDispatch.getScopedAttachmentKey(attachmentId, parentUuid);
@@ -1091,11 +1216,11 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
1091
1216
  console.warn('⚠️ _dispatchIoState(): stateAdapter.setState() threw:', err);
1092
1217
  }
1093
1218
  }
1094
- var ioBehavMgr = ((_this$managers2 = this.managers) === null || _this$managers2 === void 0 ? void 0 : _this$managers2.ioBehaviorManager) || ((_this$sceneViewer6 = this.sceneViewer) === null || _this$sceneViewer6 === void 0 || (_this$sceneViewer6 = _this$sceneViewer6.managers) === null || _this$sceneViewer6 === void 0 ? void 0 : _this$sceneViewer6.ioBehaviorManager) || ((_this$sceneViewer7 = this.sceneViewer) === null || _this$sceneViewer7 === void 0 ? void 0 : _this$sceneViewer7.ioBehaviorManager);
1219
+ var ioBehavMgr = ((_this$managers2 = this.managers) === null || _this$managers2 === void 0 ? void 0 : _this$managers2.ioBehaviorManager) || ((_this$sceneViewer7 = this.sceneViewer) === null || _this$sceneViewer7 === void 0 || (_this$sceneViewer7 = _this$sceneViewer7.managers) === null || _this$sceneViewer7 === void 0 ? void 0 : _this$sceneViewer7.ioBehaviorManager) || ((_this$sceneViewer8 = this.sceneViewer) === null || _this$sceneViewer8 === void 0 ? void 0 : _this$sceneViewer8.ioBehaviorManager);
1095
1220
  if (ioBehavMgr) {
1096
1221
  ioBehavMgr.triggerState(attachmentId, stateId, value, parentUuid);
1097
1222
  }
1098
- (_this$sceneViewer8 = this.sceneViewer) === null || _this$sceneViewer8 === void 0 || _this$sceneViewer8.emit('io-device-state-changed', {
1223
+ (_this$sceneViewer9 = this.sceneViewer) === null || _this$sceneViewer9 === void 0 || _this$sceneViewer9.emit('io-device-state-changed', {
1099
1224
  attachmentId: attachmentId,
1100
1225
  stateId: stateId,
1101
1226
  value: value,
@@ -1110,16 +1235,16 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
1110
1235
  }, {
1111
1236
  key: "configureStateAdapter",
1112
1237
  value: function configureStateAdapter(stateAdapter) {
1113
- var _this$managers3, _this$sceneViewer9, _this$managers4, _this$sceneViewer1, _this$sceneViewer10;
1114
- var tooltipMgr = ((_this$managers3 = this.managers) === null || _this$managers3 === void 0 ? void 0 : _this$managers3.componentTooltipManager) || ((_this$sceneViewer9 = this.sceneViewer) === null || _this$sceneViewer9 === void 0 ? void 0 : _this$sceneViewer9.componentTooltipManager);
1238
+ var _this$managers3, _this$sceneViewer0, _this$managers4, _this$sceneViewer10, _this$sceneViewer11;
1239
+ var tooltipMgr = ((_this$managers3 = this.managers) === null || _this$managers3 === void 0 ? void 0 : _this$managers3.componentTooltipManager) || ((_this$sceneViewer0 = this.sceneViewer) === null || _this$sceneViewer0 === void 0 ? void 0 : _this$sceneViewer0.componentTooltipManager);
1115
1240
  if (tooltipMgr !== null && tooltipMgr !== void 0 && tooltipMgr.configure) {
1116
- var _this$sceneViewer0;
1241
+ var _this$sceneViewer1;
1117
1242
  tooltipMgr.configure(stateAdapter);
1118
- if ((_this$sceneViewer0 = this.sceneViewer) !== null && _this$sceneViewer0 !== void 0 && _this$sceneViewer0.managers) {
1243
+ if ((_this$sceneViewer1 = this.sceneViewer) !== null && _this$sceneViewer1 !== void 0 && _this$sceneViewer1.managers) {
1119
1244
  this.sceneViewer.managers.componentTooltipManager = tooltipMgr;
1120
1245
  }
1121
1246
  }
1122
- var ioBehavMgr = ((_this$managers4 = this.managers) === null || _this$managers4 === void 0 ? void 0 : _this$managers4.ioBehaviorManager) || ((_this$sceneViewer1 = this.sceneViewer) === null || _this$sceneViewer1 === void 0 || (_this$sceneViewer1 = _this$sceneViewer1.managers) === null || _this$sceneViewer1 === void 0 ? void 0 : _this$sceneViewer1.ioBehaviorManager) || ((_this$sceneViewer10 = this.sceneViewer) === null || _this$sceneViewer10 === void 0 ? void 0 : _this$sceneViewer10.ioBehaviorManager);
1247
+ var ioBehavMgr = ((_this$managers4 = this.managers) === null || _this$managers4 === void 0 ? void 0 : _this$managers4.ioBehaviorManager) || ((_this$sceneViewer10 = this.sceneViewer) === null || _this$sceneViewer10 === void 0 || (_this$sceneViewer10 = _this$sceneViewer10.managers) === null || _this$sceneViewer10 === void 0 ? void 0 : _this$sceneViewer10.ioBehaviorManager) || ((_this$sceneViewer11 = this.sceneViewer) === null || _this$sceneViewer11 === void 0 ? void 0 : _this$sceneViewer11.ioBehaviorManager);
1123
1248
  if (ioBehavMgr !== null && ioBehavMgr !== void 0 && ioBehavMgr.configure) {
1124
1249
  ioBehavMgr.configure(stateAdapter);
1125
1250
  }
@@ -1154,13 +1279,13 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
1154
1279
  }, {
1155
1280
  key: "getSceneAttachments",
1156
1281
  value: function getSceneAttachments() {
1157
- var _this$sceneViewer11;
1158
- var scene = (_this$sceneViewer11 = this.sceneViewer) === null || _this$sceneViewer11 === void 0 ? void 0 : _this$sceneViewer11.scene;
1282
+ var _this$sceneViewer12;
1283
+ var scene = (_this$sceneViewer12 = this.sceneViewer) === null || _this$sceneViewer12 === void 0 ? void 0 : _this$sceneViewer12.scene;
1159
1284
  if (!scene) return [];
1160
1285
  var results = [];
1161
1286
  scene.traverse(function (obj) {
1162
- var _obj$userData;
1163
- if (((_obj$userData = obj.userData) === null || _obj$userData === void 0 ? void 0 : _obj$userData.objectType) === 'io-device') {
1287
+ var _obj$userData2;
1288
+ if (((_obj$userData2 = obj.userData) === null || _obj$userData2 === void 0 ? void 0 : _obj$userData2.objectType) === 'io-device') {
1164
1289
  var _parent$userData;
1165
1290
  var attachmentId = obj.userData.attachmentId || obj.name || obj.uuid;
1166
1291
  var label = obj.userData.attachmentLabel || attachmentId;
@@ -1220,9 +1345,9 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
1220
1345
  }, {
1221
1346
  key: "getIoDevices",
1222
1347
  value: function getIoDevices() {
1223
- var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
1224
- _ref$source = _ref.source,
1225
- source = _ref$source === void 0 ? 'all' : _ref$source;
1348
+ var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
1349
+ _ref2$source = _ref2.source,
1350
+ source = _ref2$source === void 0 ? 'all' : _ref2$source;
1226
1351
  var mp = this.getUtility('modelPreloader');
1227
1352
  var dict = mp === null || mp === void 0 ? void 0 : mp.componentDictionary;
1228
1353
  if (!dict) {
@@ -1258,8 +1383,8 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
1258
1383
  }, {
1259
1384
  key: "getIoDeviceUsage",
1260
1385
  value: function getIoDeviceUsage() {
1261
- var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
1262
- deviceUuid = _ref2.deviceUuid;
1386
+ var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
1387
+ deviceUuid = _ref3.deviceUuid;
1263
1388
  if (!deviceUuid) {
1264
1389
  console.warn('⚠️ getIoDeviceUsage(): deviceUuid is required');
1265
1390
  return [];
@@ -1310,38 +1435,38 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
1310
1435
  }, {
1311
1436
  key: "createSmartComponent",
1312
1437
  value: (function () {
1313
- var _createSmartComponent = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee3() {
1314
- var _ref3,
1438
+ var _createSmartComponent = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee4() {
1439
+ var _ref4,
1315
1440
  componentUuid,
1316
1441
  name,
1317
1442
  attachments,
1318
1443
  thumbnailBlob,
1319
1444
  newAsset,
1320
1445
  mp,
1321
- _args3 = arguments;
1322
- return _rollupPluginBabelHelpers.regenerator().w(function (_context3) {
1323
- while (1) switch (_context3.n) {
1446
+ _args4 = arguments;
1447
+ return _rollupPluginBabelHelpers.regenerator().w(function (_context4) {
1448
+ while (1) switch (_context4.n) {
1324
1449
  case 0:
1325
- _ref3 = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {}, componentUuid = _ref3.componentUuid, name = _ref3.name, attachments = _ref3.attachments, thumbnailBlob = _ref3.thumbnailBlob;
1450
+ _ref4 = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {}, componentUuid = _ref4.componentUuid, name = _ref4.name, attachments = _ref4.attachments, thumbnailBlob = _ref4.thumbnailBlob;
1326
1451
  if (this.assetService) {
1327
- _context3.n = 1;
1452
+ _context4.n = 1;
1328
1453
  break;
1329
1454
  }
1330
1455
  throw new Error('createSmartComponent(): no asset service set — call setAssetService() first');
1331
1456
  case 1:
1332
1457
  if (componentUuid) {
1333
- _context3.n = 2;
1458
+ _context4.n = 2;
1334
1459
  break;
1335
1460
  }
1336
1461
  throw new Error('createSmartComponent(): componentUuid is required');
1337
1462
  case 2:
1338
1463
  if (!(!Array.isArray(attachments) || attachments.length === 0)) {
1339
- _context3.n = 3;
1464
+ _context4.n = 3;
1340
1465
  break;
1341
1466
  }
1342
1467
  throw new Error('createSmartComponent(): at least one attachment is required');
1343
1468
  case 3:
1344
- _context3.n = 4;
1469
+ _context4.n = 4;
1345
1470
  return this.assetService.createSmartComponent({
1346
1471
  componentUuid: componentUuid,
1347
1472
  name: name,
@@ -1349,7 +1474,7 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
1349
1474
  thumbnailBlob: thumbnailBlob
1350
1475
  });
1351
1476
  case 4:
1352
- newAsset = _context3.v;
1477
+ newAsset = _context4.v;
1353
1478
  // Register in model preloader dictionary so addComponent() can use it immediately
1354
1479
  mp = this.getUtility('modelPreloader');
1355
1480
  if (mp !== null && mp !== void 0 && mp.componentDictionary && newAsset !== null && newAsset !== void 0 && newAsset.uuid) {
@@ -1358,9 +1483,9 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
1358
1483
  });
1359
1484
  console.log("\u2705 createSmartComponent(): registered \"".concat(newAsset.name, "\" in component dictionary"));
1360
1485
  }
1361
- return _context3.a(2, newAsset);
1486
+ return _context4.a(2, newAsset);
1362
1487
  }
1363
- }, _callee3, this);
1488
+ }, _callee4, this);
1364
1489
  }));
1365
1490
  function createSmartComponent() {
1366
1491
  return _createSmartComponent.apply(this, arguments);
@@ -1394,42 +1519,42 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
1394
1519
  }, {
1395
1520
  key: "addComponentAttachment",
1396
1521
  value: (function () {
1397
- var _addComponentAttachment = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee4() {
1398
- var _ref4,
1522
+ var _addComponentAttachment = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee5() {
1523
+ var _ref5,
1399
1524
  componentUuid,
1400
1525
  attachment,
1401
1526
  updatedAsset,
1402
1527
  mp,
1403
- _args4 = arguments;
1404
- return _rollupPluginBabelHelpers.regenerator().w(function (_context4) {
1405
- while (1) switch (_context4.n) {
1528
+ _args5 = arguments;
1529
+ return _rollupPluginBabelHelpers.regenerator().w(function (_context5) {
1530
+ while (1) switch (_context5.n) {
1406
1531
  case 0:
1407
- _ref4 = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {}, componentUuid = _ref4.componentUuid, attachment = _ref4.attachment;
1532
+ _ref5 = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {}, componentUuid = _ref5.componentUuid, attachment = _ref5.attachment;
1408
1533
  if (this.assetService) {
1409
- _context4.n = 1;
1534
+ _context5.n = 1;
1410
1535
  break;
1411
1536
  }
1412
1537
  throw new Error('addComponentAttachment(): no asset service set — call setAssetService() first');
1413
1538
  case 1:
1414
1539
  if (componentUuid) {
1415
- _context4.n = 2;
1540
+ _context5.n = 2;
1416
1541
  break;
1417
1542
  }
1418
1543
  throw new Error('addComponentAttachment(): componentUuid is required');
1419
1544
  case 2:
1420
1545
  if (!(!(attachment !== null && attachment !== void 0 && attachment.attachmentId) || !(attachment !== null && attachment !== void 0 && attachment.deviceId))) {
1421
- _context4.n = 3;
1546
+ _context5.n = 3;
1422
1547
  break;
1423
1548
  }
1424
1549
  throw new Error('addComponentAttachment(): attachment must have attachmentId and deviceId');
1425
1550
  case 3:
1426
- _context4.n = 4;
1551
+ _context5.n = 4;
1427
1552
  return this.assetService.addComponentAttachment({
1428
1553
  componentUuid: componentUuid,
1429
1554
  attachment: attachment
1430
1555
  });
1431
1556
  case 4:
1432
- updatedAsset = _context4.v;
1557
+ updatedAsset = _context5.v;
1433
1558
  // Sync component dictionary
1434
1559
  mp = this.getUtility('modelPreloader');
1435
1560
  if (mp !== null && mp !== void 0 && mp.componentDictionary && updatedAsset !== null && updatedAsset !== void 0 && updatedAsset.uuid) {
@@ -1437,9 +1562,9 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
1437
1562
  id: updatedAsset.uuid
1438
1563
  });
1439
1564
  }
1440
- return _context4.a(2, updatedAsset);
1565
+ return _context5.a(2, updatedAsset);
1441
1566
  }
1442
- }, _callee4, this);
1567
+ }, _callee5, this);
1443
1568
  }));
1444
1569
  function addComponentAttachment() {
1445
1570
  return _addComponentAttachment.apply(this, arguments);
@@ -1465,42 +1590,42 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
1465
1590
  }, {
1466
1591
  key: "removeComponentAttachment",
1467
1592
  value: (function () {
1468
- var _removeComponentAttachment = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee5() {
1469
- var _ref5,
1593
+ var _removeComponentAttachment = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee6() {
1594
+ var _ref6,
1470
1595
  componentUuid,
1471
1596
  attachmentId,
1472
1597
  updatedAsset,
1473
1598
  mp,
1474
- _args5 = arguments;
1475
- return _rollupPluginBabelHelpers.regenerator().w(function (_context5) {
1476
- while (1) switch (_context5.n) {
1599
+ _args6 = arguments;
1600
+ return _rollupPluginBabelHelpers.regenerator().w(function (_context6) {
1601
+ while (1) switch (_context6.n) {
1477
1602
  case 0:
1478
- _ref5 = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {}, componentUuid = _ref5.componentUuid, attachmentId = _ref5.attachmentId;
1603
+ _ref6 = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {}, componentUuid = _ref6.componentUuid, attachmentId = _ref6.attachmentId;
1479
1604
  if (this.assetService) {
1480
- _context5.n = 1;
1605
+ _context6.n = 1;
1481
1606
  break;
1482
1607
  }
1483
1608
  throw new Error('removeComponentAttachment(): no asset service set — call setAssetService() first');
1484
1609
  case 1:
1485
1610
  if (componentUuid) {
1486
- _context5.n = 2;
1611
+ _context6.n = 2;
1487
1612
  break;
1488
1613
  }
1489
1614
  throw new Error('removeComponentAttachment(): componentUuid is required');
1490
1615
  case 2:
1491
1616
  if (attachmentId) {
1492
- _context5.n = 3;
1617
+ _context6.n = 3;
1493
1618
  break;
1494
1619
  }
1495
1620
  throw new Error('removeComponentAttachment(): attachmentId is required');
1496
1621
  case 3:
1497
- _context5.n = 4;
1622
+ _context6.n = 4;
1498
1623
  return this.assetService.removeComponentAttachment({
1499
1624
  componentUuid: componentUuid,
1500
1625
  attachmentId: attachmentId
1501
1626
  });
1502
1627
  case 4:
1503
- updatedAsset = _context5.v;
1628
+ updatedAsset = _context6.v;
1504
1629
  // Sync component dictionary
1505
1630
  mp = this.getUtility('modelPreloader');
1506
1631
  if (mp !== null && mp !== void 0 && mp.componentDictionary && updatedAsset !== null && updatedAsset !== void 0 && updatedAsset.uuid) {
@@ -1508,9 +1633,9 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
1508
1633
  id: updatedAsset.uuid
1509
1634
  });
1510
1635
  }
1511
- return _context5.a(2, updatedAsset);
1636
+ return _context6.a(2, updatedAsset);
1512
1637
  }
1513
- }, _callee5, this);
1638
+ }, _callee6, this);
1514
1639
  }));
1515
1640
  function removeComponentAttachment() {
1516
1641
  return _removeComponentAttachment.apply(this, arguments);
@@ -1703,41 +1828,41 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
1703
1828
  }, {
1704
1829
  key: "getComponents",
1705
1830
  value: (function () {
1706
- var _getComponents = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee6() {
1831
+ var _getComponents = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee7() {
1707
1832
  var options,
1708
1833
  validation,
1709
1834
  enhancedOptions,
1710
- _args6 = arguments,
1835
+ _args7 = arguments,
1711
1836
  _t;
1712
- return _rollupPluginBabelHelpers.regenerator().w(function (_context6) {
1713
- while (1) switch (_context6.n) {
1837
+ return _rollupPluginBabelHelpers.regenerator().w(function (_context7) {
1838
+ while (1) switch (_context7.n) {
1714
1839
  case 0:
1715
- options = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
1840
+ options = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {};
1716
1841
  // Validate filter options using centralized validator
1717
1842
  validation = this.internals.validator.validateComponentFilter(options);
1718
1843
  if (validation.isValid) {
1719
- _context6.n = 1;
1844
+ _context7.n = 1;
1720
1845
  break;
1721
1846
  }
1722
1847
  console.warn('⚠️ getComponents(): Invalid filter options provided:', validation.message);
1723
- return _context6.a(2, []);
1848
+ return _context7.a(2, []);
1724
1849
  case 1:
1725
- _context6.p = 1;
1850
+ _context7.p = 1;
1726
1851
  // Always include metadata
1727
1852
  enhancedOptions = _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, options), {}, {
1728
1853
  includeMetadata: true
1729
1854
  });
1730
- _context6.n = 2;
1855
+ _context7.n = 2;
1731
1856
  return this.managers.componentDataManager.getDictionaryComponents(enhancedOptions);
1732
1857
  case 2:
1733
- return _context6.a(2, _context6.v);
1858
+ return _context7.a(2, _context7.v);
1734
1859
  case 3:
1735
- _context6.p = 3;
1736
- _t = _context6.v;
1860
+ _context7.p = 3;
1861
+ _t = _context7.v;
1737
1862
  console.error('❌ getDictionaryComponents(): Error retrieving available components:', _t);
1738
- return _context6.a(2, []);
1863
+ return _context7.a(2, []);
1739
1864
  }
1740
- }, _callee6, this, [[1, 3]]);
1865
+ }, _callee7, this, [[1, 3]]);
1741
1866
  }));
1742
1867
  function getComponents() {
1743
1868
  return _getComponents.apply(this, arguments);
@@ -1840,23 +1965,23 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
1840
1965
  }, {
1841
1966
  key: "extendComponentDictionary",
1842
1967
  value: (function () {
1843
- var _extendComponentDictionary = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee7(additionalComponents) {
1844
- return _rollupPluginBabelHelpers.regenerator().w(function (_context7) {
1845
- while (1) switch (_context7.n) {
1968
+ var _extendComponentDictionary = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee8(additionalComponents) {
1969
+ return _rollupPluginBabelHelpers.regenerator().w(function (_context8) {
1970
+ while (1) switch (_context8.n) {
1846
1971
  case 0:
1847
1972
  if (this.managers.componentDataManager) {
1848
- _context7.n = 1;
1973
+ _context8.n = 1;
1849
1974
  break;
1850
1975
  }
1851
1976
  console.warn('⚠️ extendComponentDictionary(): Component data manager not available');
1852
- return _context7.a(2, false);
1977
+ return _context8.a(2, false);
1853
1978
  case 1:
1854
- _context7.n = 2;
1979
+ _context8.n = 2;
1855
1980
  return this.managers.componentDataManager.extendComponentDictionary(additionalComponents);
1856
1981
  case 2:
1857
- return _context7.a(2, _context7.v);
1982
+ return _context8.a(2, _context8.v);
1858
1983
  }
1859
- }, _callee7, this);
1984
+ }, _callee8, this);
1860
1985
  }));
1861
1986
  function extendComponentDictionary(_x3) {
1862
1987
  return _extendComponentDictionary.apply(this, arguments);
@@ -1930,23 +2055,23 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
1930
2055
  }, {
1931
2056
  key: "removeS3Components",
1932
2057
  value: (function () {
1933
- var _removeS3Components = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee8() {
1934
- return _rollupPluginBabelHelpers.regenerator().w(function (_context8) {
1935
- while (1) switch (_context8.n) {
2058
+ var _removeS3Components = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee9() {
2059
+ return _rollupPluginBabelHelpers.regenerator().w(function (_context9) {
2060
+ while (1) switch (_context9.n) {
1936
2061
  case 0:
1937
2062
  if (this.managers.componentDataManager) {
1938
- _context8.n = 1;
2063
+ _context9.n = 1;
1939
2064
  break;
1940
2065
  }
1941
2066
  console.warn('⚠️ removeS3Components(): Component data manager not available');
1942
- return _context8.a(2, false);
2067
+ return _context9.a(2, false);
1943
2068
  case 1:
1944
- _context8.n = 2;
2069
+ _context9.n = 2;
1945
2070
  return this.managers.componentDataManager.removeS3Components();
1946
2071
  case 2:
1947
- return _context8.a(2, _context8.v);
2072
+ return _context9.a(2, _context9.v);
1948
2073
  }
1949
- }, _callee8, this);
2074
+ }, _callee9, this);
1950
2075
  }));
1951
2076
  function removeS3Components() {
1952
2077
  return _removeS3Components.apply(this, arguments);
@@ -1970,23 +2095,23 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
1970
2095
  }, {
1971
2096
  key: "removeComponentFromDictionary",
1972
2097
  value: (function () {
1973
- var _removeComponentFromDictionary = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee9(componentKey) {
1974
- return _rollupPluginBabelHelpers.regenerator().w(function (_context9) {
1975
- while (1) switch (_context9.n) {
2098
+ var _removeComponentFromDictionary = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee0(componentKey) {
2099
+ return _rollupPluginBabelHelpers.regenerator().w(function (_context0) {
2100
+ while (1) switch (_context0.n) {
1976
2101
  case 0:
1977
2102
  if (this.managers.componentDataManager) {
1978
- _context9.n = 1;
2103
+ _context0.n = 1;
1979
2104
  break;
1980
2105
  }
1981
2106
  console.warn('⚠️ removeComponentFromDictionary(): Component data manager not available');
1982
- return _context9.a(2, false);
2107
+ return _context0.a(2, false);
1983
2108
  case 1:
1984
- _context9.n = 2;
2109
+ _context0.n = 2;
1985
2110
  return this.managers.componentDataManager.removeComponentFromDictionary(componentKey);
1986
2111
  case 2:
1987
- return _context9.a(2, _context9.v);
2112
+ return _context0.a(2, _context0.v);
1988
2113
  }
1989
- }, _callee9, this);
2114
+ }, _callee0, this);
1990
2115
  }));
1991
2116
  function removeComponentFromDictionary(_x4) {
1992
2117
  return _removeComponentFromDictionary.apply(this, arguments);
@@ -2022,8 +2147,8 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
2022
2147
  var componentDictionary = ((_this$managers$compon = this.managers.componentDataManager) === null || _this$managers$compon === void 0 ? void 0 : _this$managers$compon.componentDictionary) || {};
2023
2148
  var missingIds = [];
2024
2149
  sceneData.scene.children.forEach(function (child) {
2025
- var _child$userData;
2026
- var libraryId = (_child$userData = child.userData) === null || _child$userData === void 0 ? void 0 : _child$userData.libraryId;
2150
+ var _child$userData2;
2151
+ var libraryId = (_child$userData2 = child.userData) === null || _child$userData2 === void 0 ? void 0 : _child$userData2.libraryId;
2027
2152
  if (libraryId && !componentDictionary[libraryId]) {
2028
2153
  // Only add unique IDs
2029
2154
  if (!missingIds.includes(libraryId)) {
@@ -2101,8 +2226,8 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
2101
2226
  // If still not found, try finding by originalUuid in userData
2102
2227
  if (!targetObject) {
2103
2228
  this.sceneViewer.scene.traverse(function (child) {
2104
- var _child$userData2;
2105
- if (((_child$userData2 = child.userData) === null || _child$userData2 === void 0 ? void 0 : _child$userData2.originalUuid) === objectId) {
2229
+ var _child$userData3;
2230
+ if (((_child$userData3 = child.userData) === null || _child$userData3 === void 0 ? void 0 : _child$userData3.originalUuid) === objectId) {
2106
2231
  targetObject = child;
2107
2232
  return;
2108
2233
  }
@@ -2233,49 +2358,49 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
2233
2358
  }, {
2234
2359
  key: "initialize2DViewport",
2235
2360
  value: function () {
2236
- var _initialize2DViewport = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee0(container) {
2361
+ var _initialize2DViewport = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee1(container) {
2237
2362
  var viewType,
2238
2363
  instanceKey,
2239
2364
  success,
2240
- _args0 = arguments,
2365
+ _args1 = arguments,
2241
2366
  _t2;
2242
- return _rollupPluginBabelHelpers.regenerator().w(function (_context0) {
2243
- while (1) switch (_context0.n) {
2367
+ return _rollupPluginBabelHelpers.regenerator().w(function (_context1) {
2368
+ while (1) switch (_context1.n) {
2244
2369
  case 0:
2245
- viewType = _args0.length > 1 && _args0[1] !== undefined ? _args0[1] : 'top';
2246
- instanceKey = _args0.length > 2 && _args0[2] !== undefined ? _args0[2] : null;
2370
+ viewType = _args1.length > 1 && _args1[1] !== undefined ? _args1[1] : 'top';
2371
+ instanceKey = _args1.length > 2 && _args1[2] !== undefined ? _args1[2] : null;
2247
2372
  if (container) {
2248
- _context0.n = 1;
2373
+ _context1.n = 1;
2249
2374
  break;
2250
2375
  }
2251
2376
  console.warn('⚠️ initialize2DViewport(): No container provided');
2252
- return _context0.a(2, false);
2377
+ return _context1.a(2, false);
2253
2378
  case 1:
2254
2379
  if (this.managers.viewport2DManager) {
2255
- _context0.n = 2;
2380
+ _context1.n = 2;
2256
2381
  break;
2257
2382
  }
2258
2383
  console.warn('⚠️ initialize2DViewport(): Viewport2D manager not available');
2259
- return _context0.a(2, false);
2384
+ return _context1.a(2, false);
2260
2385
  case 2:
2261
- _context0.p = 2;
2262
- _context0.n = 3;
2386
+ _context1.p = 2;
2387
+ _context1.n = 3;
2263
2388
  return this.managers.viewport2DManager.initialize(container, viewType, instanceKey);
2264
2389
  case 3:
2265
- success = _context0.v;
2390
+ success = _context1.v;
2266
2391
  if (success) {
2267
2392
  console.log("\u2705 2D viewport initialized successfully (".concat(viewType, " view, key: ").concat(instanceKey || viewType, ")"));
2268
2393
  } else {
2269
2394
  console.warn("\u26A0\uFE0F Failed to initialize 2D viewport (".concat(viewType, " view)"));
2270
2395
  }
2271
- return _context0.a(2, success);
2396
+ return _context1.a(2, success);
2272
2397
  case 4:
2273
- _context0.p = 4;
2274
- _t2 = _context0.v;
2398
+ _context1.p = 4;
2399
+ _t2 = _context1.v;
2275
2400
  console.error('❌ initialize2DViewport(): Error initializing 2D viewport:', _t2);
2276
- return _context0.a(2, false);
2401
+ return _context1.a(2, false);
2277
2402
  }
2278
- }, _callee0, this, [[2, 4]]);
2403
+ }, _callee1, this, [[2, 4]]);
2279
2404
  }));
2280
2405
  function initialize2DViewport(_x5) {
2281
2406
  return _initialize2DViewport.apply(this, arguments);
@@ -2453,7 +2578,7 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
2453
2578
  }, {
2454
2579
  key: "initializeModelPreloading",
2455
2580
  value: (function () {
2456
- var _initializeModelPreloading = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee1() {
2581
+ var _initializeModelPreloading = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee10() {
2457
2582
  var basePath,
2458
2583
  normalizedBasePath,
2459
2584
  dictionaryPath,
@@ -2462,13 +2587,13 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
2462
2587
  componentDictionary,
2463
2588
  _modelPreloader2,
2464
2589
  progress,
2465
- _args1 = arguments,
2590
+ _args10 = arguments,
2466
2591
  _t3;
2467
- return _rollupPluginBabelHelpers.regenerator().w(function (_context1) {
2468
- while (1) switch (_context1.n) {
2592
+ return _rollupPluginBabelHelpers.regenerator().w(function (_context10) {
2593
+ while (1) switch (_context10.n) {
2469
2594
  case 0:
2470
- basePath = _args1.length > 0 && _args1[0] !== undefined ? _args1[0] : '/library/';
2471
- _context1.p = 1;
2595
+ basePath = _args10.length > 0 && _args10[0] !== undefined ? _args10[0] : '/library/';
2596
+ _context10.p = 1;
2472
2597
  // Ensure basePath ends with a slash
2473
2598
  normalizedBasePath = basePath.endsWith('/') ? basePath : "".concat(basePath, "/");
2474
2599
  dictionaryPath = "".concat(normalizedBasePath, "component-dictionary.json");
@@ -2479,39 +2604,39 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
2479
2604
  console.log("\uFFFD Models path: ".concat(modelsBasePath));
2480
2605
 
2481
2606
  // Load the component dictionary
2482
- _context1.n = 2;
2607
+ _context10.n = 2;
2483
2608
  return fetch(dictionaryPath);
2484
2609
  case 2:
2485
- response = _context1.v;
2610
+ response = _context10.v;
2486
2611
  if (response.ok) {
2487
- _context1.n = 3;
2612
+ _context10.n = 3;
2488
2613
  break;
2489
2614
  }
2490
2615
  throw new Error("Failed to load component dictionary: ".concat(response.status));
2491
2616
  case 3:
2492
- _context1.n = 4;
2617
+ _context10.n = 4;
2493
2618
  return response.json();
2494
2619
  case 4:
2495
- componentDictionary = _context1.v;
2620
+ componentDictionary = _context10.v;
2496
2621
  console.log('📚 Component dictionary loaded:', Object.keys(componentDictionary));
2497
2622
 
2498
2623
  // Start preloading all models with the specified base path
2499
2624
  _modelPreloader2 = this.getUtility('modelPreloader');
2500
- _context1.n = 5;
2625
+ _context10.n = 5;
2501
2626
  return _modelPreloader2.preloadAllModels(componentDictionary, modelsBasePath);
2502
2627
  case 5:
2503
- progress = _context1.v;
2628
+ progress = _context10.v;
2504
2629
  console.log('🎉 Model preloading completed:', progress);
2505
- return _context1.a(2, progress);
2630
+ return _context10.a(2, progress);
2506
2631
  case 6:
2507
- _context1.p = 6;
2508
- _t3 = _context1.v;
2632
+ _context10.p = 6;
2633
+ _t3 = _context10.v;
2509
2634
  console.error('❌ Failed to initialize model preloading:', _t3);
2510
2635
  throw _t3;
2511
2636
  case 7:
2512
- return _context1.a(2);
2637
+ return _context10.a(2);
2513
2638
  }
2514
- }, _callee1, this, [[1, 6]]);
2639
+ }, _callee10, this, [[1, 6]]);
2515
2640
  }));
2516
2641
  function initializeModelPreloading() {
2517
2642
  return _initializeModelPreloading.apply(this, arguments);
@@ -2528,100 +2653,86 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
2528
2653
  }, {
2529
2654
  key: "importScene",
2530
2655
  value: (function () {
2531
- var _importScene = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee10(jsonData) {
2532
- var validation, embeddedCount, missingIds, resolved, _t4, _t5;
2533
- return _rollupPluginBabelHelpers.regenerator().w(function (_context10) {
2534
- while (1) switch (_context10.n) {
2656
+ var _importScene = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee11(jsonData) {
2657
+ var validation, missingIds, resolved, _t4, _t5;
2658
+ return _rollupPluginBabelHelpers.regenerator().w(function (_context11) {
2659
+ while (1) switch (_context11.n) {
2535
2660
  case 0:
2536
2661
  if (jsonData) {
2537
- _context10.n = 1;
2662
+ _context11.n = 1;
2538
2663
  break;
2539
2664
  }
2540
2665
  console.error('❌ No JSON data provided for import');
2541
- return _context10.a(2, false);
2666
+ return _context11.a(2, false);
2542
2667
  case 1:
2543
- _context10.p = 1;
2668
+ _context11.p = 1;
2544
2669
  // Validate scene data structure
2545
2670
  validation = this.internals.validateAndAnalyzeSceneData(jsonData);
2546
2671
  if (validation.isValid) {
2547
- _context10.n = 2;
2672
+ _context11.n = 2;
2548
2673
  break;
2549
2674
  }
2550
2675
  console.error('❌ Invalid scene data format:', validation.message);
2551
- return _context10.a(2, false);
2676
+ return _context11.a(2, false);
2552
2677
  case 2:
2553
- if (!(jsonData.componentDefinitions && _rollupPluginBabelHelpers["typeof"](jsonData.componentDefinitions) === 'object')) {
2554
- _context10.n = 4;
2555
- break;
2556
- }
2557
- embeddedCount = Object.keys(jsonData.componentDefinitions).length;
2558
- if (!(embeddedCount > 0)) {
2559
- _context10.n = 4;
2560
- break;
2561
- }
2562
- _context10.n = 3;
2563
- return this.extendComponentDictionary(jsonData.componentDefinitions);
2564
- case 3:
2565
- console.log("\uD83D\uDCE6 importScene(): Applied ".concat(embeddedCount, " embedded component definition(s)"));
2566
- case 4:
2567
2678
  if (!this._componentDefinitionResolver) {
2568
- _context10.n = 10;
2679
+ _context11.n = 8;
2569
2680
  break;
2570
2681
  }
2571
2682
  missingIds = this.getMissingLibraryIds(jsonData);
2572
2683
  if (!(missingIds.length > 0)) {
2573
- _context10.n = 10;
2684
+ _context11.n = 8;
2574
2685
  break;
2575
2686
  }
2576
- _context10.p = 5;
2687
+ _context11.p = 3;
2577
2688
  console.log("\uD83D\uDD0D importScene(): Resolving ".concat(missingIds.length, " missing component definition(s)..."));
2578
- _context10.n = 6;
2689
+ _context11.n = 4;
2579
2690
  return this._componentDefinitionResolver(missingIds);
2580
- case 6:
2581
- resolved = _context10.v;
2691
+ case 4:
2692
+ resolved = _context11.v;
2582
2693
  if (!(resolved && _rollupPluginBabelHelpers["typeof"](resolved) === 'object' && Object.keys(resolved).length > 0)) {
2583
- _context10.n = 8;
2694
+ _context11.n = 6;
2584
2695
  break;
2585
2696
  }
2586
- _context10.n = 7;
2697
+ _context11.n = 5;
2587
2698
  return this.extendComponentDictionary(resolved);
2588
- case 7:
2699
+ case 5:
2589
2700
  console.log("\u2705 importScene(): Resolved ".concat(Object.keys(resolved).length, " component definition(s)"));
2590
- case 8:
2591
- _context10.n = 10;
2701
+ case 6:
2702
+ _context11.n = 8;
2592
2703
  break;
2593
- case 9:
2594
- _context10.p = 9;
2595
- _t4 = _context10.v;
2704
+ case 7:
2705
+ _context11.p = 7;
2706
+ _t4 = _context11.v;
2596
2707
  console.warn('⚠️ importScene(): Component definition resolver failed, continuing with existing dictionary:', _t4);
2597
- case 10:
2598
- _context10.n = 11;
2708
+ case 8:
2709
+ _context11.n = 9;
2599
2710
  return this.setImportedSceneData(jsonData);
2600
- case 11:
2711
+ case 9:
2601
2712
  if (!(this.sceneViewer && this.sceneViewer.sceneOperationsManager)) {
2602
- _context10.n = 13;
2713
+ _context11.n = 11;
2603
2714
  break;
2604
2715
  }
2605
- _context10.n = 12;
2716
+ _context11.n = 10;
2606
2717
  return this.sceneViewer.sceneOperationsManager.loadSceneFromData(jsonData);
2607
- case 12:
2718
+ case 10:
2608
2719
  console.log('✅ Scene imported successfully');
2609
- return _context10.a(2, true);
2610
- case 13:
2720
+ return _context11.a(2, true);
2721
+ case 11:
2611
2722
  console.error('❌ SceneViewer not available for scene loading');
2612
- return _context10.a(2, false);
2613
- case 14:
2614
- _context10.n = 16;
2723
+ return _context11.a(2, false);
2724
+ case 12:
2725
+ _context11.n = 14;
2615
2726
  break;
2616
- case 15:
2617
- _context10.p = 15;
2618
- _t5 = _context10.v;
2727
+ case 13:
2728
+ _context11.p = 13;
2729
+ _t5 = _context11.v;
2619
2730
  console.error('❌ Error importing scene:', _t5);
2620
- return _context10.a(2, false);
2621
- case 16:
2622
- return _context10.a(2);
2731
+ return _context11.a(2, false);
2732
+ case 14:
2733
+ return _context11.a(2);
2623
2734
  }
2624
- }, _callee10, this, [[5, 9], [1, 15]]);
2735
+ }, _callee11, this, [[3, 7], [1, 13]]);
2625
2736
  }));
2626
2737
  function importScene(_x6) {
2627
2738
  return _importScene.apply(this, arguments);
@@ -2645,33 +2756,33 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
2645
2756
  }, {
2646
2757
  key: "exportSceneJSON",
2647
2758
  value: (function () {
2648
- var _exportSceneJSON = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee11() {
2759
+ var _exportSceneJSON = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee12() {
2649
2760
  var filename,
2650
- _args11 = arguments,
2761
+ _args12 = arguments,
2651
2762
  _t6;
2652
- return _rollupPluginBabelHelpers.regenerator().w(function (_context11) {
2653
- while (1) switch (_context11.n) {
2763
+ return _rollupPluginBabelHelpers.regenerator().w(function (_context12) {
2764
+ while (1) switch (_context12.n) {
2654
2765
  case 0:
2655
- filename = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : null;
2766
+ filename = _args12.length > 0 && _args12[0] !== undefined ? _args12[0] : null;
2656
2767
  if (this.managers.sceneExportManager) {
2657
- _context11.n = 1;
2768
+ _context12.n = 1;
2658
2769
  break;
2659
2770
  }
2660
2771
  console.error('❌ Scene export manager not available');
2661
- return _context11.a(2, false);
2772
+ return _context12.a(2, false);
2662
2773
  case 1:
2663
- _context11.p = 1;
2664
- _context11.n = 2;
2774
+ _context12.p = 1;
2775
+ _context12.n = 2;
2665
2776
  return this.managers.sceneExportManager.downloadSceneJSON(filename);
2666
2777
  case 2:
2667
- return _context11.a(2, _context11.v);
2778
+ return _context12.a(2, _context12.v);
2668
2779
  case 3:
2669
- _context11.p = 3;
2670
- _t6 = _context11.v;
2780
+ _context12.p = 3;
2781
+ _t6 = _context12.v;
2671
2782
  console.error('❌ Error exporting scene as JSON:', _t6);
2672
- return _context11.a(2, false);
2783
+ return _context12.a(2, false);
2673
2784
  }
2674
- }, _callee11, this, [[1, 3]]);
2785
+ }, _callee12, this, [[1, 3]]);
2675
2786
  }));
2676
2787
  function exportSceneJSON() {
2677
2788
  return _exportSceneJSON.apply(this, arguments);
@@ -2696,33 +2807,33 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
2696
2807
  }, {
2697
2808
  key: "exportSceneGLTF",
2698
2809
  value: (function () {
2699
- var _exportSceneGLTF = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee12() {
2810
+ var _exportSceneGLTF = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee13() {
2700
2811
  var filename,
2701
- _args12 = arguments,
2812
+ _args13 = arguments,
2702
2813
  _t7;
2703
- return _rollupPluginBabelHelpers.regenerator().w(function (_context12) {
2704
- while (1) switch (_context12.n) {
2814
+ return _rollupPluginBabelHelpers.regenerator().w(function (_context13) {
2815
+ while (1) switch (_context13.n) {
2705
2816
  case 0:
2706
- filename = _args12.length > 0 && _args12[0] !== undefined ? _args12[0] : null;
2817
+ filename = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : null;
2707
2818
  if (this.managers.sceneExportManager) {
2708
- _context12.n = 1;
2819
+ _context13.n = 1;
2709
2820
  break;
2710
2821
  }
2711
2822
  console.error('❌ Scene export manager not available');
2712
- return _context12.a(2, false);
2823
+ return _context13.a(2, false);
2713
2824
  case 1:
2714
- _context12.p = 1;
2715
- _context12.n = 2;
2825
+ _context13.p = 1;
2826
+ _context13.n = 2;
2716
2827
  return this.managers.sceneExportManager.exportSceneAsGLTF(filename, false);
2717
2828
  case 2:
2718
- return _context12.a(2, _context12.v);
2829
+ return _context13.a(2, _context13.v);
2719
2830
  case 3:
2720
- _context12.p = 3;
2721
- _t7 = _context12.v;
2831
+ _context13.p = 3;
2832
+ _t7 = _context13.v;
2722
2833
  console.error('❌ Error exporting scene as GLTF:', _t7);
2723
- return _context12.a(2, false);
2834
+ return _context13.a(2, false);
2724
2835
  }
2725
- }, _callee12, this, [[1, 3]]);
2836
+ }, _callee13, this, [[1, 3]]);
2726
2837
  }));
2727
2838
  function exportSceneGLTF() {
2728
2839
  return _exportSceneGLTF.apply(this, arguments);
@@ -2748,33 +2859,33 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
2748
2859
  }, {
2749
2860
  key: "exportSceneGLB",
2750
2861
  value: (function () {
2751
- var _exportSceneGLB = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee13() {
2862
+ var _exportSceneGLB = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee14() {
2752
2863
  var filename,
2753
- _args13 = arguments,
2864
+ _args14 = arguments,
2754
2865
  _t8;
2755
- return _rollupPluginBabelHelpers.regenerator().w(function (_context13) {
2756
- while (1) switch (_context13.n) {
2866
+ return _rollupPluginBabelHelpers.regenerator().w(function (_context14) {
2867
+ while (1) switch (_context14.n) {
2757
2868
  case 0:
2758
- filename = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : null;
2869
+ filename = _args14.length > 0 && _args14[0] !== undefined ? _args14[0] : null;
2759
2870
  if (this.managers.sceneExportManager) {
2760
- _context13.n = 1;
2871
+ _context14.n = 1;
2761
2872
  break;
2762
2873
  }
2763
2874
  console.error('❌ Scene export manager not available');
2764
- return _context13.a(2, false);
2875
+ return _context14.a(2, false);
2765
2876
  case 1:
2766
- _context13.p = 1;
2767
- _context13.n = 2;
2877
+ _context14.p = 1;
2878
+ _context14.n = 2;
2768
2879
  return this.managers.sceneExportManager.exportSceneAsGLB(filename);
2769
2880
  case 2:
2770
- return _context13.a(2, _context13.v);
2881
+ return _context14.a(2, _context14.v);
2771
2882
  case 3:
2772
- _context13.p = 3;
2773
- _t8 = _context13.v;
2883
+ _context14.p = 3;
2884
+ _t8 = _context14.v;
2774
2885
  console.error('❌ Error exporting scene as GLB:', _t8);
2775
- return _context13.a(2, false);
2886
+ return _context14.a(2, false);
2776
2887
  }
2777
- }, _callee13, this, [[1, 3]]);
2888
+ }, _callee14, this, [[1, 3]]);
2778
2889
  }));
2779
2890
  function exportSceneGLB() {
2780
2891
  return _exportSceneGLB.apply(this, arguments);
@@ -2813,16 +2924,16 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
2813
2924
  }, {
2814
2925
  key: "loadSceneFromData",
2815
2926
  value: (function () {
2816
- var _loadSceneFromData = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee14(sceneData) {
2817
- return _rollupPluginBabelHelpers.regenerator().w(function (_context14) {
2818
- while (1) switch (_context14.n) {
2927
+ var _loadSceneFromData = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee15(sceneData) {
2928
+ return _rollupPluginBabelHelpers.regenerator().w(function (_context15) {
2929
+ while (1) switch (_context15.n) {
2819
2930
  case 0:
2820
- _context14.n = 1;
2931
+ _context15.n = 1;
2821
2932
  return this.setImportedSceneData(sceneData);
2822
2933
  case 1:
2823
- return _context14.a(2, true);
2934
+ return _context15.a(2, true);
2824
2935
  }
2825
- }, _callee14, this);
2936
+ }, _callee15, this);
2826
2937
  }));
2827
2938
  function loadSceneFromData(_x7) {
2828
2939
  return _loadSceneFromData.apply(this, arguments);
@@ -2847,9 +2958,9 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
2847
2958
  }, {
2848
2959
  key: "clearScene",
2849
2960
  value: function clearScene() {
2850
- var _this$sceneViewer12;
2961
+ var _this$sceneViewer13;
2851
2962
  this.importedSceneData = null;
2852
- var ioBehavMgr = (_this$sceneViewer12 = this.sceneViewer) === null || _this$sceneViewer12 === void 0 || (_this$sceneViewer12 = _this$sceneViewer12.managers) === null || _this$sceneViewer12 === void 0 ? void 0 : _this$sceneViewer12.ioBehaviorManager;
2963
+ var ioBehavMgr = (_this$sceneViewer13 = this.sceneViewer) === null || _this$sceneViewer13 === void 0 || (_this$sceneViewer13 = _this$sceneViewer13.managers) === null || _this$sceneViewer13 === void 0 ? void 0 : _this$sceneViewer13.ioBehaviorManager;
2853
2964
  if (ioBehavMgr) {
2854
2965
  ioBehavMgr.setCrossComponentBehaviors([]);
2855
2966
  }