@colijnit/configurator 1.0.15 → 12.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/app/builder.d.ts +25 -11
  2. package/app/components/answers/answer/answer.component.d.ts +3 -4
  3. package/app/components/selections/selections.component.d.ts +5 -6
  4. package/app/services/configurator.service.d.ts +6 -15
  5. package/app/utils/object.utils.d.ts +7 -0
  6. package/bundles/colijnit-configurator.umd.js +1203 -608
  7. package/bundles/colijnit-configurator.umd.js.map +1 -1
  8. package/colijnit-configurator.d.ts +2 -3
  9. package/colijnit-configurator.metadata.json +1 -1
  10. package/esm2015/app/builder.js +179 -60
  11. package/esm2015/app/components/answers/answer/answer.component.js +51 -45
  12. package/esm2015/app/components/answers/answers.component.js +30 -32
  13. package/esm2015/app/components/answers/answers.module.js +20 -22
  14. package/esm2015/app/components/selections/selections.component.js +72 -57
  15. package/esm2015/app/components/selections/selections.module.js +17 -19
  16. package/esm2015/app/components/shared/loader/loader.component.js +10 -12
  17. package/esm2015/app/components/shared/shared.module.js +16 -18
  18. package/esm2015/app/directives/visibility-observer-master.directive.js +9 -10
  19. package/esm2015/app/directives/visibility-observer.directive.js +13 -15
  20. package/esm2015/app/services/configurator.service.js +28 -40
  21. package/esm2015/app/services/image-cache.service.js +12 -13
  22. package/esm2015/app/services/locator.service.js +6 -8
  23. package/esm2015/app/utils/object.utils.js +49 -0
  24. package/esm2015/colijnit-configurator.js +3 -4
  25. package/esm2015/helper/variation-helper.js +174 -41
  26. package/esm2015/model/material.js +1 -1
  27. package/esm2015/model/variation-settings.js +4 -1
  28. package/esm2015/model/variation.js +1 -1
  29. package/esm2015/public_api.js +1 -1
  30. package/esm2015/utils/asset.utils.js +64 -12
  31. package/esm2015/utils/file.utils.js +4 -1
  32. package/esm2015/utils/image.utils.js +1 -1
  33. package/esm2015/utils/object.utils.js +1 -1
  34. package/esm2015/utils/scene-utils.js +1 -1
  35. package/esm2015/utils/threed.utils.js +3 -3
  36. package/esm2015/utils/variation-utils.js +99 -29
  37. package/fesm2015/colijnit-configurator.js +861 -480
  38. package/fesm2015/colijnit-configurator.js.map +1 -1
  39. package/helper/variation-helper.d.ts +1 -1
  40. package/model/material.d.ts +16 -0
  41. package/model/variation-settings.d.ts +21 -0
  42. package/package.json +17 -20
  43. package/utils/asset.utils.d.ts +3 -0
  44. package/utils/threed.utils.d.ts +1 -1
  45. package/utils/variation-utils.d.ts +1 -0
  46. package/bundles/colijnit-configurator.umd.min.js +0 -17
  47. package/bundles/colijnit-configurator.umd.min.js.map +0 -1
  48. package/esm5/app/builder.js +0 -514
  49. package/esm5/app/components/answers/answer/answer.component.js +0 -54
  50. package/esm5/app/components/answers/answers.component.js +0 -27
  51. package/esm5/app/components/answers/answers.module.js +0 -32
  52. package/esm5/app/components/selections/selections.component.js +0 -104
  53. package/esm5/app/components/selections/selections.module.js +0 -26
  54. package/esm5/app/components/shared/loader/loader.component.js +0 -16
  55. package/esm5/app/components/shared/shared.module.js +0 -24
  56. package/esm5/app/directives/visibility-observer-master.directive.js +0 -64
  57. package/esm5/app/directives/visibility-observer.directive.js +0 -59
  58. package/esm5/app/services/configurator.service.js +0 -135
  59. package/esm5/app/services/image-cache.service.js +0 -67
  60. package/esm5/app/services/locator.service.js +0 -13
  61. package/esm5/colijnit-configurator.js +0 -11
  62. package/esm5/helper/variation-helper.js +0 -268
  63. package/esm5/model/material.js +0 -13
  64. package/esm5/model/variation-settings.js +0 -8
  65. package/esm5/model/variation.js +0 -7
  66. package/esm5/public_api.js +0 -7
  67. package/esm5/utils/asset.utils.js +0 -106
  68. package/esm5/utils/file.utils.js +0 -151
  69. package/esm5/utils/image.utils.js +0 -56
  70. package/esm5/utils/object.utils.js +0 -56
  71. package/esm5/utils/scene-utils.js +0 -98
  72. package/esm5/utils/threed.utils.js +0 -279
  73. package/esm5/utils/variation-utils.js +0 -327
  74. package/fesm5/colijnit-configurator.js +0 -2412
  75. package/fesm5/colijnit-configurator.js.map +0 -1
@@ -1,12 +1,35 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('three'), require('@colijnit/configuratorapi/build/model/options'), require('@colijnit/configuratorapi/build/model/deco-node'), require('@colijnit/configuratorapi/build/service/business-object-factory'), require('@colijnit/configuratorapi/build/model/selection'), require('@colijnit/configuratorapi/build/enum/deco-node-type.enum'), require('axios'), require('@colijnit/configuratorapi/build/enum/deco-node-kind.enum'), require('jszip'), require('@colijnit/configuratorapi/build/model/article'), require('@angular/core'), require('@colijnit/configuratorapi/build/configurator'), require('rxjs'), require('@angular/common'), require('@angular/animations')) :
3
- typeof define === 'function' && define.amd ? define('@colijnit/configurator', ['exports', 'three', '@colijnit/configuratorapi/build/model/options', '@colijnit/configuratorapi/build/model/deco-node', '@colijnit/configuratorapi/build/service/business-object-factory', '@colijnit/configuratorapi/build/model/selection', '@colijnit/configuratorapi/build/enum/deco-node-type.enum', 'axios', '@colijnit/configuratorapi/build/enum/deco-node-kind.enum', 'jszip', '@colijnit/configuratorapi/build/model/article', '@angular/core', '@colijnit/configuratorapi/build/configurator', 'rxjs', '@angular/common', '@angular/animations'], factory) :
4
- (global = global || self, factory((global.colijnit = global.colijnit || {}, global.colijnit.configurator = {}), global.three, global.options, global.decoNode, global.businessObjectFactory, global.selection, global.decoNodeType_enum, global.axios, global.decoNodeKind_enum, global.JSZip, global.article, global.ng.core, global.configurator, global.rxjs, global.ng.common, global.ng.animations));
5
- }(this, (function (exports, three, options, decoNode, businessObjectFactory, selection, decoNodeType_enum, axios, decoNodeKind_enum, JSZip, article, core, configurator, rxjs, common, animations) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('three'), require('@colijnit/configuratorapi/build/model/deco-node'), require('@colijnit/configuratorapi/build/service/business-object-factory'), require('@colijnit/configuratorapi/build/model/selection'), require('@colijnit/configuratorapi/build/enum/deco-node-type.enum'), require('axios'), require('@colijnit/configuratorapi/build/enum/deco-node-kind.enum'), require('rxjs'), require('jszip'), require('@colijnit/configuratorapi/build/model/article'), require('@colijnit/configuratorapi/build/configurator'), require('@colijnit/configuratorapi/build/utils/function/not-nill.function'), require('@colijnit/configuratorapi/build/enum/node-type.enum'), require('@colijnit/configuratorapi/build/utils/function/is-nill.function'), require('@angular/core'), require('@angular/common'), require('@angular/animations')) :
3
+ typeof define === 'function' && define.amd ? define('@colijnit/configurator', ['exports', 'three', '@colijnit/configuratorapi/build/model/deco-node', '@colijnit/configuratorapi/build/service/business-object-factory', '@colijnit/configuratorapi/build/model/selection', '@colijnit/configuratorapi/build/enum/deco-node-type.enum', 'axios', '@colijnit/configuratorapi/build/enum/deco-node-kind.enum', 'rxjs', 'jszip', '@colijnit/configuratorapi/build/model/article', '@colijnit/configuratorapi/build/configurator', '@colijnit/configuratorapi/build/utils/function/not-nill.function', '@colijnit/configuratorapi/build/enum/node-type.enum', '@colijnit/configuratorapi/build/utils/function/is-nill.function', '@angular/core', '@angular/common', '@angular/animations'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.colijnit = global.colijnit || {}, global.colijnit.configurator = {}), global.THREE, global.decoNode, global.businessObjectFactory, global.selection, global.decoNodeType_enum, global.axios, global.decoNodeKind_enum, global.rxjs, global.JSZip, global.article, global.configurator, global.notNill_function, global.nodeType_enum, global.isNill_function, global.ng.core, global.ng.common, global.ng.animations));
5
+ })(this, (function (exports, THREE, decoNode, businessObjectFactory, selection, decoNodeType_enum, axios, decoNodeKind_enum, rxjs, JSZip, article, configurator, notNill_function, nodeType_enum, isNill_function, i0, common, animations) { 'use strict';
6
6
 
7
- axios = axios && Object.prototype.hasOwnProperty.call(axios, 'default') ? axios['default'] : axios;
7
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
9
- /*! *****************************************************************************
9
+ function _interopNamespace(e) {
10
+ if (e && e.__esModule) return e;
11
+ var n = Object.create(null);
12
+ if (e) {
13
+ Object.keys(e).forEach(function (k) {
14
+ if (k !== 'default') {
15
+ var d = Object.getOwnPropertyDescriptor(e, k);
16
+ Object.defineProperty(n, k, d.get ? d : {
17
+ enumerable: true,
18
+ get: function () { return e[k]; }
19
+ });
20
+ }
21
+ });
22
+ }
23
+ n["default"] = e;
24
+ return Object.freeze(n);
25
+ }
26
+
27
+ var THREE__namespace = /*#__PURE__*/_interopNamespace(THREE);
28
+ var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
29
+ var JSZip__default = /*#__PURE__*/_interopDefaultLegacy(JSZip);
30
+ var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
31
+
32
+ /******************************************************************************
10
33
  Copyright (c) Microsoft Corporation.
11
34
 
12
35
  Permission to use, copy, modify, and/or distribute this software for any
@@ -21,35 +44,38 @@
21
44
  PERFORMANCE OF THIS SOFTWARE.
22
45
  ***************************************************************************** */
23
46
  /* global Reflect, Promise */
24
-
25
- var extendStatics = function(d, b) {
47
+ var extendStatics = function (d, b) {
26
48
  extendStatics = Object.setPrototypeOf ||
27
49
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
28
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
50
+ function (d, b) { for (var p in b)
51
+ if (Object.prototype.hasOwnProperty.call(b, p))
52
+ d[p] = b[p]; };
29
53
  return extendStatics(d, b);
30
54
  };
31
-
32
55
  function __extends(d, b) {
56
+ if (typeof b !== "function" && b !== null)
57
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
33
58
  extendStatics(d, b);
34
59
  function __() { this.constructor = d; }
35
60
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
36
61
  }
37
-
38
- var __assign = function() {
62
+ var __assign = function () {
39
63
  __assign = Object.assign || function __assign(t) {
40
64
  for (var s, i = 1, n = arguments.length; i < n; i++) {
41
65
  s = arguments[i];
42
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
66
+ for (var p in s)
67
+ if (Object.prototype.hasOwnProperty.call(s, p))
68
+ t[p] = s[p];
43
69
  }
44
70
  return t;
45
71
  };
46
72
  return __assign.apply(this, arguments);
47
73
  };
48
-
49
74
  function __rest(s, e) {
50
75
  var t = {};
51
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
52
- t[p] = s[p];
76
+ for (var p in s)
77
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
78
+ t[p] = s[p];
53
79
  if (s != null && typeof Object.getOwnPropertySymbols === "function")
54
80
  for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
55
81
  if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
@@ -57,175 +83,280 @@
57
83
  }
58
84
  return t;
59
85
  }
60
-
61
86
  function __decorate(decorators, target, key, desc) {
62
87
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
63
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
64
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
88
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
89
+ r = Reflect.decorate(decorators, target, key, desc);
90
+ else
91
+ for (var i = decorators.length - 1; i >= 0; i--)
92
+ if (d = decorators[i])
93
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
65
94
  return c > 3 && r && Object.defineProperty(target, key, r), r;
66
95
  }
67
-
68
96
  function __param(paramIndex, decorator) {
69
- return function (target, key) { decorator(target, key, paramIndex); }
97
+ return function (target, key) { decorator(target, key, paramIndex); };
70
98
  }
71
-
72
99
  function __metadata(metadataKey, metadataValue) {
73
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
100
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
101
+ return Reflect.metadata(metadataKey, metadataValue);
74
102
  }
75
-
76
103
  function __awaiter(thisArg, _arguments, P, generator) {
77
104
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
78
105
  return new (P || (P = Promise))(function (resolve, reject) {
79
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
80
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
106
+ function fulfilled(value) { try {
107
+ step(generator.next(value));
108
+ }
109
+ catch (e) {
110
+ reject(e);
111
+ } }
112
+ function rejected(value) { try {
113
+ step(generator["throw"](value));
114
+ }
115
+ catch (e) {
116
+ reject(e);
117
+ } }
81
118
  function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
82
119
  step((generator = generator.apply(thisArg, _arguments || [])).next());
83
120
  });
84
121
  }
85
-
86
122
  function __generator(thisArg, body) {
87
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
88
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
123
+ var _ = { label: 0, sent: function () { if (t[0] & 1)
124
+ throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
125
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
89
126
  function verb(n) { return function (v) { return step([n, v]); }; }
90
127
  function step(op) {
91
- if (f) throw new TypeError("Generator is already executing.");
92
- while (_) try {
93
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
94
- if (y = 0, t) op = [op[0] & 2, t.value];
95
- switch (op[0]) {
96
- case 0: case 1: t = op; break;
97
- case 4: _.label++; return { value: op[1], done: false };
98
- case 5: _.label++; y = op[1]; op = [0]; continue;
99
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
100
- default:
101
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
102
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
103
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
104
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
105
- if (t[2]) _.ops.pop();
106
- _.trys.pop(); continue;
107
- }
108
- op = body.call(thisArg, _);
109
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
110
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
128
+ if (f)
129
+ throw new TypeError("Generator is already executing.");
130
+ while (_)
131
+ try {
132
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
133
+ return t;
134
+ if (y = 0, t)
135
+ op = [op[0] & 2, t.value];
136
+ switch (op[0]) {
137
+ case 0:
138
+ case 1:
139
+ t = op;
140
+ break;
141
+ case 4:
142
+ _.label++;
143
+ return { value: op[1], done: false };
144
+ case 5:
145
+ _.label++;
146
+ y = op[1];
147
+ op = [0];
148
+ continue;
149
+ case 7:
150
+ op = _.ops.pop();
151
+ _.trys.pop();
152
+ continue;
153
+ default:
154
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
155
+ _ = 0;
156
+ continue;
157
+ }
158
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
159
+ _.label = op[1];
160
+ break;
161
+ }
162
+ if (op[0] === 6 && _.label < t[1]) {
163
+ _.label = t[1];
164
+ t = op;
165
+ break;
166
+ }
167
+ if (t && _.label < t[2]) {
168
+ _.label = t[2];
169
+ _.ops.push(op);
170
+ break;
171
+ }
172
+ if (t[2])
173
+ _.ops.pop();
174
+ _.trys.pop();
175
+ continue;
176
+ }
177
+ op = body.call(thisArg, _);
178
+ }
179
+ catch (e) {
180
+ op = [6, e];
181
+ y = 0;
182
+ }
183
+ finally {
184
+ f = t = 0;
185
+ }
186
+ if (op[0] & 5)
187
+ throw op[1];
188
+ return { value: op[0] ? op[1] : void 0, done: true };
111
189
  }
112
190
  }
113
-
114
- function __createBinding(o, m, k, k2) {
115
- if (k2 === undefined) k2 = k;
191
+ var __createBinding = Object.create ? (function (o, m, k, k2) {
192
+ if (k2 === undefined)
193
+ k2 = k;
194
+ var desc = Object.getOwnPropertyDescriptor(m, k);
195
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
196
+ desc = { enumerable: true, get: function () { return m[k]; } };
197
+ }
198
+ Object.defineProperty(o, k2, desc);
199
+ }) : (function (o, m, k, k2) {
200
+ if (k2 === undefined)
201
+ k2 = k;
116
202
  o[k2] = m[k];
203
+ });
204
+ function __exportStar(m, o) {
205
+ for (var p in m)
206
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
207
+ __createBinding(o, m, p);
117
208
  }
118
-
119
- function __exportStar(m, exports) {
120
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p];
121
- }
122
-
123
209
  function __values(o) {
124
210
  var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
125
- if (m) return m.call(o);
126
- if (o && typeof o.length === "number") return {
127
- next: function () {
128
- if (o && i >= o.length) o = void 0;
129
- return { value: o && o[i++], done: !o };
130
- }
131
- };
211
+ if (m)
212
+ return m.call(o);
213
+ if (o && typeof o.length === "number")
214
+ return {
215
+ next: function () {
216
+ if (o && i >= o.length)
217
+ o = void 0;
218
+ return { value: o && o[i++], done: !o };
219
+ }
220
+ };
132
221
  throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
133
222
  }
134
-
135
223
  function __read(o, n) {
136
224
  var m = typeof Symbol === "function" && o[Symbol.iterator];
137
- if (!m) return o;
225
+ if (!m)
226
+ return o;
138
227
  var i = m.call(o), r, ar = [], e;
139
228
  try {
140
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
229
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
230
+ ar.push(r.value);
231
+ }
232
+ catch (error) {
233
+ e = { error: error };
141
234
  }
142
- catch (error) { e = { error: error }; }
143
235
  finally {
144
236
  try {
145
- if (r && !r.done && (m = i["return"])) m.call(i);
237
+ if (r && !r.done && (m = i["return"]))
238
+ m.call(i);
239
+ }
240
+ finally {
241
+ if (e)
242
+ throw e.error;
146
243
  }
147
- finally { if (e) throw e.error; }
148
244
  }
149
245
  return ar;
150
246
  }
151
-
247
+ /** @deprecated */
152
248
  function __spread() {
153
249
  for (var ar = [], i = 0; i < arguments.length; i++)
154
250
  ar = ar.concat(__read(arguments[i]));
155
251
  return ar;
156
252
  }
157
-
253
+ /** @deprecated */
158
254
  function __spreadArrays() {
159
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
255
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++)
256
+ s += arguments[i].length;
160
257
  for (var r = Array(s), k = 0, i = 0; i < il; i++)
161
258
  for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
162
259
  r[k] = a[j];
163
260
  return r;
164
- };
165
-
261
+ }
262
+ function __spreadArray(to, from, pack) {
263
+ if (pack || arguments.length === 2)
264
+ for (var i = 0, l = from.length, ar; i < l; i++) {
265
+ if (ar || !(i in from)) {
266
+ if (!ar)
267
+ ar = Array.prototype.slice.call(from, 0, i);
268
+ ar[i] = from[i];
269
+ }
270
+ }
271
+ return to.concat(ar || Array.prototype.slice.call(from));
272
+ }
166
273
  function __await(v) {
167
274
  return this instanceof __await ? (this.v = v, this) : new __await(v);
168
275
  }
169
-
170
276
  function __asyncGenerator(thisArg, _arguments, generator) {
171
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
277
+ if (!Symbol.asyncIterator)
278
+ throw new TypeError("Symbol.asyncIterator is not defined.");
172
279
  var g = generator.apply(thisArg, _arguments || []), i, q = [];
173
280
  return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
174
- function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
175
- function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
281
+ function verb(n) { if (g[n])
282
+ i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
283
+ function resume(n, v) { try {
284
+ step(g[n](v));
285
+ }
286
+ catch (e) {
287
+ settle(q[0][3], e);
288
+ } }
176
289
  function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
177
290
  function fulfill(value) { resume("next", value); }
178
291
  function reject(value) { resume("throw", value); }
179
- function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
292
+ function settle(f, v) { if (f(v), q.shift(), q.length)
293
+ resume(q[0][0], q[0][1]); }
180
294
  }
181
-
182
295
  function __asyncDelegator(o) {
183
296
  var i, p;
184
297
  return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
185
298
  function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
186
299
  }
187
-
188
300
  function __asyncValues(o) {
189
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
301
+ if (!Symbol.asyncIterator)
302
+ throw new TypeError("Symbol.asyncIterator is not defined.");
190
303
  var m = o[Symbol.asyncIterator], i;
191
304
  return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
192
305
  function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
193
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
306
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
194
307
  }
195
-
196
308
  function __makeTemplateObject(cooked, raw) {
197
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
309
+ if (Object.defineProperty) {
310
+ Object.defineProperty(cooked, "raw", { value: raw });
311
+ }
312
+ else {
313
+ cooked.raw = raw;
314
+ }
198
315
  return cooked;
316
+ }
317
+ ;
318
+ var __setModuleDefault = Object.create ? (function (o, v) {
319
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
320
+ }) : function (o, v) {
321
+ o["default"] = v;
199
322
  };
200
-
201
323
  function __importStar(mod) {
202
- if (mod && mod.__esModule) return mod;
324
+ if (mod && mod.__esModule)
325
+ return mod;
203
326
  var result = {};
204
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
205
- result.default = mod;
327
+ if (mod != null)
328
+ for (var k in mod)
329
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
330
+ __createBinding(result, mod, k);
331
+ __setModuleDefault(result, mod);
206
332
  return result;
207
333
  }
208
-
209
334
  function __importDefault(mod) {
210
335
  return (mod && mod.__esModule) ? mod : { default: mod };
211
336
  }
212
-
213
- function __classPrivateFieldGet(receiver, privateMap) {
214
- if (!privateMap.has(receiver)) {
215
- throw new TypeError("attempted to get private field on non-instance");
216
- }
217
- return privateMap.get(receiver);
337
+ function __classPrivateFieldGet(receiver, state, kind, f) {
338
+ if (kind === "a" && !f)
339
+ throw new TypeError("Private accessor was defined without a getter");
340
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
341
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
342
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
218
343
  }
219
-
220
- function __classPrivateFieldSet(receiver, privateMap, value) {
221
- if (!privateMap.has(receiver)) {
222
- throw new TypeError("attempted to set private field on non-instance");
223
- }
224
- privateMap.set(receiver, value);
225
- return value;
344
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
345
+ if (kind === "m")
346
+ throw new TypeError("Private method is not writable");
347
+ if (kind === "a" && !f)
348
+ throw new TypeError("Private accessor was defined without a setter");
349
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
350
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
351
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
352
+ }
353
+ function __classPrivateFieldIn(state, receiver) {
354
+ if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function"))
355
+ throw new TypeError("Cannot use 'in' operator on non-object");
356
+ return typeof state === "function" ? receiver === state : state.has(receiver);
226
357
  }
227
358
 
228
- var ObjectUtils = /** @class */ (function () {
359
+ var ObjectUtils$1 = /** @class */ (function () {
229
360
  function ObjectUtils() {
230
361
  }
231
362
  ObjectUtils.DisposeMaterial = function (material) {
@@ -263,7 +394,7 @@
263
394
  ObjectUtils.DisposeNode = function (node) {
264
395
  var _this = this;
265
396
  node.traverse(function (obj) {
266
- if (obj instanceof three.Mesh) {
397
+ if (obj instanceof THREE.Mesh) {
267
398
  if (obj.geometry) {
268
399
  obj.geometry.dispose();
269
400
  }
@@ -275,9 +406,9 @@
275
406
  }
276
407
  });
277
408
  };
278
- ObjectUtils.materialProps = ['map', 'lightMap', 'bumpMap', 'normalMap', 'specularMap', 'envMap', 'aoMap', 'roughnessMap', 'metalnessMap'];
279
409
  return ObjectUtils;
280
- }());
410
+ }());
411
+ ObjectUtils$1.materialProps = ['map', 'lightMap', 'bumpMap', 'normalMap', 'specularMap', 'envMap', 'aoMap', 'roughnessMap', 'metalnessMap'];
281
412
 
282
413
  // Static utility functions holder related to files.
283
414
  // @dynamic
@@ -303,11 +434,15 @@
303
434
  var result;
304
435
  return __generator(this, function (_a) {
305
436
  switch (_a.label) {
306
- case 0: return [4 /*yield*/, axios({
307
- method: 'get',
308
- url: assetPath + "getFiles.php?assetUrl=" + url,
309
- responseType: "json"
310
- })];
437
+ case 0:
438
+ if (!assetPath.endsWith('/')) {
439
+ assetPath = assetPath + '/';
440
+ }
441
+ return [4 /*yield*/, axios__default["default"]({
442
+ method: 'get',
443
+ url: assetPath + "getFiles.php?assetUrl=" + url,
444
+ responseType: "json"
445
+ })];
311
446
  case 1:
312
447
  result = _a.sent();
313
448
  return [2 /*return*/, !!result.data];
@@ -423,9 +558,9 @@
423
558
  }
424
559
  return url.replace('.unity3d', '');
425
560
  };
426
- FileUtils._cachedTextureUploads = new Map();
427
561
  return FileUtils;
428
- }());
562
+ }());
563
+ FileUtils._cachedTextureUploads = new Map();
429
564
 
430
565
  var ThreedUtils = /** @class */ (function () {
431
566
  function ThreedUtils() {
@@ -433,10 +568,10 @@
433
568
  }
434
569
  ThreedUtils.prototype.clearCache = function () {
435
570
  var objs = Array.from(this._objectCache.values());
436
- objs.forEach(function (o) { return ObjectUtils.DisposeObject(o); });
571
+ objs.forEach(function (o) { return ObjectUtils$1.DisposeObject(o); });
437
572
  this._objectCache.clear();
438
573
  };
439
- ThreedUtils.prototype.download3DSource = function (fileName) {
574
+ ThreedUtils.prototype.download3DSource = function (fileName, assetPath) {
440
575
  var _this = this;
441
576
  return new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
442
577
  var lookupFileName;
@@ -450,7 +585,7 @@
450
585
  resolve(this._objectCache.get(lookupFileName));
451
586
  return [2 /*return*/];
452
587
  }
453
- return [4 /*yield*/, FileUtils.FileExists(lookupFileName, 'https://cdn1.colijn-it.nl/content43/')];
588
+ return [4 /*yield*/, FileUtils.FileExists(lookupFileName, assetPath)];
454
589
  case 1:
455
590
  if (_a.sent()) {
456
591
  this.loadGlbSource(lookupFileName).then(function (obj) {
@@ -487,7 +622,7 @@
487
622
  return [4 /*yield*/, this._readJsonFile(filePath)];
488
623
  case 1:
489
624
  json = _a.sent();
490
- loader = new three.ObjectLoader();
625
+ loader = new THREE__namespace.ObjectLoader();
491
626
  loader.crossOrigin = 'Anonymous';
492
627
  return [2 /*return*/, new Promise(function (resolve, reject) {
493
628
  try {
@@ -511,7 +646,7 @@
511
646
  if (this._objectCache.has(filePath)) {
512
647
  return [2 /*return*/, Promise.resolve(this._objectCache.get(filePath))];
513
648
  }
514
- loader = new three.ObjectLoader();
649
+ loader = new THREE__namespace.ObjectLoader();
515
650
  loader.setCrossOrigin('Anonymous');
516
651
  loader.setResourcePath('');
517
652
  return [2 /*return*/, new Promise(function (resolve, reject) {
@@ -563,7 +698,7 @@
563
698
  case 1:
564
699
  obj = _a.sent();
565
700
  if (obj) {
566
- obj.children = obj.children.filter(function (c) { return !(c instanceof three.Camera); });
701
+ obj.children = obj.children.filter(function (c) { return !(c instanceof THREE__namespace.Camera); });
567
702
  obj.children.sort(function (a, b) { return a['name'] < b['name'] ? 1 : -1; });
568
703
  obj.children.forEach(function (c) {
569
704
  c.traverse(function (t) {
@@ -571,7 +706,7 @@
571
706
  });
572
707
  c.visible = false;
573
708
  });
574
- if (obj.children.length === 1 && obj.children[0] instanceof three.Group) { // flatten children
709
+ if (obj.children.length === 1 && obj.children[0] instanceof THREE__namespace.Group) { // flatten children
575
710
  children = obj.children[0].children.slice();
576
711
  obj.children.length = 0;
577
712
  obj.children = children;
@@ -587,11 +722,11 @@
587
722
  return __generator(this, function (_a) {
588
723
  // url = this._includeBaseUrl(url);
589
724
  return [2 /*return*/, new Promise(function (resolve, reject) {
590
- var textureLoader = new three.TextureLoader();
725
+ var textureLoader = new THREE__namespace.TextureLoader();
591
726
  // textureLoader.setBaseU(this._settingsService.settings.assetPath);
592
727
  textureLoader.load(url, function (texture) {
593
- texture.wrapT = three.RepeatWrapping;
594
- texture.wrapS = three.RepeatWrapping;
728
+ texture.wrapT = THREE__namespace.RepeatWrapping;
729
+ texture.wrapS = THREE__namespace.RepeatWrapping;
595
730
  texture.repeat.set(1, 1);
596
731
  texture.needsUpdate = true;
597
732
  return resolve(texture);
@@ -603,13 +738,13 @@
603
738
  ThreedUtils.prototype._cleanedUpObjects = function (object, cleanUp) {
604
739
  var _this = this;
605
740
  if (cleanUp === void 0) { cleanUp = true; }
606
- var obj = new three.Object3D();
741
+ var obj = new THREE__namespace.Object3D();
607
742
  object.children.forEach(function (c) {
608
- if (!(c instanceof three.Camera)) {
609
- if (cleanUp && c instanceof three.Group || (c.children.length === 1 && c.children[0] instanceof three.Group)) {
743
+ if (!(c instanceof THREE__namespace.Camera)) {
744
+ if (cleanUp && c instanceof THREE__namespace.Group || (c.children.length === 1 && c.children[0] instanceof THREE__namespace.Group)) {
610
745
  _this._addGroupChildrenToObject(c, obj);
611
746
  }
612
- else if ((cleanUp && !(c instanceof three.Mesh)) || (!(c instanceof three.Mesh) && !c.name && c.children.length > 0)) {
747
+ else if ((cleanUp && !(c instanceof THREE__namespace.Mesh)) || (!(c instanceof THREE__namespace.Mesh) && !c.name && c.children.length > 0)) {
613
748
  c.children.forEach(function (child) {
614
749
  child.translateY(c.position.y);
615
750
  });
@@ -632,10 +767,10 @@
632
767
  }
633
768
  }
634
769
  });
635
- var boundingBox = new three.Box3().setFromObject(obj);
636
- var bbCenterPivot = new three.Vector3();
770
+ var boundingBox = new THREE__namespace.Box3().setFromObject(obj);
771
+ var bbCenterPivot = new THREE__namespace.Vector3();
637
772
  boundingBox.getCenter(bbCenterPivot);
638
- var delta = new three.Vector3().add(bbCenterPivot).negate();
773
+ var delta = new THREE__namespace.Vector3().add(bbCenterPivot).negate();
639
774
  obj.children.forEach(function (cc) {
640
775
  cc.position.add(delta);
641
776
  });
@@ -645,7 +780,7 @@
645
780
  var _this = this;
646
781
  if (cleanUp === void 0) { cleanUp = true; }
647
782
  group.children.forEach(function (gc) {
648
- if (cleanUp && gc instanceof three.Group) {
783
+ if (cleanUp && gc instanceof THREE__namespace.Group) {
649
784
  _this._addGroupChildrenToObject(gc, obj);
650
785
  }
651
786
  else {
@@ -659,7 +794,7 @@
659
794
  ThreedUtils.prototype._iterateChildren = function (children, callback) {
660
795
  for (var i = 0; i < children.length; i++) {
661
796
  var child = children[i];
662
- if (child instanceof three.Mesh) {
797
+ if (child instanceof THREE__namespace.Mesh) {
663
798
  callback(child);
664
799
  }
665
800
  else {
@@ -732,17 +867,17 @@
732
867
  };
733
868
  SceneUtils.Convert3DPointToScreenPoint = function (point, camera, width, height) {
734
869
  if (!point) {
735
- return new three.Vector2();
870
+ return new THREE__namespace.Vector2();
736
871
  }
737
872
  var vector = point.clone().project(camera);
738
873
  vector.x = (vector.x + 1) / 2 * width;
739
874
  vector.y = -(vector.y - 1) / 2 * height;
740
- return new three.Vector2(vector.x, vector.y);
875
+ return new THREE__namespace.Vector2(vector.x, vector.y);
741
876
  };
742
877
  SceneUtils.CanSelectorConnect = function (con1, con2) {
743
- var con1Name = con1 instanceof three.Object3D ? con1.name : con1.connector;
744
- var con2Name = con2 instanceof three.Object3D ? con2.name : con2.connector;
745
- var sameParent = con1 instanceof three.Object3D && con2 instanceof three.Object3D ? con1.parent === con2.parent : false;
878
+ var con1Name = con1 instanceof THREE__namespace.Object3D ? con1.name : con1.connector;
879
+ var con2Name = con2 instanceof THREE__namespace.Object3D ? con2.name : con2.connector;
880
+ var sameParent = con1 instanceof THREE__namespace.Object3D && con2 instanceof THREE__namespace.Object3D ? con1.parent === con2.parent : false;
746
881
  var parts1 = con1Name.toUpperCase().split('_'), parts2 = con2Name.toUpperCase().split('_');
747
882
  if (parts1.length >= 3 && parts2.length >= 3 && !sameParent) {
748
883
  var connectable = parts1[0] === 'C' && parts2[0] === 'C' &&
@@ -757,29 +892,29 @@
757
892
  }
758
893
  con1['connectedTo'] = con2.parent.name;
759
894
  con2['connectedTo'] = con1.parent.name;
760
- var motherRotation = new three.Euler(0, 0, 0);
761
- var motherPosition = new three.Vector3(0, 0, 0);
895
+ var motherRotation = new THREE__namespace.Euler(0, 0, 0);
896
+ var motherPosition = new THREE__namespace.Vector3(0, 0, 0);
762
897
  scene.updateMatrixWorld(true);
763
898
  motherRotation.copy(parent.rotation);
764
899
  parent.getWorldPosition(motherPosition);
765
900
  parent.rotation.set(0, 0, 0);
766
901
  parent.position.set(0, 0, 0);
767
- var con1Quat = new three.Quaternion();
902
+ var con1Quat = new THREE__namespace.Quaternion();
768
903
  con1.getWorldQuaternion(con1Quat);
769
- var con2Quat = new three.Quaternion();
904
+ var con2Quat = new THREE__namespace.Quaternion();
770
905
  con2.getWorldQuaternion(con2Quat);
771
- var con1QuatParent = new three.Quaternion();
906
+ var con1QuatParent = new THREE__namespace.Quaternion();
772
907
  con1.parent.getWorldQuaternion(con1QuatParent);
773
- var con2QuatParent = new three.Quaternion();
908
+ var con2QuatParent = new THREE__namespace.Quaternion();
774
909
  con2.parent.getWorldQuaternion(con2QuatParent);
775
- var rotation = new three.Quaternion().multiplyQuaternions(con1Quat.invert(), con2Quat).multiply(new three.Quaternion().multiplyQuaternions(con1QuatParent, con1QuatParent));
910
+ var rotation = new THREE__namespace.Quaternion().multiplyQuaternions(con1Quat.invert(), con2Quat).multiply(new THREE__namespace.Quaternion().multiplyQuaternions(con1QuatParent, con1QuatParent));
776
911
  con2.parent.quaternion.copy(rotation);
777
912
  // Update because the matrix has been tempered with
778
913
  scene.updateMatrixWorld(true);
779
914
  // Move the connectors towards eachother
780
- var con1Pos = new three.Vector3();
915
+ var con1Pos = new THREE__namespace.Vector3();
781
916
  con1.getWorldPosition(con1Pos);
782
- var con2Pos = new three.Vector3();
917
+ var con2Pos = new THREE__namespace.Vector3();
783
918
  con2.getWorldPosition(con2Pos);
784
919
  var move = con1Pos.sub(con2Pos);
785
920
  con2.parent.position.x += move.x;
@@ -799,7 +934,7 @@
799
934
 
800
935
  var Material = /** @class */ (function () {
801
936
  function Material() {
802
- this.specular = new three.Color(0.3, 0.3, 0.3);
937
+ this.specular = new THREE__namespace.Color(0.3, 0.3, 0.3);
803
938
  this.shininess = 0;
804
939
  this.repeatX = 4;
805
940
  this.repeatY = 4;
@@ -819,15 +954,15 @@
819
954
  }
820
955
  else {
821
956
  if (!base64) {
822
- resolve(new three.Texture());
957
+ resolve(new THREE__namespace.Texture());
823
958
  }
824
959
  else {
825
- var loader = new three.TextureLoader();
960
+ var loader = new THREE__namespace.TextureLoader();
826
961
  loader.load(base64, function (texture) {
827
962
  texture.anisotropy = 16;
828
- texture.wrapS = three.RepeatWrapping;
829
- texture.wrapT = three.RepeatWrapping;
830
- texture.repeat = new three.Vector2(material ? material.repeatX : 1, material ? material.repeatY : 1);
963
+ texture.wrapS = THREE__namespace.RepeatWrapping;
964
+ texture.wrapT = THREE__namespace.RepeatWrapping;
965
+ texture.repeat = new THREE__namespace.Vector2(material ? material.repeatX : 1, material ? material.repeatY : 1);
831
966
  texture.needsUpdate = true;
832
967
  ImageUtils.textures.set(id, texture);
833
968
  resolve(texture);
@@ -858,9 +993,9 @@
858
993
  ImageUtils.getFixedImageFilepathUrl = function (imageFilepathUrl) {
859
994
  return imageFilepathUrl.replace("/content/", "/content43/");
860
995
  };
861
- ImageUtils.textures = new Map();
862
996
  return ImageUtils;
863
- }());
997
+ }());
998
+ ImageUtils.textures = new Map();
864
999
 
865
1000
  var FurnitureMaterial = /** @class */ (function (_super) {
866
1001
  __extends(FurnitureMaterial, _super);
@@ -874,9 +1009,9 @@
874
1009
  }
875
1010
  AssetUtils.CreateMaterialFromAsset = function (asset) {
876
1011
  return __awaiter(this, void 0, void 0, function () {
877
- var material, _a, _b, _c, _d, _e;
878
- return __generator(this, function (_f) {
879
- switch (_f.label) {
1012
+ var material, _a, _b, _c, _d, _e, _f, _g, _h, _j;
1013
+ return __generator(this, function (_k) {
1014
+ switch (_k.label) {
880
1015
  case 0:
881
1016
  material = new Material();
882
1017
  if (!asset) {
@@ -889,43 +1024,79 @@
889
1024
  _a = material;
890
1025
  return [4 /*yield*/, ImageUtils.CreateTextureFromBase64(asset.id + '_texture', asset.texture, material)];
891
1026
  case 1:
892
- _a.texture = _f.sent();
893
- material.texture.encoding = three.sRGBEncoding;
1027
+ _a.texture = _k.sent();
1028
+ material.texture.encoding = THREE.sRGBEncoding;
894
1029
  material.textureFilename = asset.textureFilename;
895
- _f.label = 2;
1030
+ _k.label = 2;
896
1031
  case 2:
897
1032
  if (!asset.normal) return [3 /*break*/, 4];
898
1033
  _b = material;
899
1034
  return [4 /*yield*/, ImageUtils.CreateTextureFromBase64(asset.id + '_normal', asset.normal, material)];
900
1035
  case 3:
901
- _b.normal = _f.sent();
1036
+ _b.normal = _k.sent();
902
1037
  material.normalFilename = asset.normalFilename;
903
- _f.label = 4;
1038
+ _k.label = 4;
904
1039
  case 4:
905
- if (!asset.ao) return [3 /*break*/, 6];
1040
+ if (!asset.orm) return [3 /*break*/, 6];
906
1041
  _c = material;
907
- return [4 /*yield*/, ImageUtils.CreateTextureFromBase64(asset.id + '_ao', asset.ao, material)];
1042
+ return [4 /*yield*/, ImageUtils.CreateTextureFromBase64(asset.id + '_orm', asset.orm, material)];
908
1043
  case 5:
909
- _c.ao = _f.sent();
910
- material.aoFilename = asset.aoFilename;
911
- _f.label = 6;
1044
+ _c.ao = _k.sent();
1045
+ material.roughness = material.ao;
1046
+ material.metalness = material.ao;
1047
+ material.aoFilename = asset.ormFilename;
1048
+ material.roughnessFilename = asset.ormFilename;
1049
+ material.metalnessFilename = asset.ormFilename;
1050
+ return [3 /*break*/, 12];
912
1051
  case 6:
913
- if (!asset.metalness) return [3 /*break*/, 8];
1052
+ if (!asset.ao) return [3 /*break*/, 8];
914
1053
  _d = material;
915
- return [4 /*yield*/, ImageUtils.CreateTextureFromBase64(asset.id + '_metalness', asset.metalness, material)];
1054
+ return [4 /*yield*/, ImageUtils.CreateTextureFromBase64(asset.id + '_ao', asset.ao, material)];
916
1055
  case 7:
917
- _d.metalness = _f.sent();
918
- material.metalnessFilename = asset.metalnessFilename;
919
- _f.label = 8;
1056
+ _d.ao = _k.sent();
1057
+ material.aoFilename = asset.aoFilename;
1058
+ _k.label = 8;
920
1059
  case 8:
921
- if (!asset.roughness) return [3 /*break*/, 10];
1060
+ if (!asset.metalness) return [3 /*break*/, 10];
922
1061
  _e = material;
923
- return [4 /*yield*/, ImageUtils.CreateTextureFromBase64(asset.id + '_roughness', asset.roughness, material)];
1062
+ return [4 /*yield*/, ImageUtils.CreateTextureFromBase64(asset.id + '_metalness', asset.metalness, material)];
924
1063
  case 9:
925
- _e.roughness = _f.sent();
1064
+ _e.metalness = _k.sent();
1065
+ material.metalnessFilename = asset.metalnessFilename;
1066
+ _k.label = 10;
1067
+ case 10:
1068
+ if (!asset.roughness) return [3 /*break*/, 12];
1069
+ _f = material;
1070
+ return [4 /*yield*/, ImageUtils.CreateTextureFromBase64(asset.id + '_roughness', asset.roughness, material)];
1071
+ case 11:
1072
+ _f.roughness = _k.sent();
926
1073
  material.roughnessFilename = asset.roughnessFilename;
927
- _f.label = 10;
928
- case 10: return [2 /*return*/, material];
1074
+ _k.label = 12;
1075
+ case 12:
1076
+ if (!asset.displacement) return [3 /*break*/, 14];
1077
+ _g = material;
1078
+ return [4 /*yield*/, ImageUtils.CreateTextureFromBase64(asset.id + '_displacement', asset.displacement, material)];
1079
+ case 13:
1080
+ _g.displacement = _k.sent();
1081
+ material.displacementFilename = asset.displacementFilename;
1082
+ _k.label = 14;
1083
+ case 14:
1084
+ if (!asset.envMap) return [3 /*break*/, 16];
1085
+ _h = material;
1086
+ return [4 /*yield*/, ImageUtils.CreateTextureFromBase64(asset.id + '_env', asset.envMap, material)];
1087
+ case 15:
1088
+ _h.envMap = _k.sent();
1089
+ material.envMapFilename = asset.envMapFilename;
1090
+ _k.label = 16;
1091
+ case 16:
1092
+ if (!asset.emissive) return [3 /*break*/, 18];
1093
+ _j = material;
1094
+ return [4 /*yield*/, ImageUtils.CreateTextureFromBase64(asset.id + '_emissive', asset.emissive, material)];
1095
+ case 17:
1096
+ _j.emissive = _k.sent();
1097
+ material.emissiveFileName = asset.emissiveFilename;
1098
+ _k.label = 18;
1099
+ case 18: return [2 /*return*/, material];
929
1100
  }
930
1101
  });
931
1102
  });
@@ -938,16 +1109,16 @@
938
1109
  }
939
1110
  var level = parseFloat(settings['level']);
940
1111
  if (!isNaN(level)) {
941
- material.specular = new three.Color(level, level, level);
1112
+ material.specular = new THREE__namespace.Color(level, level, level);
942
1113
  }
943
1114
  var repeatObjectUsed = settings.hasOwnProperty('repeat');
944
1115
  var repeatx = repeatObjectUsed ? parseFloat(settings['repeat']['repeatx']) : parseFloat(settings['repeatx']);
945
1116
  if (!isNaN(repeatx)) {
946
- material.repeatX = Math.max(1, repeatx);
1117
+ material.repeatX = repeatx;
947
1118
  }
948
1119
  var repeaty = repeatObjectUsed ? parseFloat(settings['repeat']['repeaty']) : parseFloat(settings['repeaty']);
949
1120
  if (!isNaN(repeaty)) {
950
- material.repeatY = Math.max(1, repeaty);
1121
+ material.repeatY = repeaty;
951
1122
  }
952
1123
  var metalness = parseFloat(settings['metalness']);
953
1124
  if (!isNaN(metalness)) {
@@ -957,6 +1128,36 @@
957
1128
  if (!isNaN(roughness)) {
958
1129
  material.roughnessValue = Math.min(1, roughness);
959
1130
  }
1131
+ if (settings.hasOwnProperty('side')) {
1132
+ material.side = settings.side;
1133
+ }
1134
+ if (settings.hasOwnProperty('sheenColor')) {
1135
+ material.sheenColor = settings.sheenColor;
1136
+ }
1137
+ if (settings.hasOwnProperty('opacity')) {
1138
+ material.opacity = settings.opacity;
1139
+ }
1140
+ if (settings.hasOwnProperty('transparent')) {
1141
+ material.transparent = settings.transparent;
1142
+ }
1143
+ if (settings.hasOwnProperty('envMap')) {
1144
+ material.envMap = settings.envMap;
1145
+ }
1146
+ if (settings.hasOwnProperty('envMapIntensity')) {
1147
+ material.envMapIntensity = settings.envMapIntensity;
1148
+ }
1149
+ if (settings.hasOwnProperty('reflectivity')) {
1150
+ material.reflectivity = settings.reflectivity;
1151
+ }
1152
+ if (settings.hasOwnProperty('displacementValue')) {
1153
+ material.displacementValue = settings.displacementValue;
1154
+ }
1155
+ if (settings.hasOwnProperty('transparency')) {
1156
+ material.transparency = settings.transparency;
1157
+ }
1158
+ if (settings.hasOwnProperty('transmission')) {
1159
+ material.transmission = settings.transmission;
1160
+ }
960
1161
  };
961
1162
  return AssetUtils;
962
1163
  }());
@@ -970,6 +1171,8 @@
970
1171
  var VariationSettings = /** @class */ (function () {
971
1172
  function VariationSettings() {
972
1173
  this.settings = {};
1174
+ this.loading = false;
1175
+ this.loaded = new rxjs.Subject();
973
1176
  }
974
1177
  return VariationSettings;
975
1178
  }());
@@ -978,6 +1181,9 @@
978
1181
  var VariationUtils = /** @class */ (function () {
979
1182
  function VariationUtils() {
980
1183
  }
1184
+ VariationUtils.ClearCache = function () {
1185
+ this.MaterialCache.clear();
1186
+ };
981
1187
  VariationUtils.LoadVariation = function (assetPath, fileName) {
982
1188
  return __awaiter(this, void 0, void 0, function () {
983
1189
  var id, file, err_1, mute;
@@ -993,7 +1199,7 @@
993
1199
  id = fileName.substr(0, fileName.lastIndexOf('.ione3d'));
994
1200
  _a.label = 1;
995
1201
  case 1:
996
- _a.trys.push([1, 4, , 5]);
1202
+ _a.trys.push([1, 6, , 7]);
997
1203
  if (!assetPath.endsWith('/')) {
998
1204
  assetPath += '/';
999
1205
  }
@@ -1001,16 +1207,22 @@
1001
1207
  console.error('downloadVariation not defined in window global');
1002
1208
  return [2 /*return*/, null];
1003
1209
  }
1004
- return [4 /*yield*/, window.downloadVariation(assetPath.replace('https://cdn1.colijn-it.nl/', '') + "variation/" + fileName)];
1005
- case 2:
1210
+ file = void 0;
1211
+ if (!this.MaterialCache.has(id)) return [3 /*break*/, 2];
1212
+ file = this.MaterialCache.get(id);
1213
+ return [3 /*break*/, 4];
1214
+ case 2: return [4 /*yield*/, window.downloadVariation(assetPath.replace('https://cdn1.colijn-it.nl/', '') + "variation/" + fileName)];
1215
+ case 3:
1006
1216
  file = _a.sent();
1007
- return [4 /*yield*/, VariationUtils.GetVariationSettingsFromFile(id, file)];
1008
- case 3: return [2 /*return*/, _a.sent()];
1009
- case 4:
1217
+ this.MaterialCache.set(id, file);
1218
+ _a.label = 4;
1219
+ case 4: return [4 /*yield*/, VariationUtils.GetVariationSettingsFromFile(id, file)];
1220
+ case 5: return [2 /*return*/, _a.sent()];
1221
+ case 6:
1010
1222
  err_1 = _a.sent();
1011
1223
  mute = err_1;
1012
1224
  return [2 /*return*/, null];
1013
- case 5: return [2 /*return*/];
1225
+ case 7: return [2 /*return*/];
1014
1226
  }
1015
1227
  });
1016
1228
  });
@@ -1060,6 +1272,7 @@
1060
1272
  zipContent = _a.sent();
1061
1273
  variationSettings = new VariationSettings();
1062
1274
  variationSettings.id = id;
1275
+ if (!zipContent) return [3 /*break*/, 7];
1063
1276
  if (!zipContent.files['index.json']) return [3 /*break*/, 3];
1064
1277
  return [4 /*yield*/, zipContent.files['index.json'].async('string')];
1065
1278
  case 2:
@@ -1083,58 +1296,106 @@
1083
1296
  };
1084
1297
  VariationUtils.CreateSettingsBasedOnIndex = function (index, variationSettings, zipContent) {
1085
1298
  return __awaiter(this, void 0, void 0, function () {
1086
- var _a, _b, _c, _d, _e, _f;
1087
- return __generator(this, function (_g) {
1088
- switch (_g.label) {
1299
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1300
+ return __generator(this, function (_l) {
1301
+ switch (_l.label) {
1089
1302
  case 0:
1090
1303
  if (!index.normalFile) return [3 /*break*/, 2];
1091
1304
  _a = variationSettings;
1092
1305
  return [4 /*yield*/, VariationUtils.LoadFileContentFromZip(zipContent.files[index.normalFile], index.normalFile)];
1093
1306
  case 1:
1094
- _a.normal = _g.sent();
1307
+ _a.normal = _l.sent();
1095
1308
  variationSettings.normalFilename = index.normalFile;
1096
- _g.label = 2;
1309
+ _l.label = 2;
1097
1310
  case 2:
1098
- if (!index.aoFile) return [3 /*break*/, 4];
1311
+ if (!index.diffuseFile) return [3 /*break*/, 4];
1099
1312
  _b = variationSettings;
1100
- return [4 /*yield*/, VariationUtils.LoadFileContentFromZip(zipContent.files[index.aoFile], index.aoFile)];
1313
+ return [4 /*yield*/, VariationUtils.LoadFileContentFromZip(zipContent.files[index.diffuseFile], index.diffuseFile)];
1101
1314
  case 3:
1102
- _b.ao = _g.sent();
1103
- variationSettings.aoFilename = index.aoFile;
1104
- _g.label = 4;
1315
+ _b.texture = _l.sent();
1316
+ variationSettings.textureFilename = index.diffuseFile;
1317
+ _l.label = 4;
1105
1318
  case 4:
1106
- if (!index.metalnessFile) return [3 /*break*/, 6];
1319
+ if (!index.ormFile) return [3 /*break*/, 6];
1107
1320
  _c = variationSettings;
1108
- return [4 /*yield*/, VariationUtils.LoadFileContentFromZip(zipContent.files[index.metalnessFile], index.metalnessFile)];
1321
+ return [4 /*yield*/, VariationUtils.LoadFileContentFromZip(zipContent.files[index.ormFile], index.ormFile)];
1109
1322
  case 5:
1110
- _c.metalness = _g.sent();
1111
- variationSettings.metalnessFilename = index.metalnessFile;
1112
- _g.label = 6;
1323
+ _c.orm = _l.sent();
1324
+ variationSettings.ormFilename = index.ormFile;
1325
+ return [3 /*break*/, 12];
1113
1326
  case 6:
1114
- if (!index.roughnessFile) return [3 /*break*/, 8];
1327
+ if (!index.aoFile) return [3 /*break*/, 8];
1115
1328
  _d = variationSettings;
1116
- return [4 /*yield*/, VariationUtils.LoadFileContentFromZip(zipContent.files[index.roughnessFile], index.roughnessFile)];
1329
+ return [4 /*yield*/, VariationUtils.LoadFileContentFromZip(zipContent.files[index.aoFile], index.aoFile)];
1117
1330
  case 7:
1118
- _d.roughness = _g.sent();
1119
- variationSettings.roughnessFilename = index.roughnessFile;
1120
- _g.label = 8;
1331
+ _d.ao = _l.sent();
1332
+ variationSettings.aoFilename = index.aoFile;
1333
+ _l.label = 8;
1121
1334
  case 8:
1122
- if (!index.diffuseFile) return [3 /*break*/, 10];
1335
+ if (!index.metalnessFile) return [3 /*break*/, 10];
1123
1336
  _e = variationSettings;
1124
- return [4 /*yield*/, VariationUtils.LoadFileContentFromZip(zipContent.files[index.diffuseFile], index.diffuseFile)];
1337
+ return [4 /*yield*/, VariationUtils.LoadFileContentFromZip(zipContent.files[index.metalnessFile], index.metalnessFile)];
1125
1338
  case 9:
1126
- _e.texture = _g.sent();
1127
- variationSettings.textureFilename = index.diffuseFile;
1128
- _g.label = 10;
1339
+ _e.metalness = _l.sent();
1340
+ variationSettings.metalnessFilename = index.metalnessFile;
1341
+ _l.label = 10;
1129
1342
  case 10:
1343
+ if (!index.roughnessFile) return [3 /*break*/, 12];
1130
1344
  _f = variationSettings;
1131
- return [4 /*yield*/, VariationUtils.LoadFileContentFromZip(zipContent.files['repeat.json'], 'repeat.json', false)];
1345
+ return [4 /*yield*/, VariationUtils.LoadFileContentFromZip(zipContent.files[index.roughnessFile], index.roughnessFile)];
1132
1346
  case 11:
1133
- _f.settings =
1134
- (_g.sent()) || {};
1347
+ _f.roughness = _l.sent();
1348
+ variationSettings.roughnessFilename = index.roughnessFile;
1349
+ _l.label = 12;
1350
+ case 12:
1351
+ if (!index.displacementFile) return [3 /*break*/, 14];
1352
+ _g = variationSettings;
1353
+ return [4 /*yield*/, VariationUtils.LoadFileContentFromZip(zipContent.files[index.displacementFile], index.displacementFile)];
1354
+ case 13:
1355
+ _g.displacement = _l.sent();
1356
+ variationSettings.displacementFilename = index.displacementFile;
1357
+ _l.label = 14;
1358
+ case 14:
1359
+ if (!index.emissiveFile) return [3 /*break*/, 16];
1360
+ _h = variationSettings;
1361
+ return [4 /*yield*/, VariationUtils.LoadFileContentFromZip(zipContent.files[index.emissiveFile], index.emissiveFile)];
1362
+ case 15:
1363
+ _h.emissive = _l.sent();
1364
+ variationSettings.emissiveFilename = index.emissiveFile;
1365
+ _l.label = 16;
1366
+ case 16:
1367
+ if (!index.envMapFile) return [3 /*break*/, 18];
1368
+ _j = variationSettings;
1369
+ return [4 /*yield*/, VariationUtils.LoadFileContentFromZip(zipContent.files[index.envMapFile], index.envMapFile)];
1370
+ case 17:
1371
+ _j.envMap = _l.sent();
1372
+ variationSettings.envMapFilename = index.envMapFile;
1373
+ _l.label = 18;
1374
+ case 18:
1375
+ _k = variationSettings;
1376
+ return [4 /*yield*/, VariationUtils.LoadFileContentFromZip(zipContent.files['repeat.json'], 'repeat.json', false)];
1377
+ case 19:
1378
+ _k.settings =
1379
+ (_l.sent()) || {};
1135
1380
  Object.assign(variationSettings.settings, index.repeat);
1136
1381
  variationSettings.settings.metalness = index.metalness;
1137
1382
  variationSettings.settings.roughness = index.roughness;
1383
+ if (index.sheenColor) {
1384
+ variationSettings.settings.sheenColor = new THREE__namespace.Color(index.sheenColor.r, index.sheenColor.g, index.sheenColor.b);
1385
+ }
1386
+ variationSettings.settings.envMap = index.envMap;
1387
+ variationSettings.settings.envMapIntensity = index.envMapIntensity;
1388
+ variationSettings.settings.transparent = index.transparent;
1389
+ variationSettings.settings.opacity = index.opacity;
1390
+ if (index.emissiveValue) {
1391
+ variationSettings.settings.emissiveValue = new THREE__namespace.Color(index.emissiveValue.r, index.emissiveValue.g, index.emissiveValue.b);
1392
+ }
1393
+ variationSettings.settings.emissiveIntensity = index.emissiveIntensity;
1394
+ variationSettings.settings.reflectivity = index.reflectivity;
1395
+ variationSettings.settings.displacementValue = index.displacementValue;
1396
+ variationSettings.settings.side = index.side;
1397
+ variationSettings.settings.transparency = index.transparency;
1398
+ variationSettings.settings.transmission = index.transmission;
1138
1399
  return [2 /*return*/];
1139
1400
  }
1140
1401
  });
@@ -1150,13 +1411,13 @@
1150
1411
  allLoaded = [];
1151
1412
  _loop_1 = function (fileName) {
1152
1413
  var file_1;
1153
- return __generator(this, function (_a) {
1154
- switch (_a.label) {
1414
+ return __generator(this, function (_d) {
1415
+ switch (_d.label) {
1155
1416
  case 0:
1156
- if (!zipContent.files[fileName]) return [3 /*break*/, 2];
1417
+ if (!zipContent.files.hasOwnProperty(fileName)) return [3 /*break*/, 2];
1157
1418
  return [4 /*yield*/, zipContent.files[fileName]];
1158
1419
  case 1:
1159
- file_1 = _a.sent();
1420
+ file_1 = _d.sent();
1160
1421
  if (file_1.name.toLowerCase().indexOf('normal') > -1 && this_1.FileIsImage(file_1.name)) {
1161
1422
  allLoaded.push(zipContent.files[fileName].async('base64').then(function (normalFile) {
1162
1423
  variationSettings.normal = "data:image/" + _this.GetBase64FileType(file_1.name) + ";base64," + normalFile;
@@ -1187,6 +1448,24 @@
1187
1448
  variationSettings.textureFilename = fileName;
1188
1449
  }));
1189
1450
  }
1451
+ else if (file_1.name.toLowerCase().indexOf('displacement') > -1 && this_1.FileIsImage(file_1.name)) {
1452
+ allLoaded.push(zipContent.files[fileName].async('base64').then(function (displacementFile) {
1453
+ variationSettings.displacement = "data:image/" + _this.GetBase64FileType(file_1.name) + ";base64," + displacementFile;
1454
+ variationSettings.displacementFilename = fileName;
1455
+ }));
1456
+ }
1457
+ else if (file_1.name.toLowerCase().indexOf('emissive') > -1 && this_1.FileIsImage(file_1.name)) {
1458
+ allLoaded.push(zipContent.files[fileName].async('base64').then(function (emissiveFile) {
1459
+ variationSettings.emissive = "data:image/" + _this.GetBase64FileType(file_1.name) + ";base64," + emissiveFile;
1460
+ variationSettings.emissiveFilename = fileName;
1461
+ }));
1462
+ }
1463
+ else if (file_1.name.toLowerCase().indexOf('envMap') > -1 && this_1.FileIsImage(file_1.name)) {
1464
+ allLoaded.push(zipContent.files[fileName].async('base64').then(function (envMapFile) {
1465
+ variationSettings.envMap = "data:image/" + _this.GetBase64FileType(file_1.name) + ";base64," + envMapFile;
1466
+ variationSettings.envMapFilename = fileName;
1467
+ }));
1468
+ }
1190
1469
  else if (file_1.name.indexOf('.jp') > -1) {
1191
1470
  allLoaded.push(zipContent.files[fileName].async('base64').then(function (textureFile) {
1192
1471
  variationSettings.texture = 'data:image/jpeg;base64,' + textureFile;
@@ -1197,13 +1476,13 @@
1197
1476
  allLoaded.push(zipContent.files[fileName].async('string').then(function (settingsFile) {
1198
1477
  var settingsFileObj = JSON.parse(settingsFile);
1199
1478
  for (var key in settingsFileObj) {
1200
- if (settingsFileObj[key]) {
1479
+ if (settingsFileObj.hasOwnProperty(key)) {
1201
1480
  variationSettings.settings[key] = settingsFileObj[key];
1202
1481
  }
1203
1482
  }
1204
1483
  }));
1205
1484
  }
1206
- _a.label = 2;
1485
+ _d.label = 2;
1207
1486
  case 2: return [2 /*return*/];
1208
1487
  }
1209
1488
  });
@@ -1280,41 +1559,58 @@
1280
1559
  // Get the content
1281
1560
  VariationUtils.GetZipContent = function (file) {
1282
1561
  return __awaiter(this, void 0, void 0, function () {
1283
- var jszip, content;
1562
+ var jszip, e_1;
1284
1563
  return __generator(this, function (_a) {
1285
1564
  switch (_a.label) {
1286
1565
  case 0:
1287
- jszip = new JSZip();
1566
+ _a.trys.push([0, 2, , 3]);
1567
+ jszip = new JSZip__default["default"]();
1288
1568
  return [4 /*yield*/, jszip.loadAsync(file)];
1289
- case 1:
1290
- content = _a.sent();
1291
- return [2 /*return*/, content];
1569
+ case 1: return [2 /*return*/, _a.sent()];
1570
+ case 2:
1571
+ e_1 = _a.sent();
1572
+ return [2 /*return*/, null];
1573
+ case 3: return [2 /*return*/];
1292
1574
  }
1293
1575
  });
1294
1576
  });
1295
1577
  };
1296
- VariationUtils.MaterialCache = new Map();
1297
1578
  return VariationUtils;
1298
- }());
1579
+ }());
1580
+ VariationUtils.MaterialCache = new Map();
1299
1581
 
1300
1582
  var VariationHelper = /** @class */ (function () {
1301
1583
  function VariationHelper() {
1302
1584
  this._lastKnownVariations = new Map();
1303
1585
  }
1304
1586
  VariationHelper.prototype.clearCache = function () {
1305
- var valueMap = Array.from(this._lastKnownVariations.values());
1306
- for (var i = 0; i < valueMap.length; i++) {
1307
- var values = Array.from(valueMap[i].values());
1308
- values.forEach(function (variations) {
1309
- variations.forEach(function (variation) {
1310
- variation.material.texture.dispose();
1311
- variation.material.normal.dispose();
1312
- variation.material.metalness.dispose();
1313
- variation.material.roughness.dispose();
1314
- variation.material.ao.dispose();
1315
- });
1587
+ var variationMap = Array.from(this._lastKnownVariations.values());
1588
+ variationMap.forEach(function (variations) {
1589
+ variations.forEach(function (variation) {
1590
+ try {
1591
+ if (variation.material) {
1592
+ if (variation.material.texture) {
1593
+ variation.material.texture.dispose();
1594
+ }
1595
+ if (variation.material.normal) {
1596
+ variation.material.normal.dispose();
1597
+ }
1598
+ if (variation.material.metalness) {
1599
+ variation.material.metalness.dispose();
1600
+ }
1601
+ if (variation.material.roughness) {
1602
+ variation.material.roughness.dispose();
1603
+ }
1604
+ if (variation.material.ao) {
1605
+ variation.material.ao.dispose();
1606
+ }
1607
+ }
1608
+ }
1609
+ catch (e) {
1610
+ }
1316
1611
  });
1317
- }
1612
+ });
1613
+ VariationUtils.ClearCache();
1318
1614
  };
1319
1615
  VariationHelper.prototype.loadPart = function (obj, parts, usePbr) {
1320
1616
  if (usePbr === void 0) { usePbr = false; }
@@ -1358,7 +1654,7 @@
1358
1654
  });
1359
1655
  });
1360
1656
  };
1361
- VariationHelper.prototype.loadVariation = function (instanceId, obj, parts, usePbr) {
1657
+ VariationHelper.prototype.loadVariation = function (obj, parts, usePbr) {
1362
1658
  if (usePbr === void 0) { usePbr = false; }
1363
1659
  return __awaiter(this, void 0, void 0, function () {
1364
1660
  var len, i, variations, lastKnownVariations, j, variationSettings, newVariation, _a, e_2;
@@ -1373,8 +1669,8 @@
1373
1669
  if (!(i < len)) return [3 /*break*/, 8];
1374
1670
  variations = parts[i].variations;
1375
1671
  if (!variations || variations.length === 0) {
1376
- if (this._getLastKnownVariations(instanceId, parts[i].nodeId)) {
1377
- parts[i].variations = this._getLastKnownVariations(instanceId, parts[i].nodeId);
1672
+ if (this._getLastKnownVariations(parts[i].nodeId)) {
1673
+ parts[i].variations = this._getLastKnownVariations(parts[i].nodeId);
1378
1674
  this._applyVariations(obj, parts[i], usePbr);
1379
1675
  return [3 /*break*/, 7];
1380
1676
  }
@@ -1406,7 +1702,7 @@
1406
1702
  j++;
1407
1703
  return [3 /*break*/, 2];
1408
1704
  case 6:
1409
- this._setLastKnownVariations(instanceId, parts[i].nodeId, lastKnownVariations);
1705
+ this._setLastKnownVariations(parts[i].nodeId, lastKnownVariations);
1410
1706
  parts[i].variations = lastKnownVariations;
1411
1707
  this._applyVariations(obj, parts[i], usePbr);
1412
1708
  _b.label = 7;
@@ -1440,7 +1736,7 @@
1440
1736
  var child = children[i];
1441
1737
  if (child !== null && child !== undefined) {
1442
1738
  child.traverse(function (mesh) {
1443
- if (mesh instanceof three.Mesh && partMaterial) {
1739
+ if (mesh instanceof THREE__namespace.Mesh && partMaterial) {
1444
1740
  if (Array.isArray(mesh.material)) { // multimaterial support
1445
1741
  for (var j = 0, jlen = mesh.material.length; j < jlen; j++) {
1446
1742
  if (mesh.material[j].name.toLowerCase().indexOf('fixed_frame') !== -1) {
@@ -1467,7 +1763,7 @@
1467
1763
  var child = children[i];
1468
1764
  if (child !== null && child !== undefined) {
1469
1765
  child.traverse(function (mesh) {
1470
- if (mesh instanceof three.Mesh && part.variations && part.variations.length > 0 && mesh.name.toLowerCase().indexOf('c_')) {
1766
+ if (mesh instanceof THREE__namespace.Mesh && part.variations && part.variations.length > 0 && mesh.name.toLowerCase().indexOf('c_')) {
1471
1767
  for (var j = 0; j < part.variations.length; j++) {
1472
1768
  var variation = part.variations[j];
1473
1769
  if (variation.material) {
@@ -1495,99 +1791,193 @@
1495
1791
  if (usePbr === void 0) { usePbr = false; }
1496
1792
  if (variation.material.texture) {
1497
1793
  variation.material.texture.needsUpdate = true;
1794
+ // variation.material.texture.mapping = THREE.EquirectangularReflectionMapping;
1498
1795
  }
1499
1796
  if (!usePbr) {
1500
- var material = new three.MeshPhongMaterial({
1797
+ var newMaterial = new THREE__namespace.MeshPhongMaterial({
1501
1798
  name: name,
1502
1799
  shininess: variation.material.shininess,
1503
1800
  specular: variation.material.specular,
1504
1801
  map: variation.material.texture,
1505
1802
  normalMap: variation.material.normal
1506
1803
  });
1507
- // material.color.setRGB(0.8, 0.8, 0.8);
1508
- material.needsUpdate = true;
1509
- return material;
1804
+ newMaterial.color.setRGB(0.8, 0.8, 0.8);
1805
+ newMaterial.needsUpdate = true;
1806
+ return newMaterial;
1510
1807
  }
1511
- else {
1808
+ if (variation.material.sheenColor || variation.material.reflectivity) {
1512
1809
  var params = {
1513
- // side: DoubleSide,
1810
+ // side: material.side ? material.side : FrontSide,
1514
1811
  name: name,
1515
1812
  roughness: variation.material.roughnessValue ? variation.material.roughnessValue : 1,
1516
1813
  metalness: variation.material.metalnessValue ? variation.material.metalnessValue : 0,
1814
+ envMapIntensity: variation.material.envMapIntensity ? variation.material.envMapIntensity : 0.01,
1815
+ clearcoatMap: variation.material.clearcoatMap ? variation.material.clearcoatMap : null,
1816
+ clearcoatRoughnessMap: variation.material.clearcoatRoughnessMap ? variation.material.clearcoatRoughnessMap : null,
1817
+ // wireframe: true,
1818
+ // opacity: 0.3,
1819
+ // transparent: true,
1517
1820
  };
1821
+ if (variation.material.displacementValue) {
1822
+ params.displacementScale = variation.material.displacementValue;
1823
+ }
1824
+ if (variation.material.sheenColor) {
1825
+ params.sheen = variation.material.sheenColor;
1826
+ }
1827
+ if (variation.material.opacity) {
1828
+ params.opacity = variation.material.opacity;
1829
+ }
1830
+ if (variation.material.transparent) {
1831
+ params.transparent = variation.material.transparent;
1832
+ }
1833
+ if (variation.material.emissiveValue) {
1834
+ params.emissive = variation.material.emissiveValue;
1835
+ }
1836
+ if (variation.material.emissiveIntensityValue) {
1837
+ params.emissiveIntensity = variation.material.emissiveIntensityValue;
1838
+ }
1518
1839
  if (variation.material.texture) {
1519
1840
  params.map = variation.material.texture;
1841
+ params.map.needsUpdate = true;
1520
1842
  }
1521
1843
  if (variation.material.ao) {
1522
1844
  params.aoMap = variation.material.ao;
1845
+ params.aoMap.needsUpdate = true;
1523
1846
  }
1524
1847
  if (variation.material.roughness) {
1525
1848
  params.roughnessMap = variation.material.roughness;
1849
+ params.roughnessMap.needsUpdate = true;
1850
+ // variation.material.roughness.magFilter = NearestFilter;
1526
1851
  }
1527
1852
  if (variation.material.metalness) {
1528
1853
  params.metalnessMap = variation.material.metalness;
1854
+ params.metalnessMap.needsUpdate = true;
1529
1855
  }
1530
1856
  if (variation.material.normal) {
1531
1857
  params.normalMap = variation.material.normal;
1858
+ params.normalMap.needsUpdate = true;
1532
1859
  }
1533
- var material = new three.MeshStandardMaterial(params);
1534
- material.color.setRGB(1, 1, 1);
1535
- material.needsUpdate = true;
1536
- return material;
1537
- }
1538
- };
1539
- VariationHelper.prototype._setLastKnownVariations = function (instanceId, id, variation) {
1540
- if (this._lastKnownVariations.has(instanceId)) {
1541
- var variations = this._lastKnownVariations.get(instanceId);
1542
- variations.set(id, variation);
1860
+ if (variation.material.displacement) {
1861
+ params.displacementMap = variation.material.displacement;
1862
+ params.displacementMap.needsUpdate = true;
1863
+ }
1864
+ if (variation.material.emissive) {
1865
+ params.emissiveMap = variation.material.emissive;
1866
+ params.emissiveMap.needsUpdate = true;
1867
+ }
1868
+ if (variation.material.envMap) {
1869
+ if (variation.material.envMapIntensity != null || 0) {
1870
+ params.envMap = variation.material.envMap;
1871
+ params.envMap.needsUpdate = true;
1872
+ variation.material.envMap.mapping = THREE__namespace.EquirectangularReflectionMapping;
1873
+ variation.material.envMap.minFilter = THREE__namespace.NearestFilter;
1874
+ variation.material.envMap.magFilter = THREE__namespace.NearestFilter;
1875
+ }
1876
+ }
1877
+ if (variation.material.reflectivity) {
1878
+ params.reflectivity = variation.material.reflectivity;
1879
+ }
1880
+ if (variation.material.side) {
1881
+ params.side = variation.material.side;
1882
+ }
1883
+ var newMaterial = new THREE__namespace.MeshPhysicalMaterial(params);
1884
+ newMaterial.color.setRGB(1, 1, 1);
1885
+ newMaterial.needsUpdate = true;
1886
+ if (variation.material.transmission) {
1887
+ newMaterial.transmission = variation.material.transmission;
1888
+ }
1889
+ return newMaterial;
1543
1890
  }
1544
1891
  else {
1545
- var variations = new Map();
1546
- this._lastKnownVariations.set(instanceId, variations.set(id, variation));
1892
+ var params = {
1893
+ // side: material.side ? material.side : FrontSide,
1894
+ name: name,
1895
+ roughness: variation.material.roughnessValue ? variation.material.roughnessValue : 1,
1896
+ metalness: variation.material.metalnessValue ? variation.material.metalnessValue : 0,
1897
+ envMapIntensity: variation.material.envMapIntensity ? variation.material.envMapIntensity : 0.01
1898
+ // wireframe: true,
1899
+ // opacity: 0.3,
1900
+ // transparent: true,
1901
+ };
1902
+ if (variation.material.displacementValue) {
1903
+ params.displacementScale = variation.material.displacementValue;
1904
+ }
1905
+ if (variation.material.opacity) {
1906
+ params.opacity = variation.material.opacity;
1907
+ }
1908
+ if (variation.material.transparent) {
1909
+ params.transparent = variation.material.transparent;
1910
+ }
1911
+ if (variation.material.emissiveValue) {
1912
+ params.emissive = variation.material.emissiveValue;
1913
+ }
1914
+ if (variation.material.emissiveIntensityValue) {
1915
+ params.emissiveIntensity = variation.material.emissiveIntensityValue;
1916
+ }
1917
+ if (variation.material.texture) {
1918
+ params.map = variation.material.texture;
1919
+ params.map.needsUpdate = true;
1920
+ }
1921
+ if (variation.material.ao) {
1922
+ params.aoMap = variation.material.ao;
1923
+ params.aoMap.needsUpdate = true;
1924
+ }
1925
+ if (variation.material.roughness) {
1926
+ params.roughnessMap = variation.material.roughness;
1927
+ params.roughnessMap.needsUpdate = true;
1928
+ // variation.material.roughness.magFilter = NearestFilter;
1929
+ }
1930
+ if (variation.material.metalness) {
1931
+ params.metalnessMap = variation.material.metalness;
1932
+ params.metalnessMap.needsUpdate = true;
1933
+ }
1934
+ if (variation.material.normal) {
1935
+ params.normalMap = variation.material.normal;
1936
+ params.normalMap.needsUpdate = true;
1937
+ }
1938
+ if (variation.material.displacement) {
1939
+ params.displacementMap = variation.material.displacement;
1940
+ params.displacementMap.needsUpdate = true;
1941
+ }
1942
+ if (variation.material.emissive) {
1943
+ params.emissiveMap = variation.material.emissive;
1944
+ params.emissiveMap.needsUpdate = true;
1945
+ }
1946
+ if (variation.material.envMap) {
1947
+ if (variation.material.envMapIntensity != null || 0) {
1948
+ params.envMap = variation.material.envMap;
1949
+ params.envMap.needsUpdate = true;
1950
+ variation.material.envMap.mapping = THREE__namespace.EquirectangularReflectionMapping;
1951
+ variation.material.envMap.minFilter = THREE__namespace.NearestFilter;
1952
+ variation.material.envMap.magFilter = THREE__namespace.NearestFilter;
1953
+ }
1954
+ }
1955
+ if (variation.material.side) {
1956
+ params.side = variation.material.side;
1957
+ }
1958
+ var newMaterial = new THREE__namespace.MeshStandardMaterial(params);
1959
+ newMaterial.color.setRGB(1, 1, 1);
1960
+ newMaterial.needsUpdate = true;
1961
+ return newMaterial;
1547
1962
  }
1548
1963
  };
1549
- VariationHelper.prototype._getLastKnownVariations = function (instanceId, id) {
1550
- if (this._lastKnownVariations.has(instanceId)) {
1551
- var variations = this._lastKnownVariations.get(instanceId);
1552
- if (variations.has(id)) {
1553
- return variations.get(id);
1554
- }
1964
+ VariationHelper.prototype._setLastKnownVariations = function (id, variation) {
1965
+ this._lastKnownVariations.set(id, variation);
1966
+ };
1967
+ VariationHelper.prototype._getLastKnownVariations = function (id) {
1968
+ if (this._lastKnownVariations.has(id)) {
1969
+ return this._lastKnownVariations.get(id);
1555
1970
  }
1556
1971
  return null;
1557
1972
  };
1558
1973
  return VariationHelper;
1559
1974
  }());
1560
1975
 
1561
- var ServiceLocator = /** @class */ (function () {
1562
- function ServiceLocator() {
1563
- }
1564
- ServiceLocator.injector = undefined;
1565
- ServiceLocator = __decorate([
1566
- core.Injectable()
1567
- ], ServiceLocator);
1568
- return ServiceLocator;
1569
- }());
1570
-
1571
1976
  var ConfiguratorService = /** @class */ (function () {
1572
- function ConfiguratorService(_injector) {
1573
- this._injector = _injector;
1574
- this.selectionsReceived = new rxjs.BehaviorSubject([]);
1575
- this.answersReceived = new rxjs.BehaviorSubject([]);
1576
- this.questionReceived = new rxjs.BehaviorSubject(undefined);
1577
- this._subs = [];
1578
- if (!ServiceLocator.injector) {
1579
- ServiceLocator.injector = _injector;
1580
- }
1977
+ function ConfiguratorService() {
1581
1978
  }
1582
- ConfiguratorService.prototype.ngOnDestroy = function () {
1583
- this._subs.forEach(function (subscription) {
1584
- subscription.unsubscribe();
1585
- });
1586
- };
1587
1979
  ConfiguratorService.prototype.initApi = function (options) {
1588
- var _this = this;
1589
1980
  this._configuratorApi = new configurator.Configurator(options);
1590
- this._subs.push(this._configuratorApi.selectionsReceived.subscribe(function (selections) { return _this.selectionsReceived.next(selections); }), this._configuratorApi.answersReceived.subscribe(function (answers) { return _this.answersReceived.next(answers); }), this._configuratorApi.questionReceived.subscribe(function (question) { return _this.questionReceived.next(question); }));
1591
1981
  };
1592
1982
  ConfiguratorService.prototype.initNodeInstance = function (goodId) {
1593
1983
  return __awaiter(this, void 0, void 0, function () {
@@ -1632,13 +2022,21 @@
1632
2022
  });
1633
2023
  });
1634
2024
  };
1635
- ConfiguratorService.prototype.getSelections = function (showLoader) {
2025
+ ConfiguratorService.prototype.getSelections = function (showLoader, publicationCode) {
1636
2026
  if (showLoader === void 0) { showLoader = false; }
2027
+ if (publicationCode === void 0) { publicationCode = 2; }
1637
2028
  return __awaiter(this, void 0, void 0, function () {
2029
+ var selections;
1638
2030
  return __generator(this, function (_a) {
1639
2031
  switch (_a.label) {
1640
2032
  case 0: return [4 /*yield*/, this._configuratorApi.getSelections(showLoader)];
1641
- case 1: return [2 /*return*/, _a.sent()];
2033
+ case 1:
2034
+ selections = _a.sent();
2035
+ selections.resultObjects.filter(function (s) {
2036
+ (isNill_function.isNill(s.hierarchicalPublicationCode) || ((s.hierarchicalPublicationCode & publicationCode) > 0)) && ((s.nodeType === nodeType_enum.NodeType.Question && (((s.questionPublicationCode & publicationCode) > 0) || isNill_function.isNill(s.questionPublicationCode))) ||
2037
+ (s.nodeType === nodeType_enum.NodeType.Answer && (((s.answerPublicationCode & publicationCode) > 0) || isNill_function.isNill(s.answerPublicationCode))));
2038
+ });
2039
+ return [2 /*return*/, selections];
1642
2040
  }
1643
2041
  });
1644
2042
  });
@@ -1654,11 +2052,23 @@
1654
2052
  });
1655
2053
  });
1656
2054
  };
1657
- ConfiguratorService.prototype.getQuestionAndAnswers = function (showLoader) {
2055
+ ConfiguratorService.prototype.getQuestionAndAnswers = function (showLoader, publicationCode) {
1658
2056
  if (showLoader === void 0) { showLoader = false; }
2057
+ if (publicationCode === void 0) { publicationCode = 2; }
1659
2058
  return __awaiter(this, void 0, void 0, function () {
2059
+ var questionAndAnswers;
1660
2060
  return __generator(this, function (_a) {
1661
- return [2 /*return*/, this._configuratorApi.getQuestionAndAnswers(showLoader)];
2061
+ switch (_a.label) {
2062
+ case 0: return [4 /*yield*/, this._configuratorApi.getQuestionAndAnswers(showLoader)];
2063
+ case 1:
2064
+ questionAndAnswers = _a.sent();
2065
+ questionAndAnswers.answers.filter(function (answer) {
2066
+ (notNill_function.notNill(answer.hierarchicalPublicationCode) && (answer.hierarchicalPublicationCode & publicationCode) === 0) ||
2067
+ (answer.type === nodeType_enum.NodeType.Question && (answer.questionPublicationCode & publicationCode) === 0 && notNill_function.notNill(answer.questionPublicationCode)) ||
2068
+ (answer.type === nodeType_enum.NodeType.Answer && (answer.publicationCode & publicationCode) === 0 && notNill_function.notNill(answer.publicationCode));
2069
+ });
2070
+ return [2 /*return*/, questionAndAnswers];
2071
+ }
1662
2072
  });
1663
2073
  });
1664
2074
  };
@@ -1678,90 +2088,191 @@
1678
2088
  };
1679
2089
  ConfiguratorService.prototype.selectSelection = function (selection, showLoader) {
1680
2090
  if (showLoader === void 0) { showLoader = false; }
1681
- this._configuratorApi.selectSelection(selection, showLoader);
2091
+ return __awaiter(this, void 0, void 0, function () {
2092
+ return __generator(this, function (_a) {
2093
+ switch (_a.label) {
2094
+ case 0: return [4 /*yield*/, this._configuratorApi.selectSelection(selection, showLoader)];
2095
+ case 1: return [2 /*return*/, _a.sent()];
2096
+ }
2097
+ });
2098
+ });
1682
2099
  };
1683
2100
  ConfiguratorService.prototype.selectAnswer = function (answer, showLoader) {
1684
2101
  if (showLoader === void 0) { showLoader = false; }
1685
- this._configuratorApi.selectAnswer(answer, showLoader);
1686
- };
1687
- ConfiguratorService.ctorParameters = function () { return [
1688
- { type: core.Injector }
1689
- ]; };
1690
- ConfiguratorService.ɵprov = core.ɵɵdefineInjectable({ factory: function ConfiguratorService_Factory() { return new ConfiguratorService(core.ɵɵinject(core.INJECTOR)); }, token: ConfiguratorService, providedIn: "root" });
1691
- ConfiguratorService = __decorate([
1692
- core.Injectable({
1693
- providedIn: 'root'
1694
- })
1695
- ], ConfiguratorService);
2102
+ return __awaiter(this, void 0, void 0, function () {
2103
+ return __generator(this, function (_a) {
2104
+ switch (_a.label) {
2105
+ case 0: return [4 /*yield*/, this._configuratorApi.selectAnswer(answer, showLoader)];
2106
+ case 1: return [2 /*return*/, _a.sent()];
2107
+ }
2108
+ });
2109
+ });
2110
+ };
1696
2111
  return ConfiguratorService;
1697
2112
  }());
1698
2113
 
1699
- var Builder = /** @class */ (function () {
1700
- function Builder(scene, options, useInAngular) {
2114
+ var ObjectUtils = /** @class */ (function () {
2115
+ function ObjectUtils() {
2116
+ }
2117
+ ObjectUtils.DisposeNode = function (node) {
2118
+ node.traverse(function (obj) {
2119
+ if (obj instanceof THREE.Mesh) {
2120
+ if (obj.geometry) {
2121
+ obj.geometry.dispose();
2122
+ }
2123
+ ObjectUtils.DisposeMaterial(obj.material);
2124
+ }
2125
+ if (typeof obj.dispose === 'function') {
2126
+ // @ts-ignore
2127
+ obj.dispose();
2128
+ }
2129
+ });
2130
+ };
2131
+ ObjectUtils.DisposeMaterial = function (material) {
2132
+ var _this = this;
2133
+ if (!material) {
2134
+ return;
2135
+ }
2136
+ if (Array.isArray(material)) {
2137
+ material.forEach(function (mtrl) {
2138
+ _this.materialProps
2139
+ .filter(function (mapType) { return mtrl[mapType]; })
2140
+ .forEach(function (mapType) { return mtrl[mapType].dispose(); });
2141
+ mtrl.dispose(); // disposes any programs associated with the material
2142
+ });
2143
+ }
2144
+ else {
2145
+ this.materialProps
2146
+ .filter(function (mapType) { return material[mapType] && material[mapType].dispose; })
2147
+ .forEach(function (mapType) { return material[mapType].dispose(); });
2148
+ if (material.dispose) {
2149
+ material.dispose(); // disposes any programs associated with the material
2150
+ }
2151
+ }
2152
+ };
2153
+ ObjectUtils.DisposeObject = function (object) {
1701
2154
  var _this = this;
2155
+ if (!object) {
2156
+ return;
2157
+ }
2158
+ if (object.children.length) {
2159
+ object.children.forEach(function (child) { return _this.DisposeObject(child); });
2160
+ }
2161
+ this.DisposeNode(object);
2162
+ };
2163
+ return ObjectUtils;
2164
+ }());
2165
+ ObjectUtils.materialProps = ['map', 'lightMap', 'bumpMap', 'normalMap', 'specularMap', 'envMap', 'aoMap', 'roughnessMap', 'metalnessMap'];
2166
+
2167
+ var Builder = /** @class */ (function () {
2168
+ function Builder() {
1702
2169
  this.selectionsReceived = new rxjs.BehaviorSubject([]);
2170
+ this.articleLoaded = new rxjs.BehaviorSubject(undefined);
2171
+ this.decosReceived = new rxjs.BehaviorSubject([]);
1703
2172
  this.answersReceived = new rxjs.BehaviorSubject([]);
1704
- this.questionReceived = new rxjs.BehaviorSubject(undefined);
2173
+ this.modelLoaded = new rxjs.BehaviorSubject(null);
1705
2174
  this._selections = [];
2175
+ this._answers = [];
1706
2176
  this._decos = [];
1707
2177
  this._placedAdjustables = [];
1708
2178
  this._placedAddables = [];
1709
2179
  this._adjustables = [];
1710
2180
  this._addables = [];
2181
+ this._imageCache = new Map();
1711
2182
  this._articleCache = new Map();
1712
- this._subs = [];
2183
+ }
2184
+ Builder.prototype.init = function (scene, options) {
1713
2185
  this._boFactory = new businessObjectFactory.BusinessObjectFactory();
1714
2186
  this._threedUtils = new ThreedUtils();
1715
2187
  this._variationHelper = new VariationHelper();
1716
2188
  if (!scene) {
1717
2189
  throw 'No scene object provided!';
1718
2190
  }
1719
- if (!options) {
1720
- throw 'No connection options provided!';
1721
- }
1722
- if (useInAngular) {
1723
- this._configuratorService = ServiceLocator.injector.get(ConfiguratorService);
1724
- }
1725
- else {
1726
- this._configuratorService = new ConfiguratorService(null);
2191
+ this._configuratorService = new ConfiguratorService();
2192
+ // this._imageCacheService = new ImageCacheService();
2193
+ if (options) {
2194
+ this._configuratorService.initApi(options);
1727
2195
  }
1728
- this._configuratorService.initApi(options);
1729
2196
  this._scene = scene;
1730
- this._subs.push(this._configuratorService.selectionsReceived.subscribe(function (selections) { return _this.selectionsReceived.next(selections); }), this._configuratorService.answersReceived.subscribe(function (answers) { return _this.answersReceived.next(answers); }), this._configuratorService.questionReceived.subscribe(function (question) { return _this.questionReceived.next(question); }));
1731
- }
1732
- Builder.prototype.buildModel = function (instanceId, sku, goodId) {
2197
+ };
2198
+ Builder.prototype.buildModel = function (sku, instanceId, goodId) {
1733
2199
  return __awaiter(this, void 0, void 0, function () {
1734
- var promises, e_1;
2200
+ var promises, build, e_1;
1735
2201
  return __generator(this, function (_a) {
1736
2202
  switch (_a.label) {
1737
2203
  case 0:
1738
- if (!this._scene && !instanceId) {
2204
+ if (!this._scene) {
1739
2205
  return [2 /*return*/];
1740
2206
  }
1741
2207
  _a.label = 1;
1742
2208
  case 1:
1743
- _a.trys.push([1, 7, , 8]);
1744
- return [4 /*yield*/, this._prepareConfiguration(sku, goodId)];
2209
+ _a.trys.push([1, 9, , 10]);
2210
+ return [4 /*yield*/, this._setInstanceId(sku, instanceId, goodId)];
1745
2211
  case 2:
1746
2212
  _a.sent();
1747
- if (!this._source) return [3 /*break*/, 5];
1748
- return [4 /*yield*/, this._configuratorService.setInstanceToConfigure(instanceId)];
2213
+ return [4 /*yield*/, this._prepareConfiguration(this._sku, this._goodId)];
1749
2214
  case 3:
2215
+ _a.sent();
2216
+ if (!this._source) return [3 /*break*/, 7];
2217
+ return [4 /*yield*/, this._configuratorService.setInstanceToConfigure(this._instanceId)];
2218
+ case 4:
1750
2219
  _a.sent();
1751
2220
  promises = [];
1752
- promises.push(this._getSelections(instanceId));
2221
+ promises.push(this.getQuestionAndAnswers());
2222
+ promises.push(this._getSelections(this._instanceId));
1753
2223
  promises.push(this._getDecos());
1754
2224
  return [4 /*yield*/, Promise.all(promises)];
1755
- case 4:
2225
+ case 5:
1756
2226
  _a.sent();
2227
+ if (this._answers.length > 0) {
2228
+ return [2 /*return*/];
2229
+ }
1757
2230
  this._linkSelectionsAndDecos();
1758
- return [2 /*return*/, this._build(instanceId)];
1759
- case 5: throw 'GLB source not found!';
1760
- case 6: return [3 /*break*/, 8];
1761
- case 7:
2231
+ return [4 /*yield*/, this._build()];
2232
+ case 6:
2233
+ build = _a.sent();
2234
+ this._cleanUp();
2235
+ return [2 /*return*/, build];
2236
+ case 7: throw 'GLB source not found!';
2237
+ case 8: return [3 /*break*/, 10];
2238
+ case 9:
1762
2239
  e_1 = _a.sent();
1763
2240
  throw e_1;
1764
- case 8: return [2 /*return*/];
2241
+ case 10: return [2 /*return*/];
2242
+ }
2243
+ });
2244
+ });
2245
+ };
2246
+ Builder.prototype.buildModelFromData = function (selections, decos, assetUrl, cdnUrl, schema) {
2247
+ return __awaiter(this, void 0, void 0, function () {
2248
+ var build, e_2;
2249
+ return __generator(this, function (_a) {
2250
+ switch (_a.label) {
2251
+ case 0:
2252
+ if (!this._scene) {
2253
+ return [2 /*return*/];
2254
+ }
2255
+ _a.label = 1;
2256
+ case 1:
2257
+ _a.trys.push([1, 6, , 7]);
2258
+ return [4 /*yield*/, this._downloadAsset(assetUrl, cdnUrl, schema)];
2259
+ case 2:
2260
+ _a.sent();
2261
+ if (!(selections && selections.length > 1 && decos && decos.length > 0 && this._source)) return [3 /*break*/, 4];
2262
+ this._selections = selections;
2263
+ this._decos = decos;
2264
+ this._linkSelectionsAndDecos();
2265
+ return [4 /*yield*/, this._build()];
2266
+ case 3:
2267
+ build = _a.sent();
2268
+ this._cleanUp();
2269
+ return [2 /*return*/, build];
2270
+ case 4: throw 'Unsufficient data provided!';
2271
+ case 5: return [3 /*break*/, 7];
2272
+ case 6:
2273
+ e_2 = _a.sent();
2274
+ throw e_2;
2275
+ case 7: return [2 /*return*/];
1765
2276
  }
1766
2277
  });
1767
2278
  });
@@ -1774,47 +2285,179 @@
1774
2285
  this._variationHelper.clearCache();
1775
2286
  };
1776
2287
  Builder.prototype.selectSelection = function (selection) {
1777
- this._configuratorService.selectSelection(selection, false);
2288
+ return __awaiter(this, void 0, void 0, function () {
2289
+ return __generator(this, function (_a) {
2290
+ switch (_a.label) {
2291
+ case 0: return [4 /*yield*/, this._configuratorService.selectSelection(selection, false)];
2292
+ case 1:
2293
+ _a.sent();
2294
+ this.getQuestionAndAnswers();
2295
+ return [2 /*return*/];
2296
+ }
2297
+ });
2298
+ });
1778
2299
  };
1779
- Builder.prototype.getQuestionAndAnswers = function () {
2300
+ Builder.prototype.getQuestionAndAnswers = function (publicationCode) {
1780
2301
  return __awaiter(this, void 0, void 0, function () {
2302
+ var questionsAndAnswers;
1781
2303
  return __generator(this, function (_a) {
1782
- return [2 /*return*/, this._configuratorService.getQuestionAndAnswers(false)];
2304
+ switch (_a.label) {
2305
+ case 0: return [4 /*yield*/, this._configuratorService.getQuestionAndAnswers(false, publicationCode)];
2306
+ case 1:
2307
+ questionsAndAnswers = _a.sent();
2308
+ this._answers = questionsAndAnswers.answers;
2309
+ this.answersReceived.next(questionsAndAnswers.answers);
2310
+ return [2 /*return*/];
2311
+ }
1783
2312
  });
1784
2313
  });
1785
2314
  };
1786
2315
  Builder.prototype.selectAnswer = function (answer) {
1787
- this._configuratorService.selectAnswer(answer, false);
2316
+ return __awaiter(this, void 0, void 0, function () {
2317
+ var _a, _b;
2318
+ return __generator(this, function (_c) {
2319
+ switch (_c.label) {
2320
+ case 0: return [4 /*yield*/, this._configuratorService.selectAnswer(answer, false)];
2321
+ case 1:
2322
+ _c.sent();
2323
+ _b = (_a = this.modelLoaded).next;
2324
+ return [4 /*yield*/, this.buildModel()];
2325
+ case 2:
2326
+ _b.apply(_a, [_c.sent()]);
2327
+ return [2 /*return*/];
2328
+ }
2329
+ });
2330
+ });
2331
+ };
2332
+ Builder.prototype.getImageForSelectionOrAnswer = function (object) {
2333
+ var _this = this;
2334
+ var includeMimeType = true, thumb = true;
2335
+ return new Promise(function (resolve, reject) {
2336
+ if (object && object.nodeId) {
2337
+ if (!_this._imageCache.has(object.nodeId)) {
2338
+ return _this._configuratorService.getSingleImage(object.nodeId, 4, includeMimeType, thumb, true)
2339
+ .then(function (responseData) {
2340
+ var base64 = _this._handleResponseData(includeMimeType, thumb, responseData);
2341
+ _this._imageCache.set(object.nodeId, base64);
2342
+ resolve(base64);
2343
+ }).catch(function () {
2344
+ reject();
2345
+ });
2346
+ }
2347
+ else {
2348
+ resolve(_this._imageCache.get(object.nodeId));
2349
+ }
2350
+ }
2351
+ else {
2352
+ reject();
2353
+ }
2354
+ });
2355
+ };
2356
+ Builder.prototype._cleanUp = function () {
2357
+ this._sku = undefined;
2358
+ this._goodId = undefined;
2359
+ this._instanceId = undefined;
2360
+ this._variationHelper.clearCache();
2361
+ };
2362
+ Builder.prototype._handleResponseData = function (includeMimetype, thumb, responseData) {
2363
+ if (responseData && responseData.resultObject) {
2364
+ if (responseData.resultObject.filePath !== null && responseData.resultObject.filePath !== "") {
2365
+ return ImageUtils.getFixedImageFilepathUrl(responseData.resultObject.filePath);
2366
+ }
2367
+ else {
2368
+ if (includeMimetype) {
2369
+ return ImageUtils.getDocBodyWithMimeTypeDefinition(responseData.resultObject.fileName, thumb ? responseData.resultObject.thumbnailBody : responseData.resultObject.documentBody);
2370
+ }
2371
+ else {
2372
+ return thumb ? responseData.resultObject.thumbnailBody : responseData.resultObject.documentBody;
2373
+ }
2374
+ }
2375
+ }
2376
+ else {
2377
+ return '';
2378
+ }
2379
+ };
2380
+ Builder.prototype._setInstanceId = function (sku, instanceId, goodId) {
2381
+ return __awaiter(this, void 0, void 0, function () {
2382
+ var result;
2383
+ return __generator(this, function (_a) {
2384
+ switch (_a.label) {
2385
+ case 0:
2386
+ if (!(!instanceId && !this._instanceId)) return [3 /*break*/, 4];
2387
+ if (!!goodId) return [3 /*break*/, 2];
2388
+ return [4 /*yield*/, this._getGoodIdFromSku(sku)];
2389
+ case 1:
2390
+ goodId = _a.sent();
2391
+ _a.label = 2;
2392
+ case 2:
2393
+ this._goodId = goodId;
2394
+ return [4 /*yield*/, this.initNodeInstance(this._goodId)];
2395
+ case 3:
2396
+ result = _a.sent();
2397
+ if (result && result.resultObject) {
2398
+ this._instanceId = result.resultObject;
2399
+ }
2400
+ else {
2401
+ throw 'Failed to initialize node instance';
2402
+ }
2403
+ return [3 /*break*/, 5];
2404
+ case 4:
2405
+ if (!this._instanceId) {
2406
+ this._instanceId = instanceId;
2407
+ }
2408
+ _a.label = 5;
2409
+ case 5:
2410
+ if (!this._sku) {
2411
+ this._sku = sku;
2412
+ }
2413
+ return [2 /*return*/];
2414
+ }
2415
+ });
2416
+ });
1788
2417
  };
1789
2418
  Builder.prototype._prepareConfiguration = function (sku, goodId) {
1790
2419
  return __awaiter(this, void 0, void 0, function () {
1791
- var article, _a;
1792
- return __generator(this, function (_b) {
1793
- switch (_b.label) {
2420
+ var article;
2421
+ return __generator(this, function (_a) {
2422
+ switch (_a.label) {
1794
2423
  case 0: return [4 /*yield*/, this._getArticle(sku, goodId)];
1795
2424
  case 1:
1796
- article = _b.sent();
2425
+ article = _a.sent();
1797
2426
  if (!(article && article.assetUrl)) return [3 /*break*/, 3];
2427
+ return [4 /*yield*/, this._downloadAsset(article.assetUrl, article.contentDeliveryUrl, article.distSchema)];
2428
+ case 2:
2429
+ _a.sent();
2430
+ _a.label = 3;
2431
+ case 3: return [2 /*return*/];
2432
+ }
2433
+ });
2434
+ });
2435
+ };
2436
+ Builder.prototype._downloadAsset = function (assetUrl, cdnUrl, schema) {
2437
+ return __awaiter(this, void 0, void 0, function () {
2438
+ var _a;
2439
+ return __generator(this, function (_b) {
2440
+ switch (_b.label) {
2441
+ case 0:
1798
2442
  _a = this;
1799
- return [4 /*yield*/, this._threedUtils.download3DSource(article.assetUrl)
2443
+ return [4 /*yield*/, this._threedUtils.download3DSource(assetUrl, cdnUrl)
1800
2444
  .catch(function (error) {
1801
2445
  throw error;
1802
2446
  })];
1803
- case 2:
2447
+ case 1:
1804
2448
  _a._source = _b.sent();
1805
- if (article.contentDeliveryUrl) {
2449
+ if (cdnUrl) {
1806
2450
  this._variationHelper.assetPath =
1807
- article.contentDeliveryUrl +
1808
- (article.contentDeliveryUrl.endsWith('/') ? '' : '/') +
1809
- (article.distSchema ? article.distSchema : 'UP_DBA');
2451
+ cdnUrl +
2452
+ (cdnUrl.endsWith('/') ? '' : '/') +
2453
+ (schema ? schema : 'UP_DBA');
1810
2454
  }
1811
- _b.label = 3;
1812
- case 3: return [2 /*return*/];
2455
+ return [2 /*return*/];
1813
2456
  }
1814
2457
  });
1815
2458
  });
1816
2459
  };
1817
- Builder.prototype._build = function (instanceId) {
2460
+ Builder.prototype._build = function () {
1818
2461
  return __awaiter(this, void 0, void 0, function () {
1819
2462
  var adjustables, obj, connected, i, len, adjustable, ii, lenii;
1820
2463
  return __generator(this, function (_a) {
@@ -1823,7 +2466,7 @@
1823
2466
  this._reset();
1824
2467
  adjustables = this._getAdjustables();
1825
2468
  if (!(adjustables && adjustables.length > 0)) return [3 /*break*/, 2];
1826
- obj = new three.Object3D();
2469
+ obj = new THREE__namespace.Object3D();
1827
2470
  obj.visible = false; // no need to render visualy
1828
2471
  this._scene.add(obj);
1829
2472
  connected = false;
@@ -1846,10 +2489,12 @@
1846
2489
  }
1847
2490
  this._placeAddables(obj);
1848
2491
  this._updatePivot(obj);
1849
- return [4 /*yield*/, this._loadVariations(obj, instanceId)];
2492
+ return [4 /*yield*/, this._loadVariations(obj)];
1850
2493
  case 1:
1851
2494
  _a.sent();
2495
+ // this._variationHelper.clearCache();
1852
2496
  this._scene.remove(obj);
2497
+ ObjectUtils.DisposeObject(this._source);
1853
2498
  return [2 /*return*/, obj];
1854
2499
  case 2: throw 'No adjustables found!';
1855
2500
  }
@@ -1950,8 +2595,8 @@
1950
2595
  var obj = this._source ? this._source.getObjectByName(adj.decoNode.gameObjectName) : null;
1951
2596
  if (!obj) {
1952
2597
  // in case of glb files, the importer removes dots from names
1953
- var name_1 = adj.decoNode.gameObjectName.replace(/[.]/g, '');
1954
- obj = this._source ? this._source.getObjectByName(name_1) : null;
2598
+ var name = adj.decoNode.gameObjectName.replace(/[.]/g, '');
2599
+ obj = this._source ? this._source.getObjectByName(name) : null;
1955
2600
  if (!obj) {
1956
2601
  // console.warn(`No object with name ${adj.decoNode.gameObjectName} found!`);
1957
2602
  return null;
@@ -2041,6 +2686,7 @@
2041
2686
  switch (_a.label) {
2042
2687
  case 0:
2043
2688
  if (this._articleCache.has(sku)) {
2689
+ this.articleLoaded.next(this._articleCache.get(sku));
2044
2690
  return [2 /*return*/, this._articleCache.get(sku)];
2045
2691
  }
2046
2692
  if (!!goodId) return [3 /*break*/, 2];
@@ -2064,24 +2710,27 @@
2064
2710
  }
2065
2711
  }
2066
2712
  this._articleCache.set(sku, article$1);
2713
+ this.articleLoaded.next(article$1);
2067
2714
  return [2 /*return*/, article$1];
2068
2715
  }
2069
2716
  });
2070
2717
  });
2071
2718
  };
2072
- Builder.prototype._getSelections = function (instanceId) {
2719
+ Builder.prototype._getSelections = function (instanceId, publicationCode) {
2073
2720
  return __awaiter(this, void 0, void 0, function () {
2074
2721
  var selectionResponse;
2075
2722
  return __generator(this, function (_a) {
2076
2723
  switch (_a.label) {
2077
2724
  case 0:
2078
- this._selections.length = 0;
2079
- return [4 /*yield*/, this._configuratorService.getSelections(false)];
2725
+ this._selections = [];
2726
+ return [4 /*yield*/, this._configuratorService.getSelections(false, publicationCode)];
2080
2727
  case 1:
2081
2728
  selectionResponse = _a.sent();
2082
2729
  if (selectionResponse.resultObjects && selectionResponse.resultObjects.length > 0) {
2083
2730
  this._selections = this._boFactory.makeBOArrayFromRawBackendDataArray(selection.Selection, selectionResponse.resultObjects);
2084
2731
  this._selections.forEach(function (s) { return s.instanceId = instanceId; });
2732
+ // const filtered: Selection[] = this._selections.filter(s => s.nodeType !== NodeType.Article && s.presentationLevel === 1);
2733
+ this.selectionsReceived.next(this._selections);
2085
2734
  }
2086
2735
  else {
2087
2736
  throw 'No selections found!';
@@ -2097,12 +2746,13 @@
2097
2746
  return __generator(this, function (_a) {
2098
2747
  switch (_a.label) {
2099
2748
  case 0:
2100
- this._decos.length = 0;
2749
+ this._decos = [];
2101
2750
  return [4 /*yield*/, this._configuratorService.getDecos(false)];
2102
2751
  case 1:
2103
2752
  decosResponse = _a.sent();
2104
2753
  if (decosResponse.resultObjects && decosResponse.resultObjects.length > 0) {
2105
2754
  this._decos = this._boFactory.makeBOArrayFromRawBackendDataArray(decoNode.DecoNode, decosResponse.resultObjects);
2755
+ this.decosReceived.next(this._decos);
2106
2756
  }
2107
2757
  else {
2108
2758
  throw 'No deconodes found!';
@@ -2140,19 +2790,20 @@
2140
2790
  return deco.type === decoNodeType_enum.DecoNodeType.Variation;
2141
2791
  });
2142
2792
  };
2143
- Builder.prototype._loadVariations = function (obj, instanceId) {
2793
+ Builder.prototype._loadVariations = function (obj) {
2144
2794
  return __awaiter(this, void 0, void 0, function () {
2145
2795
  return __generator(this, function (_a) {
2146
2796
  switch (_a.label) {
2147
2797
  case 0: return [4 /*yield*/, this._variationHelper.loadPart(obj, this._adjustables, true)];
2148
2798
  case 1:
2149
2799
  _a.sent();
2150
- return [4 /*yield*/, this._variationHelper.loadVariation(instanceId, obj, this._adjustables, true)];
2800
+ return [4 /*yield*/, this._variationHelper.loadVariation(obj, this._adjustables, true)];
2151
2801
  case 2:
2152
2802
  _a.sent();
2153
- return [4 /*yield*/, this._variationHelper.loadVariation(instanceId, obj, this._addables, true)];
2803
+ return [4 /*yield*/, this._variationHelper.loadVariation(obj, this._addables, true)];
2154
2804
  case 3:
2155
2805
  _a.sent();
2806
+ this._variationHelper.clearCache();
2156
2807
  return [2 /*return*/];
2157
2808
  }
2158
2809
  });
@@ -2165,10 +2816,10 @@
2165
2816
  });
2166
2817
  };
2167
2818
  Builder.prototype._updatePivot = function (obj) {
2168
- var boundingBox = new three.Box3().setFromObject(obj);
2169
- var bbCenterPivot = new three.Vector3();
2819
+ var boundingBox = new THREE__namespace.Box3().setFromObject(obj);
2820
+ var bbCenterPivot = new THREE__namespace.Vector3();
2170
2821
  boundingBox.getCenter(bbCenterPivot);
2171
- var delta = new three.Vector3().sub(bbCenterPivot).setY(Math.abs(Math.min(boundingBox.min.y, 0)));
2822
+ var delta = new THREE__namespace.Vector3().sub(bbCenterPivot).setY(Math.abs(Math.min(boundingBox.min.y, 0)));
2172
2823
  obj.children.forEach(function (child) {
2173
2824
  child.position.add(delta);
2174
2825
  });
@@ -2181,149 +2832,93 @@
2181
2832
  this._addables.length = 0;
2182
2833
  this._prepareTheSelections();
2183
2834
  };
2184
- Builder.ctorParameters = function () { return [
2185
- { type: three.Scene },
2186
- { type: options.Options },
2187
- { type: Boolean }
2188
- ]; };
2189
- Builder = __decorate([
2190
- core.Injectable()
2191
- ], Builder);
2192
2835
  return Builder;
2193
- }());
2836
+ }());
2837
+ Builder.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function Builder_Factory() { return new Builder(); }, token: Builder, providedIn: "root" });
2838
+ Builder.decorators = [
2839
+ { type: i0.Injectable, args: [{
2840
+ providedIn: "root"
2841
+ },] }
2842
+ ];
2843
+ Builder.ctorParameters = function () { return []; };
2194
2844
 
2195
2845
  var AnswersComponent = /** @class */ (function () {
2196
2846
  function AnswersComponent() {
2197
2847
  this.answers = [];
2198
- this.answerClick = new core.EventEmitter();
2848
+ this.answerClick = new i0.EventEmitter();
2199
2849
  }
2200
- __decorate([
2201
- core.Input()
2202
- ], AnswersComponent.prototype, "answers", void 0);
2203
- __decorate([
2204
- core.Input()
2205
- ], AnswersComponent.prototype, "selectionTitle", void 0);
2206
- __decorate([
2207
- core.Output()
2208
- ], AnswersComponent.prototype, "answerClick", void 0);
2209
- AnswersComponent = __decorate([
2210
- core.Component({
2211
- selector: "answers",
2212
- template: "\n <ng-container>\n <div class=\"answers-container\" visibilityObserverMaster>\n <h2 class=\"answers-title\" [textContent]=\"selectionTitle\"></h2>\n <answer *ngFor=\"let answer of answers\"\n (click)=\"answerClick.emit(answer)\"\n [answer]=\"answer\"\n visibilityObserver\n #intersection=\"intersection\"\n [observerEnabled]=\"true\"\n [showing]=\"intersection.isIntersecting\"\n ></answer>\n </div>\n </ng-container>\n ",
2213
- styles: [":host{position:absolute;top:0;right:0;width:400px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}:host .answers-title{margin-left:10px;color:#1a1a1a}:host .answers-container{height:100vh;overflow-y:scroll}", ".selection{position:relative;overflow:hidden;cursor:pointer;font-size:12px;border:1px solid #d3d3d3;padding:10px;display:flex;flex-direction:row;border-radius:3px;margin-bottom:3px;box-shadow:2px 1px rgba(211,211,211,.5);background:#fff}.thumbnail{width:54px;min-width:54px;height:54px;min-height:54px;border:1px solid #d3d3d3;border-radius:5px}.img-size{width:54px;min-width:54px;height:54px;min-height:54px;border-radius:5px}.unloaded{background-color:#d3d3d3}.titles{margin-left:14px;-ms-grid-row-align:center;align-self:center}"]
2214
- })
2215
- ], AnswersComponent);
2216
2850
  return AnswersComponent;
2217
- }());
2218
-
2219
- var ImageCacheService = /** @class */ (function () {
2220
- function ImageCacheService(_configuratorService) {
2221
- this._configuratorService = _configuratorService;
2222
- // Map containing the retrieved images, @number = nodeId, @string = base64 string
2223
- this._imageCache = new Map();
2224
- }
2225
- ImageCacheService_1 = ImageCacheService;
2226
- ImageCacheService._handleResponseData = function (includeMimetype, thumb, responseData) {
2227
- if (responseData && responseData.resultObject) {
2228
- if (responseData.resultObject.filePath !== null && responseData.resultObject.filePath !== "") {
2229
- return ImageUtils.getFixedImageFilepathUrl(responseData.resultObject.filePath);
2230
- }
2231
- else {
2232
- if (includeMimetype) {
2233
- return ImageUtils.getDocBodyWithMimeTypeDefinition(responseData.resultObject.fileName, thumb ? responseData.resultObject.thumbnailBody : responseData.resultObject.documentBody);
2234
- }
2235
- else {
2236
- return thumb ? responseData.resultObject.thumbnailBody : responseData.resultObject.documentBody;
2237
- }
2238
- }
2239
- }
2240
- else {
2241
- return '';
2242
- }
2243
- };
2244
- ImageCacheService.prototype.getImageForSelectionOrAnswer = function (object) {
2245
- var _this = this;
2246
- var includeMimeType = true, thumb = true;
2247
- return new Promise(function (resolve, reject) {
2248
- if (object && object.nodeId) {
2249
- if (!_this._imageCache.has(object.nodeId)) {
2250
- return _this._configuratorService.getSingleImage(object.nodeId, 4, includeMimeType, thumb, true)
2251
- .then(function (responseData) {
2252
- var base64 = ImageCacheService_1._handleResponseData(includeMimeType, thumb, responseData);
2253
- _this._imageCache.set(object.nodeId, base64);
2254
- resolve(base64);
2255
- });
2256
- }
2257
- else {
2258
- resolve(_this._imageCache.get(object.nodeId));
2259
- }
2260
- }
2261
- else {
2262
- reject();
2263
- }
2264
- });
2265
- };
2266
- var ImageCacheService_1;
2267
- ImageCacheService.ctorParameters = function () { return [
2268
- { type: ConfiguratorService }
2269
- ]; };
2270
- ImageCacheService.ɵprov = core.ɵɵdefineInjectable({ factory: function ImageCacheService_Factory() { return new ImageCacheService(core.ɵɵinject(ConfiguratorService)); }, token: ImageCacheService, providedIn: "root" });
2271
- ImageCacheService = ImageCacheService_1 = __decorate([
2272
- core.Injectable({
2273
- providedIn: 'root'
2274
- })
2275
- ], ImageCacheService);
2276
- return ImageCacheService;
2277
- }());
2851
+ }());
2852
+ AnswersComponent.decorators = [
2853
+ { type: i0.Component, args: [{
2854
+ selector: "answers",
2855
+ template: "\n <div class=\"ione-configurator\">\n <div class=\"rp-answers-slideout\">\n <h2 class=\"answers-title\" [textContent]=\"selectionTitle\"></h2>\n <div class=\"answers-container\" visibilityObserverMaster>\n <answer *ngFor=\"let answer of answers\"\n (click)=\"answerClick.emit(answer)\"\n [answer]=\"answer\"\n visibilityObserver\n #intersection=\"intersection\"\n [observerEnabled]=\"true\"\n [showing]=\"intersection.isIntersecting\"\n ></answer>\n </div>\n \n </div>\n </div>\n ",
2856
+ styles: [".ione-configurator .rp-answers-slideout{position:absolute;top:0;right:0;width:400px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.ione-configurator .answers-title{margin-left:10px;color:#1a1a1a}.ione-configurator .answers-container{height:100vh;overflow-y:scroll}.ione-configurator .answer-content{position:relative;overflow:hidden;cursor:pointer;font-size:12px;border:1px solid lightgray;padding:10px;display:flex;flex-direction:row;border-radius:3px;margin-bottom:3px;box-shadow:2px 1px #d3d3d380;background:white}.ione-configurator .thumbnail{width:54px;min-width:54px;height:54px;min-height:54px;border:1px solid #d3d3d3;border-radius:5px}.ione-configurator .img-size{width:54px;min-width:54px;height:54px;min-height:54px;border-radius:5px}.ione-configurator .answer-wrapper{display:block}.ione-configurator .answer-title{font-size:12px;position:relative;overflow:hidden;cursor:pointer}.ione-configurator .question{font-weight:bold;color:#1a1a1a}.ione-configurator .answer{font-size:12px;font-style:italic;margin-top:3px}.ione-configurator .collapse-wrapper{display:block}.ione-configurator .collapse-content{display:block}.ione-configurator .collapse-handle{position:absolute;top:10px;right:12px;border:solid black;border-width:0 3px 3px 0;display:inline-block;padding:3px;transform:rotate(45deg);-webkit-transform:rotate(45deg)}.ione-configurator .collapse-handle.expanded{transform:rotate(-135deg);-webkit-transform:rotate(-135deg)}.ione-configurator .child-selection{margin-left:10px;display:flex;flex-direction:column;margin-top:5px}.ione-configurator .mat-title{margin-left:10px;color:#1a1a1a}.ione-configurator .drawer__header{height:48px}.ione-configurator .rp-selections-summary{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;background:transparent;overflow:auto;position:absolute;top:0;right:0;width:400px}.ione-configurator .selections-content{overflow-y:auto}.ione-configurator .co-summary-line{position:relative;overflow:hidden;cursor:pointer;font-size:12px;border:1px solid lightgray;padding:10px;display:flex;flex-direction:row;border-radius:3px;margin-bottom:3px;box-shadow:2px 1px #d3d3d380;background:white}.ione-configurator .selection-thumbnail{width:54px;min-width:54px;height:54px;min-height:54px;border:1px solid #d3d3d3;border-radius:5px}.ione-configurator .selection-img{width:54px;min-width:54px;height:54px;min-height:54px;border-radius:5px}.ione-configurator .answer-thumbnail{width:54px;min-width:54px;height:54px;min-height:54px;border:1px solid #d3d3d3;border-radius:5px}.ione-configurator .answer-img{width:54px;min-width:54px;height:54px;min-height:54px;border-radius:5px}.ione-configurator .unloaded{background-color:#d3d3d3}.ione-configurator .titles{margin-left:14px;align-self:center}.ione-configurator .title-wrapper{display:flex;flex-direction:column}.ione-configurator .answer-title-wrapper{text-align:center;align-self:center;margin-left:14px}\n"]
2857
+ },] }
2858
+ ];
2859
+ AnswersComponent.ctorParameters = function () { return []; };
2860
+ AnswersComponent.propDecorators = {
2861
+ answers: [{ type: i0.Input }],
2862
+ selectionTitle: [{ type: i0.Input }],
2863
+ answerClick: [{ type: i0.Output }]
2864
+ };
2278
2865
 
2279
2866
  var AnswerComponent = /** @class */ (function () {
2280
- function AnswerComponent(_imageCacheService) {
2281
- this._imageCacheService = _imageCacheService;
2282
- this.thumbnailLoaded = false;
2867
+ function AnswerComponent(_builder) {
2868
+ this._builder = _builder;
2283
2869
  }
2284
2870
  Object.defineProperty(AnswerComponent.prototype, "showing", {
2285
2871
  set: function (value) {
2286
- if (value) {
2872
+ this.answer.imageData = '';
2873
+ if (value && this.answer.answer !== 'Skip / Cancel') {
2287
2874
  this._loadThumbnail(this.answer);
2288
2875
  }
2876
+ else {
2877
+ this.answer.imageData = null;
2878
+ }
2289
2879
  },
2290
- enumerable: true,
2880
+ enumerable: false,
2291
2881
  configurable: true
2292
2882
  });
2293
2883
  AnswerComponent.prototype.ngOnInit = function () {
2294
2884
  };
2295
2885
  AnswerComponent.prototype._loadThumbnail = function (answer) {
2296
- var _this = this;
2297
- this._imageCacheService.getImageForSelectionOrAnswer(answer).then(function (imageSrc) {
2298
- answer.imageData = imageSrc;
2299
- _this.thumbnailLoaded = true;
2886
+ return __awaiter(this, void 0, void 0, function () {
2887
+ return __generator(this, function (_a) {
2888
+ switch (_a.label) {
2889
+ case 0: return [4 /*yield*/, this._builder.getImageForSelectionOrAnswer(answer).then(function (imageSrc) {
2890
+ answer.imageData = imageSrc === "" ? null : imageSrc;
2891
+ })];
2892
+ case 1:
2893
+ _a.sent();
2894
+ return [2 /*return*/];
2895
+ }
2896
+ });
2300
2897
  });
2301
2898
  };
2302
- AnswerComponent.ctorParameters = function () { return [
2303
- { type: ImageCacheService }
2304
- ]; };
2305
- __decorate([
2306
- core.Input()
2307
- ], AnswerComponent.prototype, "answer", void 0);
2308
- __decorate([
2309
- core.Input()
2310
- ], AnswerComponent.prototype, "showing", null);
2311
- AnswerComponent = __decorate([
2312
- core.Component({
2313
- selector: 'answer',
2314
- template: "\n <ng-container>\n <div class=\"selection\" @answerAppear>\n <div class=\"thumbnail\">\n <rp-loader *ngIf=\"!thumbnailLoaded\"></rp-loader>\n <img *ngIf=\"answer.imageData\" class=\"img-size\" [src]=\"answer.imageData\">\n </div>\n <div class=\"titles\">\n <div class=\"answer\" [textContent]=\"answer.commercialAnswer\"></div>\n </div>\n </div>\n </ng-container>\n ",
2315
- animations: [
2316
- animations.trigger('answerAppear', [
2317
- animations.state('void', animations.style({ 'background': '#dbdbdb' })),
2318
- animations.state('white', animations.style({ 'background': 'white' })),
2319
- animations.transition('void <=> *', animations.animate(500))
2320
- ])
2321
- ],
2322
- styles: [".answer{font-size:12px;position:relative;overflow:hidden;cursor:pointer}", ".selection{position:relative;overflow:hidden;cursor:pointer;font-size:12px;border:1px solid #d3d3d3;padding:10px;display:flex;flex-direction:row;border-radius:3px;margin-bottom:3px;box-shadow:2px 1px rgba(211,211,211,.5);background:#fff}.thumbnail{width:54px;min-width:54px;height:54px;min-height:54px;border:1px solid #d3d3d3;border-radius:5px}.img-size{width:54px;min-width:54px;height:54px;min-height:54px;border-radius:5px}.unloaded{background-color:#d3d3d3}.titles{margin-left:14px;-ms-grid-row-align:center;align-self:center}"]
2323
- })
2324
- ], AnswerComponent);
2325
2899
  return AnswerComponent;
2326
- }());
2900
+ }());
2901
+ AnswerComponent.decorators = [
2902
+ { type: i0.Component, args: [{
2903
+ selector: 'answer',
2904
+ template: "\n <div class=\"ione-configurator\">\n <div class=\"answer-wrapper\">\n <div class=\"answer-content\" @answerAppear>\n <div class=\"answer-thumbnail\">\n <rp-loader *ngIf=\"answer.imageData === ''\"></rp-loader>\n <img *ngIf=\"answer.imageData !== '' && answer.imageData !== null\" class=\"answer-img\" [src]=\"answer.imageData\">\n </div>\n <div class=\"answer-title-wrapper\">\n <span class=\"answer-title\" [textContent]=\"answer.commercialAnswer\"></span>\n </div>\n <div class=\"price\">\n <span class=\"price-value\"></span>\n </div>\n </div>\n </div>\n </div>\n ",
2905
+ animations: [
2906
+ animations.trigger('answerAppear', [
2907
+ animations.state('void', animations.style({ 'background': '#dbdbdb' })),
2908
+ animations.state('white', animations.style({ 'background': 'white' })),
2909
+ animations.transition('void <=> *', animations.animate(500))
2910
+ ])
2911
+ ],
2912
+ styles: [".ione-configurator .rp-answers-slideout{position:absolute;top:0;right:0;width:400px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.ione-configurator .answers-title{margin-left:10px;color:#1a1a1a}.ione-configurator .answers-container{height:100vh;overflow-y:scroll}.ione-configurator .answer-content{position:relative;overflow:hidden;cursor:pointer;font-size:12px;border:1px solid lightgray;padding:10px;display:flex;flex-direction:row;border-radius:3px;margin-bottom:3px;box-shadow:2px 1px #d3d3d380;background:white}.ione-configurator .thumbnail{width:54px;min-width:54px;height:54px;min-height:54px;border:1px solid #d3d3d3;border-radius:5px}.ione-configurator .img-size{width:54px;min-width:54px;height:54px;min-height:54px;border-radius:5px}.ione-configurator .answer-wrapper{display:block}.ione-configurator .answer-title{font-size:12px;position:relative;overflow:hidden;cursor:pointer}.ione-configurator .question{font-weight:bold;color:#1a1a1a}.ione-configurator .answer{font-size:12px;font-style:italic;margin-top:3px}.ione-configurator .collapse-wrapper{display:block}.ione-configurator .collapse-content{display:block}.ione-configurator .collapse-handle{position:absolute;top:10px;right:12px;border:solid black;border-width:0 3px 3px 0;display:inline-block;padding:3px;transform:rotate(45deg);-webkit-transform:rotate(45deg)}.ione-configurator .collapse-handle.expanded{transform:rotate(-135deg);-webkit-transform:rotate(-135deg)}.ione-configurator .child-selection{margin-left:10px;display:flex;flex-direction:column;margin-top:5px}.ione-configurator .mat-title{margin-left:10px;color:#1a1a1a}.ione-configurator .drawer__header{height:48px}.ione-configurator .rp-selections-summary{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;background:transparent;overflow:auto;position:absolute;top:0;right:0;width:400px}.ione-configurator .selections-content{overflow-y:auto}.ione-configurator .co-summary-line{position:relative;overflow:hidden;cursor:pointer;font-size:12px;border:1px solid lightgray;padding:10px;display:flex;flex-direction:row;border-radius:3px;margin-bottom:3px;box-shadow:2px 1px #d3d3d380;background:white}.ione-configurator .selection-thumbnail{width:54px;min-width:54px;height:54px;min-height:54px;border:1px solid #d3d3d3;border-radius:5px}.ione-configurator .selection-img{width:54px;min-width:54px;height:54px;min-height:54px;border-radius:5px}.ione-configurator .answer-thumbnail{width:54px;min-width:54px;height:54px;min-height:54px;border:1px solid #d3d3d3;border-radius:5px}.ione-configurator .answer-img{width:54px;min-width:54px;height:54px;min-height:54px;border-radius:5px}.ione-configurator .unloaded{background-color:#d3d3d3}.ione-configurator .titles{margin-left:14px;align-self:center}.ione-configurator .title-wrapper{display:flex;flex-direction:column}.ione-configurator .answer-title-wrapper{text-align:center;align-self:center;margin-left:14px}\n"]
2913
+ },] }
2914
+ ];
2915
+ AnswerComponent.ctorParameters = function () { return [
2916
+ { type: Builder }
2917
+ ]; };
2918
+ AnswerComponent.propDecorators = {
2919
+ answer: [{ type: i0.Input }],
2920
+ showing: [{ type: i0.Input }]
2921
+ };
2327
2922
 
2328
2923
  var VisibilityObserverMasterDirective = /** @class */ (function () {
2329
2924
  // I initialize the intersection observer parent directive.
@@ -2377,13 +2972,14 @@
2377
2972
  this._mapping.delete(element);
2378
2973
  this._observer.unobserve(element);
2379
2974
  };
2380
- VisibilityObserverMasterDirective = __decorate([
2381
- core.Directive({
2382
- selector: '[visibilityObserverMaster]'
2383
- })
2384
- ], VisibilityObserverMasterDirective);
2385
2975
  return VisibilityObserverMasterDirective;
2386
- }());
2976
+ }());
2977
+ VisibilityObserverMasterDirective.decorators = [
2978
+ { type: i0.Directive, args: [{
2979
+ selector: '[visibilityObserverMaster]'
2980
+ },] }
2981
+ ];
2982
+ VisibilityObserverMasterDirective.ctorParameters = function () { return []; };
2387
2983
 
2388
2984
  var VisibilityObserverDirective = /** @class */ (function () {
2389
2985
  // I initialize the intersection observer directive.
@@ -2424,76 +3020,76 @@
2424
3020
  });
2425
3021
  }
2426
3022
  };
2427
- VisibilityObserverDirective.ctorParameters = function () { return [
2428
- { type: VisibilityObserverMasterDirective },
2429
- { type: core.ElementRef }
2430
- ]; };
2431
- __decorate([
2432
- core.Input()
2433
- ], VisibilityObserverDirective.prototype, "observerEnabled", void 0);
2434
- VisibilityObserverDirective = __decorate([
2435
- core.Directive({
2436
- selector: '[visibilityObserver]',
2437
- exportAs: 'intersection'
2438
- })
2439
- ], VisibilityObserverDirective);
2440
3023
  return VisibilityObserverDirective;
2441
- }());
3024
+ }());
3025
+ VisibilityObserverDirective.decorators = [
3026
+ { type: i0.Directive, args: [{
3027
+ selector: '[visibilityObserver]',
3028
+ exportAs: 'intersection'
3029
+ },] }
3030
+ ];
3031
+ VisibilityObserverDirective.ctorParameters = function () { return [
3032
+ { type: VisibilityObserverMasterDirective },
3033
+ { type: i0.ElementRef }
3034
+ ]; };
3035
+ VisibilityObserverDirective.propDecorators = {
3036
+ observerEnabled: [{ type: i0.Input }]
3037
+ };
2442
3038
 
2443
3039
  var LoaderComponent = /** @class */ (function () {
2444
3040
  function LoaderComponent() {
2445
3041
  }
2446
- LoaderComponent = __decorate([
2447
- core.Component({
2448
- selector: 'rp-loader',
2449
- template: "\n <div class=\"loader-wrapper\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"44\" height=\"44\" viewBox=\"0 0 44 44\" stroke=\"#3760a1\">\n <g fill=\"none\" fill-rule=\"evenodd\" stroke-width=\"3\">\n <circle class=\"ripple1\" cx=\"22\" cy=\"22\" r=\"19\">\n </circle>\n <circle class=\"ripple2\" cx=\"22\" cy=\"22\" r=\"19\">\n </circle>\n </g>\n </svg>\n </div>\n ",
2450
- styles: [":host{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none}:host .loader-wrapper{z-index:1100;position:absolute;width:54px;height:54px}:host .loader-wrapper svg{width:100%;height:100%}:host .loader-wrapper svg .ripple1{transform-origin:center;-webkit-animation:1.5s infinite ripple;animation:1.5s infinite ripple}:host .loader-wrapper svg .ripple2{transform-origin:center;-webkit-animation:1.5s .4s infinite ripple;animation:1.5s .4s infinite ripple}@-webkit-keyframes ripple{0%{transform:scale(0);opacity:1}100%{transform:scale(1);opacity:0}}@keyframes ripple{0%{transform:scale(0);opacity:1}100%{transform:scale(1);opacity:0}}"]
2451
- })
2452
- ], LoaderComponent);
2453
3042
  return LoaderComponent;
2454
- }());
3043
+ }());
3044
+ LoaderComponent.decorators = [
3045
+ { type: i0.Component, args: [{
3046
+ selector: 'rp-loader',
3047
+ template: "\n <div class=\"loader-wrapper\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"44\" height=\"44\" viewBox=\"0 0 44 44\" stroke=\"#3760a1\">\n <g fill=\"none\" fill-rule=\"evenodd\" stroke-width=\"3\">\n <circle class=\"ripple1\" cx=\"22\" cy=\"22\" r=\"19\">\n </circle>\n <circle class=\"ripple2\" cx=\"22\" cy=\"22\" r=\"19\">\n </circle>\n </g>\n </svg>\n </div>\n ",
3048
+ styles: [":host{-webkit-user-select:none;user-select:none;pointer-events:none}:host .loader-wrapper{z-index:1100;position:absolute;width:54px;height:54px}:host .loader-wrapper svg{width:100%;height:100%}:host .loader-wrapper svg .ripple1{transform-origin:center;animation:ripple 1.5s infinite}:host .loader-wrapper svg .ripple2{transform-origin:center;animation:ripple 1.5s infinite .4s}@keyframes ripple{0%{transform:scale(0);opacity:1}to{transform:scale(1);opacity:0}}\n"]
3049
+ },] }
3050
+ ];
2455
3051
 
2456
3052
  var SharedModule = /** @class */ (function () {
2457
3053
  function SharedModule() {
2458
3054
  }
2459
- SharedModule = __decorate([
2460
- core.NgModule({
2461
- imports: [
2462
- common.CommonModule
2463
- ],
2464
- declarations: [
2465
- LoaderComponent
2466
- ],
2467
- exports: [
2468
- LoaderComponent
2469
- ]
2470
- })
2471
- ], SharedModule);
2472
3055
  return SharedModule;
2473
- }());
3056
+ }());
3057
+ SharedModule.decorators = [
3058
+ { type: i0.NgModule, args: [{
3059
+ imports: [
3060
+ common.CommonModule
3061
+ ],
3062
+ declarations: [
3063
+ LoaderComponent
3064
+ ],
3065
+ exports: [
3066
+ LoaderComponent
3067
+ ]
3068
+ },] }
3069
+ ];
2474
3070
 
2475
3071
  var AnswersModule = /** @class */ (function () {
2476
3072
  function AnswersModule() {
2477
3073
  }
2478
- AnswersModule = __decorate([
2479
- core.NgModule({
2480
- imports: [
2481
- common.CommonModule,
2482
- SharedModule
2483
- ],
2484
- declarations: [
2485
- AnswersComponent,
2486
- AnswerComponent,
2487
- VisibilityObserverDirective,
2488
- VisibilityObserverMasterDirective
2489
- ],
2490
- exports: [
2491
- AnswersComponent
2492
- ]
2493
- })
2494
- ], AnswersModule);
2495
3074
  return AnswersModule;
2496
- }());
3075
+ }());
3076
+ AnswersModule.decorators = [
3077
+ { type: i0.NgModule, args: [{
3078
+ imports: [
3079
+ common.CommonModule,
3080
+ SharedModule
3081
+ ],
3082
+ declarations: [
3083
+ AnswersComponent,
3084
+ AnswerComponent,
3085
+ VisibilityObserverDirective,
3086
+ VisibilityObserverMasterDirective
3087
+ ],
3088
+ exports: [
3089
+ AnswersComponent
3090
+ ]
3091
+ },] }
3092
+ ];
2497
3093
 
2498
3094
  var SelectionViewModel = /** @class */ (function () {
2499
3095
  function SelectionViewModel() {
@@ -2504,21 +3100,19 @@
2504
3100
  return SelectionViewModel;
2505
3101
  }());
2506
3102
  var SelectionsComponent = /** @class */ (function () {
2507
- function SelectionsComponent(_imageCacheService) {
2508
- this._imageCacheService = _imageCacheService;
3103
+ function SelectionsComponent(_builder) {
3104
+ this._builder = _builder;
2509
3105
  this.selectionViewModels = [];
2510
- this.selectionClick = new core.EventEmitter();
3106
+ this.selectionClick = new i0.EventEmitter();
2511
3107
  }
2512
3108
  Object.defineProperty(SelectionsComponent.prototype, "selections", {
2513
3109
  set: function (value) {
2514
3110
  this._prepareSelections(value);
2515
3111
  this._loadThumbnails();
2516
3112
  },
2517
- enumerable: true,
3113
+ enumerable: false,
2518
3114
  configurable: true
2519
3115
  });
2520
- SelectionsComponent.prototype.ngOnInit = function () {
2521
- };
2522
3116
  SelectionsComponent.prototype.expandClicked = function (selectionViewModel, mouseEvent) {
2523
3117
  mouseEvent.preventDefault();
2524
3118
  mouseEvent.stopImmediatePropagation();
@@ -2537,8 +3131,8 @@
2537
3131
  this.selectionViewModels.forEach(function (viewModel) { return __awaiter(_this, void 0, void 0, function () {
2538
3132
  return __generator(this, function (_a) {
2539
3133
  switch (_a.label) {
2540
- case 0: return [4 /*yield*/, this._imageCacheService.getImageForSelectionOrAnswer(viewModel.selection).then(function (imageSrc) {
2541
- viewModel.thumbnail = imageSrc;
3134
+ case 0: return [4 /*yield*/, this._builder.getImageForSelectionOrAnswer(viewModel.selection).then(function (imageSrc) {
3135
+ viewModel.thumbnail = imageSrc === "" ? null : imageSrc;
2542
3136
  })];
2543
3137
  case 1:
2544
3138
  _a.sent();
@@ -2568,51 +3162,53 @@
2568
3162
  }
2569
3163
  });
2570
3164
  };
2571
- SelectionsComponent.ctorParameters = function () { return [
2572
- { type: ImageCacheService }
2573
- ]; };
2574
- __decorate([
2575
- core.Input()
2576
- ], SelectionsComponent.prototype, "selections", null);
2577
- __decorate([
2578
- core.Output()
2579
- ], SelectionsComponent.prototype, "selectionClick", void 0);
2580
- SelectionsComponent = __decorate([
2581
- core.Component({
2582
- selector: "selections",
2583
- template: "\n <ng-container>\n <div class=\"selections-container\">\n <h2 class=\"selections-title\">Configuratie</h2>\n <div *ngFor=\"let selectionViewModel of selectionViewModels\">\n <div class=\"selection\" (click)=\"selectSelection(selectionViewModel.selection, $event)\">\n <div class=\"thumbnail\">\n <rp-loader *ngIf=\"selectionViewModel.thumbnail === ''\"></rp-loader>\n <img visibilityObserver *ngIf=\"selectionViewModel.thumbnail !== ''\" class=\"img-size\" [src]=\"selectionViewModel.thumbnail\">\n </div>\n <div class=\"titles\">\n <div class=\"question\" [textContent]=\"selectionViewModel.selection.commercialQuestion\"></div>\n <div class=\"answer\" [textContent]=\"selectionViewModel.selection.answer\"></div>\n <div class=\"collapse-handle\" [class.expanded]=\"selectionViewModel.expanded\"\n *ngIf=\"selectionViewModel.children.length > 0\" (click)=\"expandClicked(selectionViewModel, $event)\"></div>\n <div *ngIf=\"selectionViewModel.children.length > 0 && selectionViewModel.expanded\" @showHideChildren>\n <div class=\"child-selection\" *ngFor=\"let selection of selectionViewModel.children\"\n (click)=\"selectSelection(selection, $event)\"\n >\n <div class=\"question\" [textContent]=\"selection.commercialQuestion\"></div>\n <div class=\"answer\" [textContent]=\"selection.answer\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </ng-container>\n ",
2584
- animations: [
2585
- animations.trigger('showHideChildren', [
2586
- animations.state('void', animations.style({ 'height': '0' })),
2587
- animations.state('*', animations.style({ 'height': '*' })),
2588
- animations.transition('void <=> *', animations.animate(200))
2589
- ])
2590
- ],
2591
- styles: [":host{position:absolute;top:0;right:0;width:400px}:host .question{font-weight:700;color:#1a1a1a}:host .answer{font-size:12px;font-style:italic;margin-top:3px}:host .collapse-handle{position:absolute;top:10px;right:12px;border:solid #000;border-width:0 3px 3px 0;display:inline-block;padding:3px;transform:rotate(45deg);-webkit-transform:rotate(45deg)}:host .collapse-handle.expanded{transform:rotate(-135deg);-webkit-transform:rotate(-135deg)}:host .child-selection{margin-left:10px;margin-top:5px}:host .selections-title{margin-left:10px;color:#1a1a1a}:host .selections-container{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;background:0 0;overflow:auto}", ".selection{position:relative;overflow:hidden;cursor:pointer;font-size:12px;border:1px solid #d3d3d3;padding:10px;display:flex;flex-direction:row;border-radius:3px;margin-bottom:3px;box-shadow:2px 1px rgba(211,211,211,.5);background:#fff}.thumbnail{width:54px;min-width:54px;height:54px;min-height:54px;border:1px solid #d3d3d3;border-radius:5px}.img-size{width:54px;min-width:54px;height:54px;min-height:54px;border-radius:5px}.unloaded{background-color:#d3d3d3}.titles{margin-left:14px;-ms-grid-row-align:center;align-self:center}"]
2592
- })
2593
- ], SelectionsComponent);
2594
3165
  return SelectionsComponent;
2595
- }());
3166
+ }());
3167
+ SelectionsComponent.decorators = [
3168
+ { type: i0.Component, args: [{
3169
+ selector: "selections",
3170
+ template: "\n <div class=\"ione-configurator\">\n <div class=\"rp-selections-summary\">\n <header class=\"drawer__header\">\n <h2 class=\"mat-title\" [textContent]=\"'Configuratie'\"></h2>\n <!--<button>-->\n <!---->\n <!--</button>-->\n </header>\n <div class=\"selections-content\">\n <ng-container *ngFor=\"let selectionViewModel of selectionViewModels\">\n\n <div class=\"co-summary-line\" (click)=\"selectSelection(selectionViewModel.selection, $event)\">\n <div class=\"selection-thumbnail\">\n <rp-loader *ngIf=\"selectionViewModel.thumbnail === ''\"></rp-loader>\n <img visibilityObserver *ngIf=\"selectionViewModel.thumbnail !== '' && selectionViewModel.thumbnail !== null\" class=\"selection-img\" [src]=\"selectionViewModel.thumbnail\">\n </div>\n <div class=\"titles\">\n <div class=\"title-wrapper\">\n <label class=\"question\" [textContent]=\"selectionViewModel.selection.question\"></label>\n <span class=\"answer\" [textContent]=\"selectionViewModel.selection.answer\"></span>\n <div *ngIf=\"selectionViewModel.children.length > 0 && selectionViewModel.expanded\" @showHideChildren>\n <div class=\"child-selection\" *ngFor=\"let selection of selectionViewModel.children\"\n (click)=\"selectSelection(selection, $event)\"\n >\n <label class=\"question\" [textContent]=\"selection.commercialQuestion\"></label>\n <span class=\"answer\" [textContent]=\"selection.answer\"></span>\n </div>\n </div>\n </div>\n </div>\n \n <div class=\"price-wrapper\">\n <span class=\"price-value\"></span>\n </div>\n\n <div class=\"collapse-wrapper\">\n <div class=\"collapse-content\">\n <div class=\"collapse-handle\" [class.expanded]=\"selectionViewModel.expanded\"\n *ngIf=\"selectionViewModel.children.length > 0\" (click)=\"expandClicked(selectionViewModel, $event)\"></div>\n </div>\n </div>\n </div>\n\n </ng-container>\n </div>\n </div>\n </div>\n ",
3171
+ animations: [
3172
+ animations.trigger('showHideChildren', [
3173
+ animations.state('void', animations.style({ 'height': '0' })),
3174
+ animations.state('*', animations.style({ 'height': '*' })),
3175
+ animations.transition('void <=> *', animations.animate(200))
3176
+ ])
3177
+ ],
3178
+ styles: [".ione-configurator .rp-answers-slideout{position:absolute;top:0;right:0;width:400px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.ione-configurator .answers-title{margin-left:10px;color:#1a1a1a}.ione-configurator .answers-container{height:100vh;overflow-y:scroll}.ione-configurator .answer-content{position:relative;overflow:hidden;cursor:pointer;font-size:12px;border:1px solid lightgray;padding:10px;display:flex;flex-direction:row;border-radius:3px;margin-bottom:3px;box-shadow:2px 1px #d3d3d380;background:white}.ione-configurator .thumbnail{width:54px;min-width:54px;height:54px;min-height:54px;border:1px solid #d3d3d3;border-radius:5px}.ione-configurator .img-size{width:54px;min-width:54px;height:54px;min-height:54px;border-radius:5px}.ione-configurator .answer-wrapper{display:block}.ione-configurator .answer-title{font-size:12px;position:relative;overflow:hidden;cursor:pointer}.ione-configurator .question{font-weight:bold;color:#1a1a1a}.ione-configurator .answer{font-size:12px;font-style:italic;margin-top:3px}.ione-configurator .collapse-wrapper{display:block}.ione-configurator .collapse-content{display:block}.ione-configurator .collapse-handle{position:absolute;top:10px;right:12px;border:solid black;border-width:0 3px 3px 0;display:inline-block;padding:3px;transform:rotate(45deg);-webkit-transform:rotate(45deg)}.ione-configurator .collapse-handle.expanded{transform:rotate(-135deg);-webkit-transform:rotate(-135deg)}.ione-configurator .child-selection{margin-left:10px;display:flex;flex-direction:column;margin-top:5px}.ione-configurator .mat-title{margin-left:10px;color:#1a1a1a}.ione-configurator .drawer__header{height:48px}.ione-configurator .rp-selections-summary{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;background:transparent;overflow:auto;position:absolute;top:0;right:0;width:400px}.ione-configurator .selections-content{overflow-y:auto}.ione-configurator .co-summary-line{position:relative;overflow:hidden;cursor:pointer;font-size:12px;border:1px solid lightgray;padding:10px;display:flex;flex-direction:row;border-radius:3px;margin-bottom:3px;box-shadow:2px 1px #d3d3d380;background:white}.ione-configurator .selection-thumbnail{width:54px;min-width:54px;height:54px;min-height:54px;border:1px solid #d3d3d3;border-radius:5px}.ione-configurator .selection-img{width:54px;min-width:54px;height:54px;min-height:54px;border-radius:5px}.ione-configurator .answer-thumbnail{width:54px;min-width:54px;height:54px;min-height:54px;border:1px solid #d3d3d3;border-radius:5px}.ione-configurator .answer-img{width:54px;min-width:54px;height:54px;min-height:54px;border-radius:5px}.ione-configurator .unloaded{background-color:#d3d3d3}.ione-configurator .titles{margin-left:14px;align-self:center}.ione-configurator .title-wrapper{display:flex;flex-direction:column}.ione-configurator .answer-title-wrapper{text-align:center;align-self:center;margin-left:14px}\n"]
3179
+ },] }
3180
+ ];
3181
+ SelectionsComponent.ctorParameters = function () { return [
3182
+ { type: Builder }
3183
+ ]; };
3184
+ SelectionsComponent.propDecorators = {
3185
+ selections: [{ type: i0.Input }],
3186
+ selectionClick: [{ type: i0.Output }]
3187
+ };
2596
3188
 
2597
3189
  var SelectionsModule = /** @class */ (function () {
2598
3190
  function SelectionsModule() {
2599
3191
  }
2600
- SelectionsModule = __decorate([
2601
- core.NgModule({
2602
- imports: [
2603
- common.CommonModule,
2604
- SharedModule
2605
- ],
2606
- declarations: [
2607
- SelectionsComponent
2608
- ],
2609
- exports: [
2610
- SelectionsComponent
2611
- ]
2612
- })
2613
- ], SelectionsModule);
2614
3192
  return SelectionsModule;
2615
- }());
3193
+ }());
3194
+ SelectionsModule.decorators = [
3195
+ { type: i0.NgModule, args: [{
3196
+ imports: [
3197
+ common.CommonModule,
3198
+ SharedModule
3199
+ ],
3200
+ declarations: [
3201
+ SelectionsComponent
3202
+ ],
3203
+ exports: [
3204
+ SelectionsComponent
3205
+ ]
3206
+ },] }
3207
+ ];
3208
+
3209
+ /**
3210
+ * Generated bundle index. Do not edit.
3211
+ */
2616
3212
 
2617
3213
  exports.AnswersComponent = AnswersComponent;
2618
3214
  exports.AnswersModule = AnswersModule;
@@ -2620,14 +3216,13 @@
2620
3216
  exports.ConfiguratorService = ConfiguratorService;
2621
3217
  exports.SelectionsComponent = SelectionsComponent;
2622
3218
  exports.SelectionsModule = SelectionsModule;
2623
- exports.ɵa = SharedModule;
2624
- exports.ɵb = LoaderComponent;
2625
- exports.ɵc = AnswerComponent;
2626
- exports.ɵd = ImageCacheService;
2627
- exports.ɵe = VisibilityObserverDirective;
2628
- exports.ɵf = VisibilityObserverMasterDirective;
3219
+ exports["ɵa"] = SharedModule;
3220
+ exports["ɵb"] = LoaderComponent;
3221
+ exports["ɵc"] = AnswerComponent;
3222
+ exports["ɵd"] = VisibilityObserverDirective;
3223
+ exports["ɵe"] = VisibilityObserverMasterDirective;
2629
3224
 
2630
3225
  Object.defineProperty(exports, '__esModule', { value: true });
2631
3226
 
2632
- })));
3227
+ }));
2633
3228
  //# sourceMappingURL=colijnit-configurator.umd.js.map