redhotmagma-visualization 1.56.2 → 1.56.4

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,23 +1,29 @@
1
1
  var _excluded = ["modelFileName"];
2
2
  function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
3
3
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
4
+ function _regeneratorRuntime() { "use strict"; var r = _regenerator(), e = r.m(_regeneratorRuntime), t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor; function n(r) { var e = "function" == typeof r && r.constructor; return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name)); } var o = { "throw": 1, "return": 2, "break": 3, "continue": 3 }; function a(r) { var e, t; return function (n) { e || (e = { stop: function stop() { return t(n.a, 2); }, "catch": function _catch() { return n.v; }, abrupt: function abrupt(r, e) { return t(n.a, o[r], e); }, delegateYield: function delegateYield(r, o, a) { return e.resultName = o, t(n.d, _regeneratorValues(r), a); }, finish: function finish(r) { return t(n.f, r); } }, t = function t(r, _t, o) { n.p = e.prev, n.n = e.next; try { return r(_t, o); } finally { e.next = n.n; } }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n; try { return r.call(this, e); } finally { n.p = e.prev, n.n = e.next; } }; } return (_regeneratorRuntime = function _regeneratorRuntime() { return { wrap: function wrap(e, t, n, o) { return r.w(a(e), t, n, o && o.reverse()); }, isGeneratorFunction: n, mark: r.m, awrap: function awrap(r, e) { return new _OverloadYield(r, e); }, AsyncIterator: _regeneratorAsyncIterator, async: function async(r, e, t, o, u) { return (n(e) ? _regeneratorAsyncGen : _regeneratorAsync)(a(r), e, t, o, u); }, keys: _regeneratorKeys, values: _regeneratorValues }; })(); }
5
+ function _regeneratorValues(e) { if (null != e) { var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"], r = 0; if (t) return t.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) return { next: function next() { return e && r >= e.length && (e = void 0), { value: e && e[r++], done: !e }; } }; } throw new TypeError(_typeof(e) + " is not iterable"); }
6
+ function _regeneratorKeys(e) { var n = Object(e), r = []; for (var t in n) r.unshift(t); return function e() { for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e; return e.done = !0, e; }; }
7
+ function _regeneratorAsync(n, e, r, t, o) { var a = _regeneratorAsyncGen(n, e, r, t, o); return a.next().then(function (n) { return n.done ? n.value : a.next(); }); }
8
+ function _regeneratorAsyncGen(r, e, t, o, n) { return new _regeneratorAsyncIterator(_regenerator().w(r, e, t, o), n || Promise); }
9
+ function _regeneratorAsyncIterator(t, e) { function n(r, o, i, f) { try { var c = t[r](o), u = c.value; return u instanceof _OverloadYield ? e.resolve(u.v).then(function (t) { n("next", t, i, f); }, function (t) { n("throw", t, i, f); }) : e.resolve(u).then(function (t) { c.value = t, i(c); }, function (t) { return n("throw", t, i, f); }); } catch (t) { f(t); } } var r; this.next || (_regeneratorDefine2(_regeneratorAsyncIterator.prototype), _regeneratorDefine2(_regeneratorAsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () { return this; })), _regeneratorDefine2(this, "_invoke", function (t, o, i) { function f() { return new e(function (e, r) { n(t, i, e, r); }); } return r = r ? r.then(f, f) : f(); }, !0); }
4
10
  function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
5
11
  function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
12
+ function _OverloadYield(e, d) { this.v = e, this.k = d; }
6
13
  function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
7
14
  function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
8
- function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
9
15
  function _get() { return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); }
10
16
  function _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; }
11
17
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
12
18
  function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
13
19
  function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
14
- function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
20
+ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
21
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
22
+ function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
15
23
  function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
16
24
  function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
17
25
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
18
26
  function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
19
- function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
20
- function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
21
27
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
22
28
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
23
29
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
@@ -267,29 +273,31 @@ function setCameraAspectFromRendererSize(camera, renderer) {
267
273
  camera.updateProjectionMatrix();
268
274
  }
269
275
  export var Three3DScene = /*#__PURE__*/function (_Three3D) {
276
+ _inherits(Three3DScene, _Three3D);
277
+ var _super = _createSuper(Three3DScene);
270
278
  function Three3DScene() {
271
279
  var _this;
272
280
  var cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
273
281
  _classCallCheck(this, Three3DScene);
274
- _this = _callSuper(this, Three3DScene, [cfg]);
275
- _defineProperty(_this, "DefaultCustomizableMaterialKey", "CustomizableMaterial");
276
- _defineProperty(_this, "clock", new Clock());
277
- _defineProperty(_this, "animations", []);
278
- _defineProperty(_this, "currentResourceList", []);
279
- _defineProperty(_this, "sceneContainer", function () {
282
+ _this = _super.call(this, cfg);
283
+ _defineProperty(_assertThisInitialized(_this), "DefaultCustomizableMaterialKey", "CustomizableMaterial");
284
+ _defineProperty(_assertThisInitialized(_this), "clock", new Clock());
285
+ _defineProperty(_assertThisInitialized(_this), "animations", []);
286
+ _defineProperty(_assertThisInitialized(_this), "currentResourceList", []);
287
+ _defineProperty(_assertThisInitialized(_this), "sceneContainer", function () {
280
288
  var g = new Group();
281
289
  g.name = "sceneContainer";
282
290
  return g;
283
291
  }());
284
- _defineProperty(_this, "mixer", new AnimationMixer(_this.sceneContainer));
285
- _defineProperty(_this, "defaultCamera", null);
286
- _defineProperty(_this, "dirLightPosition", new Vector3(1, 1, 1).normalize());
287
- _defineProperty(_this, "defaultCameraPosition", new Vector3(0, 1, 2).normalize());
288
- _defineProperty(_this, "defaultScreenshotPosition", new Vector3(0, 1, 2).normalize());
289
- _defineProperty(_this, "relativeCameraViews", {});
290
- _defineProperty(_this, "relativeScreenshotViews", {});
291
- _defineProperty(_this, "groundObjectNames", [/ground/i]);
292
- _defineProperty(_this, "config", {
292
+ _defineProperty(_assertThisInitialized(_this), "mixer", new AnimationMixer(_this.sceneContainer));
293
+ _defineProperty(_assertThisInitialized(_this), "defaultCamera", null);
294
+ _defineProperty(_assertThisInitialized(_this), "dirLightPosition", new Vector3(1, 1, 1).normalize());
295
+ _defineProperty(_assertThisInitialized(_this), "defaultCameraPosition", new Vector3(0, 1, 2).normalize());
296
+ _defineProperty(_assertThisInitialized(_this), "defaultScreenshotPosition", new Vector3(0, 1, 2).normalize());
297
+ _defineProperty(_assertThisInitialized(_this), "relativeCameraViews", {});
298
+ _defineProperty(_assertThisInitialized(_this), "relativeScreenshotViews", {});
299
+ _defineProperty(_assertThisInitialized(_this), "groundObjectNames", [/ground/i]);
300
+ _defineProperty(_assertThisInitialized(_this), "config", {
293
301
  useShadowGround: true,
294
302
  shadowGroundShadowColor: 0x808080,
295
303
  removeGroundForScreenshot: true,
@@ -318,12 +326,12 @@ export var Three3DScene = /*#__PURE__*/function (_Three3D) {
318
326
  },
319
327
  textureImageCacheSize: 20
320
328
  });
321
- _defineProperty(_this, "onLoadError", function (url) {
329
+ _defineProperty(_assertThisInitialized(_this), "onLoadError", function (url) {
322
330
  var errorMessage = "Could not load file: ".concat(url);
323
331
  // eslint-disable-next-line no-console
324
332
  console.error(errorMessage);
325
333
  });
326
- _defineProperty(_this, "animate", function () {
334
+ _defineProperty(_assertThisInitialized(_this), "animate", function () {
327
335
  var time = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
328
336
  if (!_this._isAnimating) {
329
337
  window.cancelAnimationFrame(_this._animationFrame);
@@ -341,10 +349,10 @@ export var Three3DScene = /*#__PURE__*/function (_Three3D) {
341
349
  _this.render();
342
350
  }
343
351
  });
344
- _defineProperty(_this, "helpers", {
352
+ _defineProperty(_assertThisInitialized(_this), "helpers", {
345
353
  addDirectionalLightHelper: function addDirectionalLightHelper() {
346
- var _this2 = _this,
347
- dirLight = _this2.dirLight;
354
+ var _assertThisInitialize = _assertThisInitialized(_this),
355
+ dirLight = _assertThisInitialize.dirLight;
348
356
  var cameraHelper = new CameraHelper(dirLight.shadow.camera);
349
357
  _this.scene.add(cameraHelper);
350
358
  },
@@ -363,8 +371,7 @@ export var Three3DScene = /*#__PURE__*/function (_Three3D) {
363
371
  cfg.modelBasePath ? _this._modelBasePath = cfg.modelBasePath : _this._modelBasePath = "";
364
372
  return _this;
365
373
  }
366
- _inherits(Three3DScene, _Three3D);
367
- return _createClass(Three3DScene, [{
374
+ _createClass(Three3DScene, [{
368
375
  key: "setOptions3D",
369
376
  value: function setOptions3D(options) {
370
377
  merge(this.config, options);
@@ -397,16 +404,17 @@ export var Three3DScene = /*#__PURE__*/function (_Three3D) {
397
404
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
398
405
  var loadingManager = this.createLoadingManager(options);
399
406
  if (!this.dracoLoader) {
400
- var dracoLoader = new (/*#__PURE__*/function (_DRACOLoader) {
407
+ var dracoLoader = new ( /*#__PURE__*/function (_DRACOLoader) {
408
+ _inherits(PatchedDRACOLoader, _DRACOLoader);
409
+ var _super2 = _createSuper(PatchedDRACOLoader);
401
410
  function PatchedDRACOLoader() {
402
411
  _classCallCheck(this, PatchedDRACOLoader);
403
- return _callSuper(this, PatchedDRACOLoader, arguments);
412
+ return _super2.apply(this, arguments);
404
413
  }
405
- _inherits(PatchedDRACOLoader, _DRACOLoader);
406
- return _createClass(PatchedDRACOLoader, [{
414
+ _createClass(PatchedDRACOLoader, [{
407
415
  key: "decodeGeometry",
408
416
  value: function decodeGeometry(buffer, taskConfig) {
409
- return _superPropGet(PatchedDRACOLoader, "decodeGeometry", this, 3)([buffer, taskConfig])["catch"](function (e) {
417
+ return _get(_getPrototypeOf(PatchedDRACOLoader.prototype), "decodeGeometry", this).call(this, buffer, taskConfig)["catch"](function (e) {
410
418
  // eslint-disable-next-line no-console
411
419
  console.error(e.message || e.error);
412
420
  // make sure an empty geometry is returned to not break the app
@@ -416,6 +424,7 @@ export var Three3DScene = /*#__PURE__*/function (_Three3D) {
416
424
  });
417
425
  }
418
426
  }]);
427
+ return PatchedDRACOLoader;
419
428
  }(DRACOLoader))();
420
429
  dracoLoader.setDecoderPath("libs/draco/gltf/");
421
430
  this.dracoLoader = dracoLoader;
@@ -477,18 +486,18 @@ export var Three3DScene = /*#__PURE__*/function (_Three3D) {
477
486
  }, {
478
487
  key: "loadEnvMap",
479
488
  value: function loadEnvMap(renderer) {
480
- var _this3 = this;
489
+ var _this2 = this;
481
490
  var envMapURL = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getDefaultEnvMapURL();
482
491
  if (this.config.useEnvironmentMap) {
483
492
  var pmremGenerator = new PMREMGenerator(renderer);
484
493
  pmremGenerator.compileEquirectangularShader();
485
494
  this.envMapPromise = new Promise(function (resolve, reject) {
486
495
  new RGBELoader().load(envMapURL, function (texture) {
487
- _this3.envMap = pmremGenerator.fromEquirectangular(texture).texture;
488
- _this3.scene.environment = _this3.envMap;
496
+ _this2.envMap = pmremGenerator.fromEquirectangular(texture).texture;
497
+ _this2.scene.environment = _this2.envMap;
489
498
  texture.dispose();
490
499
  pmremGenerator.dispose();
491
- resolve(_this3.envMap);
500
+ resolve(_this2.envMap);
492
501
  }, undefined, reject);
493
502
  });
494
503
  }
@@ -605,115 +614,116 @@ export var Three3DScene = /*#__PURE__*/function (_Three3D) {
605
614
  }, {
606
615
  key: "fixImportedScene",
607
616
  value: function fixImportedScene(scene) {
608
- var _this4 = this;
617
+ var _this3 = this;
609
618
  scene.traverse(function (object) {
610
619
  if (object.isMesh) {
611
620
  object.castShadow = true;
612
- if (_this4.config.softShadow.selfShadow) {
621
+ if (_this3.config.softShadow.selfShadow) {
613
622
  object.receiveShadow = true;
614
623
  }
615
624
  }
616
- if (object.isLight && object.target && _this4.ground) {
617
- object.target = _this4.ground;
618
- _this4.setLightShadow(object);
625
+ if (object.isLight && object.target && _this3.ground) {
626
+ object.target = _this3.ground;
627
+ _this3.setLightShadow(object);
619
628
  }
620
629
  });
621
630
  }
622
631
  }, {
623
632
  key: "applyMaterialParams",
624
633
  value: function () {
625
- var _applyMaterialParams = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(model, materialOptions, imageLoader) {
626
- var _this5 = this;
627
- var imageRepository, params, _t2;
628
- return _regenerator().w(function (_context3) {
629
- while (1) switch (_context3.n) {
634
+ var _applyMaterialParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(model, materialOptions, imageLoader) {
635
+ var _this4 = this;
636
+ var imageRepository, params;
637
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
638
+ while (1) switch (_context3.prev = _context3.next) {
630
639
  case 0:
631
640
  imageRepository = this.useImageRepository(imageLoader);
632
641
  if (!materialOptions) {
633
- _context3.n = 1;
642
+ _context3.next = 7;
634
643
  break;
635
644
  }
636
645
  params = materialOptions.params;
637
- _t2 = params;
638
- if (!_t2) {
639
- _context3.n = 1;
646
+ _context3.t0 = params;
647
+ if (!_context3.t0) {
648
+ _context3.next = 7;
640
649
  break;
641
650
  }
642
- _context3.n = 1;
643
- return Promise.all(getAllMaterials(model).map(/*#__PURE__*/function () {
644
- var _ref6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(material) {
651
+ _context3.next = 7;
652
+ return Promise.all(getAllMaterials(model).map( /*#__PURE__*/function () {
653
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(material) {
645
654
  var materialName, materialNames;
646
- return _regenerator().w(function (_context2) {
647
- while (1) switch (_context2.n) {
655
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
656
+ while (1) switch (_context2.prev = _context2.next) {
648
657
  case 0:
649
658
  materialName = params.materialName, materialNames = params.materialNames; // check materialNames list if provided
650
659
  if (!(materialNames instanceof Array && materialNames.indexOf(material.name) === -1)) {
651
- _context2.n = 1;
660
+ _context2.next = 3;
652
661
  break;
653
662
  }
654
- return _context2.a(2);
655
- case 1:
663
+ return _context2.abrupt("return");
664
+ case 3:
656
665
  if (!(materialName && material.name !== materialName)) {
657
- _context2.n = 2;
666
+ _context2.next = 5;
658
667
  break;
659
668
  }
660
- return _context2.a(2);
661
- case 2:
669
+ return _context2.abrupt("return");
670
+ case 5:
662
671
  if (!(!materialName && size(params) === 1 && params.map && material.name !== "ColorMaterial")) {
663
- _context2.n = 3;
672
+ _context2.next = 7;
664
673
  break;
665
674
  }
666
- return _context2.a(2);
667
- case 3:
668
- _context2.n = 4;
669
- return Promise.all(Object.keys(params).map(/*#__PURE__*/function () {
670
- var _ref7 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(p) {
671
- var _material$p, _material$map, texture, src, textureSource, value, _t;
672
- return _regenerator().w(function (_context) {
673
- while (1) switch (_context.n) {
675
+ return _context2.abrupt("return");
676
+ case 7:
677
+ _context2.next = 9;
678
+ return Promise.all(Object.keys(params).map( /*#__PURE__*/function () {
679
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(p) {
680
+ var _material$p, _material$map, texture, src, textureSource, value;
681
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
682
+ while (1) switch (_context.prev = _context.next) {
674
683
  case 0:
675
684
  if (!(params[p] === UNSET)) {
676
- _context.n = 1;
685
+ _context.next = 2;
677
686
  break;
678
687
  }
679
- return _context.a(2);
680
- case 1:
681
- _t = p;
682
- _context.n = _t === "alphaMap" ? 2 : _t === "aoMap" ? 2 : _t === "emissiveMap" ? 2 : _t === "lightMap" ? 2 : _t === "map" ? 2 : _t === "metalnessMap" ? 2 : _t === "normalMap" ? 2 : _t === "roughnessMap" ? 2 : _t === "clearcoatMap" ? 2 : _t === "clearcoatNormalMap" ? 2 : _t === "clearcoatRoughnessMap" ? 2 : _t === "sheenRoughnessMap" ? 2 : _t === "sheenColorMap" ? 2 : _t === "specularIntensityMap" ? 2 : _t === "specularColorMap" ? 2 : _t === "thicknessMap" ? 2 : _t === "transmissionMap" ? 2 : _t === "aoMapIntensity" ? 6 : _t === "emissiveIntensity" ? 6 : _t === "envMapIntensity" ? 6 : _t === "lightMapIntensity" ? 6 : _t === "metalness" ? 6 : _t === "opacity" ? 6 : _t === "refractionRatio" ? 6 : _t === "roughness" ? 6 : _t === "attenuationDistance" ? 6 : _t === "clearcoat" ? 6 : _t === "clearcoatRoughness" ? 6 : _t === "ior" ? 6 : _t === "reflectivity" ? 6 : _t === "sheen" ? 6 : _t === "sheenRoughness" ? 6 : _t === "specularIntensity" ? 6 : _t === "thickness" ? 6 : _t === "transmission" ? 6 : _t === "color" ? 7 : _t === "emissive" ? 7 : _t === "attenuationColor" ? 7 : _t === "sheenColor" ? 7 : _t === "specularColor" ? 7 : 8;
683
- break;
688
+ return _context.abrupt("return");
684
689
  case 2:
690
+ _context.t0 = p;
691
+ _context.next = _context.t0 === "alphaMap" ? 5 : _context.t0 === "aoMap" ? 5 : _context.t0 === "emissiveMap" ? 5 : _context.t0 === "lightMap" ? 5 : _context.t0 === "map" ? 5 : _context.t0 === "metalnessMap" ? 5 : _context.t0 === "normalMap" ? 5 : _context.t0 === "roughnessMap" ? 5 : _context.t0 === "clearcoatMap" ? 5 : _context.t0 === "clearcoatNormalMap" ? 5 : _context.t0 === "clearcoatRoughnessMap" ? 5 : _context.t0 === "sheenRoughnessMap" ? 5 : _context.t0 === "sheenColorMap" ? 5 : _context.t0 === "specularIntensityMap" ? 5 : _context.t0 === "specularColorMap" ? 5 : _context.t0 === "thicknessMap" ? 5 : _context.t0 === "transmissionMap" ? 5 : _context.t0 === "aoMapIntensity" ? 20 : _context.t0 === "emissiveIntensity" ? 20 : _context.t0 === "envMapIntensity" ? 20 : _context.t0 === "lightMapIntensity" ? 20 : _context.t0 === "metalness" ? 20 : _context.t0 === "opacity" ? 20 : _context.t0 === "refractionRatio" ? 20 : _context.t0 === "roughness" ? 20 : _context.t0 === "attenuationDistance" ? 20 : _context.t0 === "clearcoat" ? 20 : _context.t0 === "clearcoatRoughness" ? 20 : _context.t0 === "ior" ? 20 : _context.t0 === "reflectivity" ? 20 : _context.t0 === "sheen" ? 20 : _context.t0 === "sheenRoughness" ? 20 : _context.t0 === "specularIntensity" ? 20 : _context.t0 === "thickness" ? 20 : _context.t0 === "transmission" ? 20 : _context.t0 === "color" ? 23 : _context.t0 === "emissive" ? 23 : _context.t0 === "attenuationColor" ? 23 : _context.t0 === "sheenColor" ? 23 : _context.t0 === "specularColor" ? 23 : 25;
692
+ break;
693
+ case 5:
685
694
  texture = ((_material$p = material[p]) === null || _material$p === void 0 ? void 0 : _material$p.clone()) || new Texture();
686
695
  texture.flipY = ((_material$map = material.map) === null || _material$map === void 0 ? void 0 : _material$map.flipY) || false;
687
696
  src = imageLoader.manager.resolveURL(params[p]);
688
- textureSource = findImageBySrc(_this5.sceneContainer, src);
697
+ textureSource = findImageBySrc(_this4.sceneContainer, src);
689
698
  if (!textureSource) {
690
- _context.n = 3;
699
+ _context.next = 13;
691
700
  break;
692
701
  }
693
702
  texture.source = textureSource;
694
- _context.n = 5;
703
+ _context.next = 16;
695
704
  break;
696
- case 3:
697
- _context.n = 4;
705
+ case 13:
706
+ _context.next = 15;
698
707
  return imageRepository.loadImage(params[p]);
699
- case 4:
700
- texture.image = _context.v;
701
- case 5:
708
+ case 15:
709
+ texture.image = _context.sent;
710
+ case 16:
702
711
  texture.userData.src = src;
703
712
  texture.needsUpdate = true;
704
713
  material[p] = texture;
705
- return _context.a(3, 8);
706
- case 6:
714
+ return _context.abrupt("break", 25);
715
+ case 20:
707
716
  value = parseFloat(params[p]);
708
717
  if (!isNaN(value)) {
709
718
  material[p] = value;
710
719
  }
711
- return _context.a(3, 8);
712
- case 7:
720
+ return _context.abrupt("break", 25);
721
+ case 23:
713
722
  material[p] = new Color(params[p]);
714
- return _context.a(3, 8);
715
- case 8:
716
- return _context.a(2);
723
+ return _context.abrupt("break", 25);
724
+ case 25:
725
+ case "end":
726
+ return _context.stop();
717
727
  }
718
728
  }, _callee);
719
729
  }));
@@ -721,14 +731,15 @@ export var Three3DScene = /*#__PURE__*/function (_Three3D) {
721
731
  return _ref7.apply(this, arguments);
722
732
  };
723
733
  }()));
724
- case 4:
734
+ case 9:
725
735
  if (material.alphaMap) {
726
736
  material.transparent = true;
727
737
  material.side = DoubleSide;
728
738
  }
729
739
  material.needsUpdate = true;
730
- case 5:
731
- return _context2.a(2);
740
+ case 11:
741
+ case "end":
742
+ return _context2.stop();
732
743
  }
733
744
  }, _callee2);
734
745
  }));
@@ -736,8 +747,9 @@ export var Three3DScene = /*#__PURE__*/function (_Three3D) {
736
747
  return _ref6.apply(this, arguments);
737
748
  };
738
749
  }()));
739
- case 1:
740
- return _context3.a(2);
750
+ case 7:
751
+ case "end":
752
+ return _context3.stop();
741
753
  }
742
754
  }, _callee3, this);
743
755
  }));
@@ -749,8 +761,8 @@ export var Three3DScene = /*#__PURE__*/function (_Three3D) {
749
761
  }, {
750
762
  key: "applyCustomizations",
751
763
  value: function () {
752
- var _applyCustomizations = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(model, item, imageLoader) {
753
- var _this6 = this;
764
+ var _applyCustomizations = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(model, item, imageLoader) {
765
+ var _this5 = this;
754
766
  var options,
755
767
  _options$saveAndResto,
756
768
  saveAndRestore,
@@ -758,10 +770,9 @@ export var Three3DScene = /*#__PURE__*/function (_Three3D) {
758
770
  materials,
759
771
  material,
760
772
  allMaterials,
761
- _args4 = arguments,
762
- _t3;
763
- return _regenerator().w(function (_context4) {
764
- while (1) switch (_context4.n) {
773
+ _args4 = arguments;
774
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
775
+ while (1) switch (_context4.prev = _context4.next) {
765
776
  case 0:
766
777
  options = _args4.length > 3 && _args4[3] !== undefined ? _args4[3] : {};
767
778
  _options$saveAndResto = options.saveAndRestore, saveAndRestore = _options$saveAndResto === void 0 ? true : _options$saveAndResto;
@@ -848,17 +859,18 @@ export var Three3DScene = /*#__PURE__*/function (_Three3D) {
848
859
  allMaterials = [].concat(_toConsumableArray(materials), [material]).filter(function (v) {
849
860
  return v;
850
861
  });
851
- _t3 = allMaterials.length;
852
- if (!_t3) {
853
- _context4.n = 1;
862
+ _context4.t0 = allMaterials.length;
863
+ if (!_context4.t0) {
864
+ _context4.next = 12;
854
865
  break;
855
866
  }
856
- _context4.n = 1;
867
+ _context4.next = 12;
857
868
  return Promise.all(allMaterials.map(function (material) {
858
- return _this6.applyMaterialParams(model, material, imageLoader);
869
+ return _this5.applyMaterialParams(model, material, imageLoader);
859
870
  }));
860
- case 1:
861
- return _context4.a(2);
871
+ case 12:
872
+ case "end":
873
+ return _context4.stop();
862
874
  }
863
875
  }, _callee4);
864
876
  }));
@@ -870,7 +882,7 @@ export var Three3DScene = /*#__PURE__*/function (_Three3D) {
870
882
  }, {
871
883
  key: "loadSceneContainer",
872
884
  value: function loadSceneContainer(item) {
873
- var _this7 = this;
885
+ var _this6 = this;
874
886
  var path;
875
887
  var itemType = _typeof(item);
876
888
  if ("string" === itemType) {
@@ -885,27 +897,28 @@ export var Three3DScene = /*#__PURE__*/function (_Three3D) {
885
897
  var imageLoader = this.createImageLoader(loaderOptions);
886
898
  return new Promise(function (resolve, reject) {
887
899
  modelLoader.load(modelFileName, /*#__PURE__*/function () {
888
- var _ref8 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(gltf) {
900
+ var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(gltf) {
889
901
  var model;
890
- return _regenerator().w(function (_context5) {
891
- while (1) switch (_context5.n) {
902
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
903
+ while (1) switch (_context5.prev = _context5.next) {
892
904
  case 0:
893
905
  model = gltf.scene;
894
906
  model.userData.path = path;
895
907
  if (undefined !== item.index) {
896
908
  model.userData.index = item.index;
897
909
  }
898
- _this7.fixImportedScene(model);
910
+ _this6.fixImportedScene(model);
899
911
  if (!("object" === itemType)) {
900
- _context5.n = 1;
912
+ _context5.next = 7;
901
913
  break;
902
914
  }
903
- _context5.n = 1;
904
- return _this7.applyCustomizations(model, item, imageLoader);
905
- case 1:
915
+ _context5.next = 7;
916
+ return _this6.applyCustomizations(model, item, imageLoader);
917
+ case 7:
906
918
  resolve(gltf);
907
- case 2:
908
- return _context5.a(2);
919
+ case 8:
920
+ case "end":
921
+ return _context5.stop();
909
922
  }
910
923
  }, _callee5);
911
924
  }));
@@ -945,10 +958,10 @@ export var Three3DScene = /*#__PURE__*/function (_Three3D) {
945
958
  }, {
946
959
  key: "initCustomizableMaterialsIfNeeded",
947
960
  value: function () {
948
- var _initCustomizableMaterialsIfNeeded = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6() {
961
+ var _initCustomizableMaterialsIfNeeded = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
949
962
  var materials;
950
- return _regenerator().w(function (_context6) {
951
- while (1) switch (_context6.n) {
963
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
964
+ while (1) switch (_context6.prev = _context6.next) {
952
965
  case 0:
953
966
  // reset customizable materials to always find the right one in the loaded scene
954
967
  this._customizableMaterialKeys.length = 0;
@@ -958,10 +971,11 @@ export var Three3DScene = /*#__PURE__*/function (_Three3D) {
958
971
  this.guessCustomizableMaterialNameIfNotSet(materials);
959
972
  this.findCustomizableMaterials(materials);
960
973
  }
961
- _context6.n = 1;
974
+ _context6.next = 6;
962
975
  return this.dispatchMaterialUpdateEvent();
963
- case 1:
964
- return _context6.a(2);
976
+ case 6:
977
+ case "end":
978
+ return _context6.stop();
965
979
  }
966
980
  }, _callee6, this);
967
981
  }));
@@ -996,51 +1010,54 @@ export var Three3DScene = /*#__PURE__*/function (_Three3D) {
996
1010
  }, {
997
1011
  key: "loadSceneSync",
998
1012
  value: function () {
999
- var _loadSceneSync = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(resourceList) {
1000
- var result, _t4, _t5, _t6;
1001
- return _regenerator().w(function (_context7) {
1002
- while (1) switch (_context7.p = _context7.n) {
1013
+ var _loadSceneSync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(resourceList) {
1014
+ var result;
1015
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
1016
+ while (1) switch (_context7.prev = _context7.next) {
1003
1017
  case 0:
1004
- _context7.p = 0;
1005
- _context7.n = 1;
1018
+ _context7.prev = 0;
1019
+ _context7.next = 3;
1006
1020
  return this._loadScenePromise;
1007
- case 1:
1008
- _context7.n = 3;
1009
- break;
1010
- case 2:
1011
- _context7.p = 2;
1012
- _t4 = _context7.v;
1013
1021
  case 3:
1014
- _context7.p = 3;
1022
+ _context7.next = 7;
1023
+ break;
1024
+ case 5:
1025
+ _context7.prev = 5;
1026
+ _context7.t0 = _context7["catch"](0);
1027
+ case 7:
1028
+ _context7.prev = 7;
1015
1029
  this._loadScenePromise = this.loadScene(resourceList);
1016
- _context7.n = 4;
1030
+ _context7.next = 11;
1017
1031
  return this._loadScenePromise;
1018
- case 4:
1019
- result = _context7.v;
1020
- _context7.n = 6;
1032
+ case 11:
1033
+ result = _context7.sent;
1034
+ _context7.next = 17;
1021
1035
  break;
1022
- case 5:
1023
- _context7.p = 5;
1024
- _t5 = _context7.v;
1036
+ case 14:
1037
+ _context7.prev = 14;
1038
+ _context7.t1 = _context7["catch"](7);
1025
1039
  // remove promise if it is failed
1026
1040
  delete this._loadScenePromise;
1027
- case 6:
1028
- _context7.p = 6;
1029
- _context7.n = 7;
1041
+ case 17:
1042
+ _context7.prev = 17;
1043
+ _context7.next = 20;
1030
1044
  return this.envMapPromise;
1031
- case 7:
1032
- _context7.n = 9;
1045
+ case 20:
1046
+ _context7.next = 24;
1033
1047
  break;
1034
- case 8:
1035
- _context7.p = 8;
1036
- _t6 = _context7.v;
1037
- case 9:
1048
+ case 22:
1049
+ _context7.prev = 22;
1050
+ _context7.t2 = _context7["catch"](17);
1051
+ case 24:
1038
1052
  if (!this.isAnimating()) {
1039
1053
  this.render();
1040
1054
  }
1041
- return _context7.a(2, result);
1055
+ return _context7.abrupt("return", result);
1056
+ case 26:
1057
+ case "end":
1058
+ return _context7.stop();
1042
1059
  }
1043
- }, _callee7, this, [[6, 8], [3, 5], [0, 2]]);
1060
+ }, _callee7, this, [[0, 5], [7, 14], [17, 22]]);
1044
1061
  }));
1045
1062
  function loadSceneSync(_x1) {
1046
1063
  return _loadSceneSync.apply(this, arguments);
@@ -1050,11 +1067,11 @@ export var Three3DScene = /*#__PURE__*/function (_Three3D) {
1050
1067
  }, {
1051
1068
  key: "loadScene",
1052
1069
  value: function () {
1053
- var _loadScene = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8(resourceList) {
1054
- var _this8 = this;
1070
+ var _loadScene = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(resourceList) {
1071
+ var _this7 = this;
1055
1072
  var sceneContainer, _diffResourceLists, toBeRemoved, toBeAdded, toBeUpdated, toBeApplied, shouldResetScene, toBeDisposed, triggerLoadEvent, sceneParts, imageLoader, mixer, animations;
1056
- return _regenerator().w(function (_context8) {
1057
- while (1) switch (_context8.n) {
1073
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
1074
+ while (1) switch (_context8.prev = _context8.next) {
1058
1075
  case 0:
1059
1076
  sceneContainer = this.sceneContainer;
1060
1077
  this.stopAnimation();
@@ -1079,12 +1096,12 @@ export var Three3DScene = /*#__PURE__*/function (_Three3D) {
1079
1096
  });
1080
1097
  triggerLoadEvent = !!(toBeAdded.length || toBeUpdated.length || toBeApplied.length);
1081
1098
  triggerLoadEvent && this.onLoadStart();
1082
- _context8.n = 1;
1099
+ _context8.next = 13;
1083
1100
  return Promise.allSettled(toBeAdded.map(function (item) {
1084
- return _this8.loadSceneContainer(item);
1101
+ return _this7.loadSceneContainer(item);
1085
1102
  }));
1086
- case 1:
1087
- sceneParts = _context8.v;
1103
+ case 13:
1104
+ sceneParts = _context8.sent;
1088
1105
  sceneParts.forEach(function (_ref0, index) {
1089
1106
  var value = _ref0.value,
1090
1107
  reason = _ref0.reason;
@@ -1099,10 +1116,10 @@ export var Three3DScene = /*#__PURE__*/function (_Three3D) {
1099
1116
 
1100
1117
  // collect animations
1101
1118
  if (animations.length) {
1102
- var _this8$animations;
1103
- (_this8$animations = _this8.animations).push.apply(_this8$animations, _toConsumableArray(animations.filter(function (_ref1) {
1119
+ var _this7$animations;
1120
+ (_this7$animations = _this7.animations).push.apply(_this7$animations, _toConsumableArray(animations.filter(function (_ref1) {
1104
1121
  var name = _ref1.name;
1105
- return !_this8.animations.find(function (_ref10) {
1122
+ return !_this7.animations.find(function (_ref10) {
1106
1123
  var existingName = _ref10.name;
1107
1124
  return name !== existingName;
1108
1125
  });
@@ -1111,7 +1128,7 @@ export var Three3DScene = /*#__PURE__*/function (_Three3D) {
1111
1128
  });
1112
1129
  this.checkEmptyScene();
1113
1130
  sceneContainer.updateWorldMatrix(true, true);
1114
- _context8.n = 2;
1131
+ _context8.next = 19;
1115
1132
  return Promise.all(toBeUpdated.map(function (item) {
1116
1133
  var itemSrc = getSrc(item);
1117
1134
  var object = findObjectWith(sceneContainer, function (_ref11) {
@@ -1119,16 +1136,16 @@ export var Three3DScene = /*#__PURE__*/function (_Three3D) {
1119
1136
  return userData.path === itemSrc && userData.index === item.index;
1120
1137
  });
1121
1138
  var path = getSrc(item);
1122
- var loaderOptions = _this8.parseModelPath(path);
1123
- var imageLoader = _this8.createImageLoader(loaderOptions);
1124
- return object && _this8.applyCustomizations(object, item, imageLoader);
1139
+ var loaderOptions = _this7.parseModelPath(path);
1140
+ var imageLoader = _this7.createImageLoader(loaderOptions);
1141
+ return object && _this7.applyCustomizations(object, item, imageLoader);
1125
1142
  }));
1126
- case 2:
1143
+ case 19:
1127
1144
  // apply global or targeted param values
1128
1145
  imageLoader = this.createImageLoader({
1129
1146
  basePath: this._modelBasePath
1130
1147
  });
1131
- _context8.n = 3;
1148
+ _context8.next = 22;
1132
1149
  return Promise.all(toBeApplied.map(function (_ref12) {
1133
1150
  var optionParams = _ref12.params,
1134
1151
  files = _ref12.files;
@@ -1156,15 +1173,15 @@ export var Three3DScene = /*#__PURE__*/function (_Three3D) {
1156
1173
  })
1157
1174
  };
1158
1175
  return Promise.all(objects.map(function (object) {
1159
- return _this8.applyCustomizations(object, item, imageLoader, {
1176
+ return _this7.applyCustomizations(object, item, imageLoader, {
1160
1177
  saveAndRestore: false
1161
1178
  });
1162
1179
  }));
1163
1180
  }));
1164
- case 3:
1165
- _context8.n = 4;
1181
+ case 22:
1182
+ _context8.next = 24;
1166
1183
  return this.initCustomizableMaterialsIfNeeded();
1167
- case 4:
1184
+ case 24:
1168
1185
  this.fixSceneScaling();
1169
1186
  this.setupGround();
1170
1187
  this.addLightsIfNeeded(sceneContainer);
@@ -1180,8 +1197,9 @@ export var Three3DScene = /*#__PURE__*/function (_Three3D) {
1180
1197
  mixer.clipAction(animations[0]).play();
1181
1198
  this.startAnimation("builtin");
1182
1199
  }
1183
- case 5:
1184
- return _context8.a(2);
1200
+ case 31:
1201
+ case "end":
1202
+ return _context8.stop();
1185
1203
  }
1186
1204
  }, _callee8, this);
1187
1205
  }));
@@ -1525,22 +1543,23 @@ export var Three3DScene = /*#__PURE__*/function (_Three3D) {
1525
1543
  }, {
1526
1544
  key: "update",
1527
1545
  value: function () {
1528
- var _update = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(configuration) {
1529
- var sceneData, _t7;
1530
- return _regenerator().w(function (_context9) {
1531
- while (1) switch (_context9.n) {
1546
+ var _update = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(configuration) {
1547
+ var sceneData;
1548
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
1549
+ while (1) switch (_context9.prev = _context9.next) {
1532
1550
  case 0:
1533
1551
  this._configuration = configuration;
1534
1552
  sceneData = get(configuration, "visualizationData.sceneData", false) || get(configuration, "visualizationData.designViews[0].models.".concat(this._materialVariantPath), false);
1535
- _t7 = sceneData;
1536
- if (!_t7) {
1537
- _context9.n = 1;
1553
+ _context9.t0 = sceneData;
1554
+ if (!_context9.t0) {
1555
+ _context9.next = 6;
1538
1556
  break;
1539
1557
  }
1540
- _context9.n = 1;
1558
+ _context9.next = 6;
1541
1559
  return this.loadSceneSync(sceneData);
1542
- case 1:
1543
- return _context9.a(2);
1560
+ case 6:
1561
+ case "end":
1562
+ return _context9.stop();
1544
1563
  }
1545
1564
  }, _callee9, this);
1546
1565
  }));
@@ -1552,21 +1571,22 @@ export var Three3DScene = /*#__PURE__*/function (_Three3D) {
1552
1571
  }, {
1553
1572
  key: "updateMaterial",
1554
1573
  value: function () {
1555
- var _updateMaterial = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0() {
1556
- var sceneData, _t8;
1557
- return _regenerator().w(function (_context0) {
1558
- while (1) switch (_context0.n) {
1574
+ var _updateMaterial = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee0() {
1575
+ var sceneData;
1576
+ return _regeneratorRuntime().wrap(function _callee0$(_context0) {
1577
+ while (1) switch (_context0.prev = _context0.next) {
1559
1578
  case 0:
1560
1579
  sceneData = get(this._designAreaList, "[0].designView.models.".concat(this._materialVariantPath)) || get(this._configuration, "visualizationData.designViews[0].models.".concat(this._materialVariantPath)) || false;
1561
- _t8 = sceneData;
1562
- if (!_t8) {
1563
- _context0.n = 1;
1580
+ _context0.t0 = sceneData;
1581
+ if (!_context0.t0) {
1582
+ _context0.next = 5;
1564
1583
  break;
1565
1584
  }
1566
- _context0.n = 1;
1585
+ _context0.next = 5;
1567
1586
  return this.loadSceneSync(sceneData);
1568
- case 1:
1569
- return _context0.a(2);
1587
+ case 5:
1588
+ case "end":
1589
+ return _context0.stop();
1570
1590
  }
1571
1591
  }, _callee0, this);
1572
1592
  }));
@@ -1578,22 +1598,23 @@ export var Three3DScene = /*#__PURE__*/function (_Three3D) {
1578
1598
  }, {
1579
1599
  key: "updateDesignAreaList",
1580
1600
  value: function () {
1581
- var _updateDesignAreaList = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1(designAreaList) {
1582
- var sceneData, _t9;
1583
- return _regenerator().w(function (_context1) {
1584
- while (1) switch (_context1.n) {
1601
+ var _updateDesignAreaList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee1(designAreaList) {
1602
+ var sceneData;
1603
+ return _regeneratorRuntime().wrap(function _callee1$(_context1) {
1604
+ while (1) switch (_context1.prev = _context1.next) {
1585
1605
  case 0:
1586
1606
  this._designAreaList = designAreaList;
1587
1607
  sceneData = get(designAreaList, "[0].designView.models.".concat(this._materialVariantPath));
1588
- _t9 = sceneData;
1589
- if (!_t9) {
1590
- _context1.n = 1;
1608
+ _context1.t0 = sceneData;
1609
+ if (!_context1.t0) {
1610
+ _context1.next = 6;
1591
1611
  break;
1592
1612
  }
1593
- _context1.n = 1;
1613
+ _context1.next = 6;
1594
1614
  return this.loadSceneSync(sceneData);
1595
- case 1:
1596
- return _context1.a(2);
1615
+ case 6:
1616
+ case "end":
1617
+ return _context1.stop();
1597
1618
  }
1598
1619
  }, _callee1, this);
1599
1620
  }));
@@ -1621,4 +1642,5 @@ export var Three3DScene = /*#__PURE__*/function (_Three3D) {
1621
1642
  return function () {};
1622
1643
  }
1623
1644
  }]);
1645
+ return Three3DScene;
1624
1646
  }(Three3D);