@colijnit/configurator 259.1.1 → 259.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3555 @@
1
+ (self["webpackChunk_colijnit_configurator"] = self["webpackChunk_colijnit_configurator"] || []).push([["main"],{
2
+
3
+ /***/ 98255:
4
+ /*!*******************************************************!*\
5
+ !*** ./$_lazy_route_resources/ lazy namespace object ***!
6
+ \*******************************************************/
7
+ /***/ ((module) => {
8
+
9
+ function webpackEmptyAsyncContext(req) {
10
+ // Here Promise.resolve().then() is used instead of new Promise() to prevent
11
+ // uncaught exception popping up in devtools
12
+ return Promise.resolve().then(() => {
13
+ var e = new Error("Cannot find module '" + req + "'");
14
+ e.code = 'MODULE_NOT_FOUND';
15
+ throw e;
16
+ });
17
+ }
18
+ webpackEmptyAsyncContext.keys = () => ([]);
19
+ webpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;
20
+ webpackEmptyAsyncContext.id = 98255;
21
+ module.exports = webpackEmptyAsyncContext;
22
+
23
+ /***/ }),
24
+
25
+ /***/ 55041:
26
+ /*!**********************************!*\
27
+ !*** ./src/app/app.component.ts ***!
28
+ \**********************************/
29
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
30
+
31
+ "use strict";
32
+
33
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
34
+ exports.AppComponent = void 0;
35
+ const tslib_1 = __webpack_require__(/*! tslib */ 42321);
36
+ const core_1 = __webpack_require__(/*! @angular/core */ 2316);
37
+ const OrbitControls_1 = __webpack_require__(/*! three/examples/jsm/controls/OrbitControls */ 36668);
38
+ const axios_1 = tslib_1.__importDefault(__webpack_require__(/*! axios */ 61172));
39
+ const GLTFLoader_1 = __webpack_require__(/*! three/examples/jsm/loaders/GLTFLoader */ 43022);
40
+ const three_1 = __webpack_require__(/*! three */ 30712);
41
+ const i0 = tslib_1.__importStar(__webpack_require__(/*! @angular/core */ 2316));
42
+ const i1 = tslib_1.__importStar(__webpack_require__(/*! ./builder */ 24529));
43
+ const i2 = tslib_1.__importStar(__webpack_require__(/*! @angular/common */ 54364));
44
+ const i3 = tslib_1.__importStar(__webpack_require__(/*! ./components/selections/selections.component */ 42226));
45
+ const i4 = tslib_1.__importStar(__webpack_require__(/*! ./components/answers/answers.component */ 84780));
46
+ const _c0 = ["canvas"];
47
+ function AppComponent_selections_3_Template(rf, ctx) { if (rf & 1) {
48
+ const _r4 = i0.ɵɵgetCurrentView();
49
+ i0.ɵɵelementStart(0, "selections", 5);
50
+ i0.ɵɵlistener("selectionClick", function AppComponent_selections_3_Template_selections_selectionClick_0_listener($event) { i0.ɵɵrestoreView(_r4); const ctx_r3 = i0.ɵɵnextContext(); return ctx_r3.selectSelection($event); });
51
+ i0.ɵɵelementEnd();
52
+ } if (rf & 2) {
53
+ const ctx_r1 = i0.ɵɵnextContext();
54
+ i0.ɵɵproperty("selections", ctx_r1.selections);
55
+ } }
56
+ function AppComponent_answers_4_Template(rf, ctx) { if (rf & 1) {
57
+ const _r6 = i0.ɵɵgetCurrentView();
58
+ i0.ɵɵelementStart(0, "answers", 6);
59
+ i0.ɵɵlistener("answerClick", function AppComponent_answers_4_Template_answers_answerClick_0_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r5 = i0.ɵɵnextContext(); return ctx_r5.selectAnswer($event); });
60
+ i0.ɵɵelementEnd();
61
+ } if (rf & 2) {
62
+ const ctx_r2 = i0.ɵɵnextContext();
63
+ i0.ɵɵproperty("selectionTitle", ctx_r2.selectionTitle)("answers", ctx_r2.answers);
64
+ } }
65
+ // @ts-ignore
66
+ window.loadGLTF = (file, isFile = true) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
67
+ const gltfLoader = new GLTFLoader_1.GLTFLoader();
68
+ try {
69
+ return new Promise((resolve) => {
70
+ if (isFile) {
71
+ gltfLoader.load(file, (obj) => {
72
+ resolve(obj.scene);
73
+ });
74
+ }
75
+ else {
76
+ gltfLoader.parse(file, null, (obj) => {
77
+ resolve(obj.scene);
78
+ });
79
+ }
80
+ });
81
+ }
82
+ catch (e) {
83
+ console.error(e);
84
+ return null;
85
+ }
86
+ });
87
+ // @ts-ignore
88
+ window.downloadVariation = (fileName) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
89
+ try {
90
+ const hqFileName = fileName.replace('/variation/', '/variation/HQ/');
91
+ const response = yield axios_1.default({
92
+ method: "get",
93
+ url: `${hqFileName}`,
94
+ responseType: "arraybuffer"
95
+ });
96
+ return yield response.data;
97
+ }
98
+ catch (e) {
99
+ try {
100
+ const response = yield axios_1.default({
101
+ method: "get",
102
+ url: `${fileName}`,
103
+ responseType: "arraybuffer"
104
+ });
105
+ if (response.status !== 200) {
106
+ console.error(response.statusText);
107
+ }
108
+ return yield response.data;
109
+ }
110
+ catch (e) {
111
+ console.error(`Error downloading: ${fileName}`);
112
+ }
113
+ }
114
+ });
115
+ class AppComponent {
116
+ // private _goodId: number = 39221;
117
+ // private _instanceId: string = '96423';
118
+ // private _sku: string = '6373';
119
+ // private _goodId: number = 300868;
120
+ // private _instanceId: string = '321560';
121
+ // private _sku: string = '4358';
122
+ constructor(_builder) {
123
+ this._builder = _builder;
124
+ this.selections = [];
125
+ this.decos = [];
126
+ this.answers = [];
127
+ this.showAnswers = false;
128
+ this.showSelections = true;
129
+ this.scene = new three_1.Scene();
130
+ this._subs = [];
131
+ this._options = {
132
+ url: "https://3dmrp.ionecloud.nl/ione/",
133
+ version: "252",
134
+ schema: "134974"
135
+ };
136
+ // private _options: Options = {
137
+ // url: "https://ione.simonealbani.com:8443/ione",
138
+ // version: "250",
139
+ // schema: "31416"
140
+ // };
141
+ // private _options: Options = {
142
+ // url: "https://3dshared.ionecloud.nl/ione/",
143
+ // version: "250",
144
+ // schema: "67325"
145
+ // };
146
+ this._goodId = 238702;
147
+ this._instanceId = '184141';
148
+ this._sku = '1523';
149
+ }
150
+ ngAfterViewInit() {
151
+ // this._builder = new Builder();
152
+ this._builder.init(this.scene, this._options);
153
+ this._subs.push(this._builder.selectionsReceived.subscribe((selections) => {
154
+ this.selections = selections;
155
+ }), this._builder.decosReceived.subscribe((decos) => {
156
+ this.decos = decos;
157
+ }), this._builder.articleLoaded.subscribe((article) => {
158
+ if (article) {
159
+ this.article = article;
160
+ }
161
+ }), this._builder.answersReceived.subscribe((answers) => {
162
+ this.answers = answers;
163
+ this.showAnswers = this.answers.length > 0;
164
+ }), this._builder.modelLoaded.subscribe((object) => {
165
+ if (object && this.answers.length === 0) {
166
+ this._loadModel(object);
167
+ }
168
+ }));
169
+ this._initScene();
170
+ this._initRenderer();
171
+ this._initCameraAndControls();
172
+ this._initLights();
173
+ // this._test();
174
+ this._animate();
175
+ this._builder.buildModel(this._sku, this._instanceId, this._goodId);
176
+ }
177
+ ngOnDestroy() {
178
+ this._subs.forEach(s => s.unsubscribe());
179
+ }
180
+ disableControls() {
181
+ this.controls.enabled = false;
182
+ }
183
+ enableControls() {
184
+ this.controls.enabled = true;
185
+ }
186
+ selectSelection(selection) {
187
+ this._builder.selectSelection(selection);
188
+ this.selectionTitle = selection.commercialQuestion;
189
+ this.showSelections = false;
190
+ }
191
+ selectAnswer(answer) {
192
+ this._builder.selectAnswer(answer);
193
+ this.selectionTitle = ' . . / ' + answer.answer;
194
+ }
195
+ render() {
196
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
197
+ const data = {
198
+ selections: this.selections,
199
+ decos: this.decos,
200
+ assetUrl: this.article.assetUrl,
201
+ cdnUrl: this.article.contentDeliveryUrl,
202
+ schema: this.article.distSchema
203
+ };
204
+ const result = yield axios_1.default({
205
+ headers: {
206
+ 'Content-Type': 'application/json'
207
+ },
208
+ method: 'POST',
209
+ data: JSON.stringify(data),
210
+ url: 'http://localhost:3000/getRenderFromData',
211
+ responseType: "json"
212
+ });
213
+ if (result.status === 200) {
214
+ console.log('success!');
215
+ }
216
+ });
217
+ }
218
+ _initScene() {
219
+ this.scene = new three_1.Scene();
220
+ }
221
+ _initRenderer() {
222
+ this.renderer = new three_1.WebGLRenderer({
223
+ alpha: true,
224
+ antialias: true,
225
+ preserveDrawingBuffer: true
226
+ });
227
+ this.renderer.setClearColor(0xfafafa);
228
+ this.renderer.autoClear = true;
229
+ this.renderer.setPixelRatio(window.devicePixelRatio);
230
+ this.renderer.shadowMap.enabled = true;
231
+ // Use PCFShadowMap to enable radius else use PCFSoftShadowMap
232
+ this.renderer.shadowMap.type = three_1.PCFSoftShadowMap;
233
+ // this.renderer.outputEncoding = THREE.sRGBEncoding;
234
+ // this.renderer.gammaFactor = 2.2;
235
+ // this.renderer.toneMappingExposure = 1.1;
236
+ this.canvasElement.nativeElement.appendChild(this.renderer.domElement);
237
+ }
238
+ _initCameraAndControls() {
239
+ this.camera = new three_1.PerspectiveCamera(45, 1, 0.01, 100);
240
+ this.controls = new OrbitControls_1.OrbitControls(this.camera, this.renderer.domElement);
241
+ this.camera.position.set(0, 3, 1.5);
242
+ this.controls.update();
243
+ }
244
+ _animate() {
245
+ this.renderer.setAnimationLoop(() => this._render());
246
+ }
247
+ _render() {
248
+ this._checkCanvasResize();
249
+ this.renderer.render(this.scene, this.camera);
250
+ }
251
+ _checkCanvasResize() {
252
+ const canvas = this.renderer.domElement;
253
+ if (this.canvasElement.nativeElement.clientWidth !== canvas.width || this.canvasElement.nativeElement.clientHeight !== canvas.height) {
254
+ this._updateWindowSize();
255
+ }
256
+ }
257
+ _updateWindowSize() {
258
+ this._resizeRendererToDisplaySize();
259
+ const canvas = this.renderer.domElement;
260
+ const aspect = canvas.width / canvas.height;
261
+ this.camera.aspect = aspect;
262
+ this.camera.updateProjectionMatrix();
263
+ }
264
+ _resizeRendererToDisplaySize() {
265
+ this.renderer.setSize(this.canvasElement.nativeElement.clientWidth, this.canvasElement.nativeElement.clientHeight, false);
266
+ }
267
+ _test() {
268
+ const mat = new three_1.MeshBasicMaterial({ color: 'blue' });
269
+ const geo = new three_1.BoxGeometry(1, 1, 1);
270
+ const mesh = new three_1.Mesh(geo, mat);
271
+ this.scene.add(mesh);
272
+ }
273
+ _loadModel(object) {
274
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
275
+ object.name = this._sku;
276
+ object.visible = true;
277
+ const objectFromScene = this.scene.getObjectByName(this._sku);
278
+ if (objectFromScene) {
279
+ this.scene.remove(objectFromScene);
280
+ }
281
+ this.scene.add(object);
282
+ });
283
+ }
284
+ _initLights() {
285
+ const ambientLight = new three_1.AmbientLight('#595959', 1.2);
286
+ ambientLight.name = 'ambientLight';
287
+ const directional = new three_1.DirectionalLight('white', 1);
288
+ directional.position.set(0, 2, 0);
289
+ directional.castShadow = true;
290
+ const spotLight1 = new three_1.SpotLight('white');
291
+ spotLight1.power = 400;
292
+ spotLight1.decay = 2;
293
+ spotLight1.position.set(-3, 8, -3);
294
+ spotLight1.castShadow = true;
295
+ const spotLight2 = new three_1.SpotLight('white');
296
+ spotLight2.power = 400;
297
+ spotLight2.decay = 2;
298
+ spotLight2.position.set(3, 8, -3);
299
+ spotLight2.castShadow = true;
300
+ const spotLight3 = new three_1.SpotLight('white');
301
+ spotLight3.power = 400;
302
+ spotLight3.decay = 2;
303
+ spotLight3.position.set(-3, 8, 3);
304
+ spotLight3.castShadow = true;
305
+ const spotLight4 = new three_1.SpotLight('white');
306
+ spotLight4.power = 400;
307
+ spotLight4.decay = 2;
308
+ spotLight4.position.set(3, 8, 3);
309
+ spotLight4.castShadow = true;
310
+ const hemiSphere = new three_1.HemisphereLight('white', 'green', 0.15);
311
+ this.scene.add(ambientLight, directional, spotLight1, spotLight2, spotLight3, spotLight4, hemiSphere);
312
+ }
313
+ }
314
+ exports.AppComponent = AppComponent;
315
+ AppComponent.ɵfac = function AppComponent_Factory(t) { return new (t || AppComponent)(i0.ɵɵdirectiveInject(i1.Builder)); };
316
+ AppComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: AppComponent, selectors: [["app-root"]], viewQuery: function AppComponent_Query(rf, ctx) { if (rf & 1) {
317
+ i0.ɵɵviewQuery(_c0, 5, core_1.ElementRef);
318
+ } if (rf & 2) {
319
+ let _t;
320
+ i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.canvasElement = _t.first);
321
+ } }, decls: 5, vars: 2, consts: [["type", "button", "value", "Render", 2, "position", "fixed", "top", "10px", "left", "10px", "background-color", "blue", "color", "white", 3, "click"], [1, "canvas"], ["canvas", ""], [3, "selections", "selectionClick", 4, "ngIf"], [3, "selectionTitle", "answers", "answerClick", 4, "ngIf"], [3, "selections", "selectionClick"], [3, "selectionTitle", "answers", "answerClick"]], template: function AppComponent_Template(rf, ctx) { if (rf & 1) {
322
+ i0.ɵɵelementStart(0, "input", 0);
323
+ i0.ɵɵlistener("click", function AppComponent_Template_input_click_0_listener() { return ctx.render(); });
324
+ i0.ɵɵelementEnd();
325
+ i0.ɵɵelement(1, "div", 1, 2);
326
+ i0.ɵɵtemplate(3, AppComponent_selections_3_Template, 1, 1, "selections", 3);
327
+ i0.ɵɵtemplate(4, AppComponent_answers_4_Template, 1, 2, "answers", 4);
328
+ } if (rf & 2) {
329
+ i0.ɵɵadvance(3);
330
+ i0.ɵɵproperty("ngIf", !ctx.showAnswers);
331
+ i0.ɵɵadvance(1);
332
+ i0.ɵɵproperty("ngIf", ctx.showAnswers);
333
+ } }, directives: [i2.NgIf, i3.SelectionsComponent, i4.AnswersComponent], encapsulation: 2 });
334
+
335
+
336
+ /***/ }),
337
+
338
+ /***/ 36747:
339
+ /*!*******************************!*\
340
+ !*** ./src/app/app.module.ts ***!
341
+ \*******************************/
342
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
343
+
344
+ "use strict";
345
+
346
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
347
+ exports.AppModule = void 0;
348
+ const tslib_1 = __webpack_require__(/*! tslib */ 42321);
349
+ const app_component_1 = __webpack_require__(/*! ./app.component */ 55041);
350
+ const common_1 = __webpack_require__(/*! @angular/common */ 54364);
351
+ const animations_1 = __webpack_require__(/*! @angular/platform-browser/animations */ 20718);
352
+ const selections_module_1 = __webpack_require__(/*! ./components/selections/selections.module */ 715);
353
+ const answers_module_1 = __webpack_require__(/*! ./components/answers/answers.module */ 8852);
354
+ const builder_1 = __webpack_require__(/*! ./builder */ 24529);
355
+ const i0 = tslib_1.__importStar(__webpack_require__(/*! @angular/core */ 2316));
356
+ class AppModule {
357
+ }
358
+ exports.AppModule = AppModule;
359
+ AppModule.ɵfac = function AppModule_Factory(t) { return new (t || AppModule)(); };
360
+ AppModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: AppModule, bootstrap: [app_component_1.AppComponent] });
361
+ AppModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
362
+ builder_1.Builder
363
+ ], imports: [[
364
+ animations_1.BrowserAnimationsModule,
365
+ common_1.CommonModule,
366
+ selections_module_1.SelectionsModule,
367
+ answers_module_1.AnswersModule
368
+ ]] });
369
+ (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(AppModule, { declarations: [app_component_1.AppComponent], imports: [animations_1.BrowserAnimationsModule,
370
+ common_1.CommonModule,
371
+ selections_module_1.SelectionsModule,
372
+ answers_module_1.AnswersModule], exports: [app_component_1.AppComponent] }); })();
373
+
374
+
375
+ /***/ }),
376
+
377
+ /***/ 24529:
378
+ /*!****************************!*\
379
+ !*** ./src/app/builder.ts ***!
380
+ \****************************/
381
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
382
+
383
+ "use strict";
384
+
385
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
386
+ exports.Builder = void 0;
387
+ const tslib_1 = __webpack_require__(/*! tslib */ 42321);
388
+ const THREE = tslib_1.__importStar(__webpack_require__(/*! three */ 30712));
389
+ const deco_node_1 = __webpack_require__(/*! @colijnit/configuratorapi/build/model/deco-node */ 67938);
390
+ const selection_1 = __webpack_require__(/*! @colijnit/configuratorapi/build/model/selection */ 58427);
391
+ const deco_node_type_enum_1 = __webpack_require__(/*! @colijnit/configuratorapi/build/enum/deco-node-type.enum */ 63447);
392
+ const threed_utils_1 = __webpack_require__(/*! ../utils/threed.utils */ 22674);
393
+ const deco_node_kind_enum_1 = __webpack_require__(/*! @colijnit/configuratorapi/build/enum/deco-node-kind.enum */ 92348);
394
+ const scene_utils_1 = __webpack_require__(/*! ../utils/scene-utils */ 78606);
395
+ const variation_helper_1 = __webpack_require__(/*! ../helper/variation-helper */ 41086);
396
+ const article_1 = __webpack_require__(/*! @colijnit/configuratorapi/build/model/article */ 64578);
397
+ const configurator_service_1 = __webpack_require__(/*! ./services/configurator.service */ 13965);
398
+ const rxjs_1 = __webpack_require__(/*! rxjs */ 67740);
399
+ const image_utils_1 = __webpack_require__(/*! ../utils/image.utils */ 22700);
400
+ const object_utils_1 = __webpack_require__(/*! ./utils/object.utils */ 30609);
401
+ const node_type_enum_1 = __webpack_require__(/*! @colijnit/configuratorapi/build/enum/node-type.enum */ 3085);
402
+ const business_object_factory_1 = __webpack_require__(/*! @colijnit/ioneconnector/build/service/business-object-factory */ 47124);
403
+ const i0 = tslib_1.__importStar(__webpack_require__(/*! @angular/core */ 2316));
404
+ class Builder {
405
+ constructor() {
406
+ this.selectionsReceived = new rxjs_1.BehaviorSubject([]);
407
+ this.articleLoaded = new rxjs_1.BehaviorSubject(undefined);
408
+ this.decosReceived = new rxjs_1.BehaviorSubject([]);
409
+ this.answersReceived = new rxjs_1.BehaviorSubject([]);
410
+ this.modelLoaded = new rxjs_1.BehaviorSubject(null);
411
+ this._selections = [];
412
+ this._answers = [];
413
+ this._decos = [];
414
+ this._placedAdjustables = [];
415
+ this._placedAddables = [];
416
+ this._adjustables = [];
417
+ this._addables = [];
418
+ this._imageCache = new Map();
419
+ this._articleCache = new Map();
420
+ }
421
+ set debug(value) {
422
+ if (value) {
423
+ this._debug = value;
424
+ if (this._variationHelper) {
425
+ this._variationHelper.debug = this._debug;
426
+ }
427
+ }
428
+ }
429
+ get debug() {
430
+ return this._debug;
431
+ }
432
+ init(scene, options) {
433
+ this._boFactory = new business_object_factory_1.BusinessObjectFactory();
434
+ this._threedUtils = new threed_utils_1.ThreedUtils();
435
+ this._variationHelper = new variation_helper_1.VariationHelper();
436
+ this._variationHelper.debug = this._debug;
437
+ if (!scene) {
438
+ throw 'No scene object provided!';
439
+ }
440
+ this._configuratorService = new configurator_service_1.ConfiguratorService();
441
+ // this._imageCacheService = new ImageCacheService();
442
+ if (options) {
443
+ this._configuratorService.initApi(options);
444
+ }
445
+ this._scene = scene;
446
+ }
447
+ buildModel(sku, instanceId, goodId) {
448
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
449
+ if (!this._scene) {
450
+ return;
451
+ }
452
+ try {
453
+ yield this._setInstanceId(sku, instanceId, goodId);
454
+ yield this._prepareConfiguration(this._sku, this._goodId);
455
+ if (this._source) {
456
+ yield this._configuratorService.setInstanceToConfigure(this._instanceId);
457
+ const promises = [];
458
+ this._reset();
459
+ promises.push(this.getQuestionAndAnswers());
460
+ promises.push(this._getSelections(this._instanceId));
461
+ promises.push(this._getDecos());
462
+ yield Promise.all(promises);
463
+ if (this._answers.length > 0) {
464
+ return;
465
+ }
466
+ this._linkSelectionsAndDecos();
467
+ this._prepareTheSelections();
468
+ this._preloadMaterials();
469
+ const build = yield this._build();
470
+ return build;
471
+ }
472
+ else {
473
+ throw 'GLB source not found!';
474
+ }
475
+ }
476
+ catch (e) {
477
+ throw e;
478
+ }
479
+ });
480
+ }
481
+ buildModelFromData(selections, decos, assetUrl, cdnUrl, schema) {
482
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
483
+ return new Promise((resolve, reject) => tslib_1.__awaiter(this, void 0, void 0, function* () {
484
+ if (!this._scene) {
485
+ reject('no scene provided!');
486
+ }
487
+ try {
488
+ this._log('start build');
489
+ yield this._downloadAsset(assetUrl, cdnUrl, schema);
490
+ if (selections && selections.length > 1 && decos && decos.length > 0 && this._source) {
491
+ this._reset();
492
+ this._selections = selections;
493
+ this._decos = decos;
494
+ this._linkSelectionsAndDecos();
495
+ this._prepareTheSelections();
496
+ this._preloadMaterials();
497
+ const build = yield this._build();
498
+ this._cleanUp();
499
+ this._log('finish build');
500
+ resolve(build);
501
+ }
502
+ else {
503
+ reject('Unsufficient data provided!');
504
+ }
505
+ }
506
+ catch (e) {
507
+ reject(e);
508
+ }
509
+ }));
510
+ });
511
+ }
512
+ initNodeInstance(goodId) {
513
+ return this._configuratorService.initNodeInstance(goodId);
514
+ }
515
+ destroy() {
516
+ this._threedUtils.clearCache();
517
+ this._variationHelper.clearCache();
518
+ }
519
+ selectSelection(selection) {
520
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
521
+ yield this._configuratorService.selectSelection(selection, false);
522
+ yield this.getQuestionAndAnswers();
523
+ });
524
+ }
525
+ getQuestionAndAnswers(publicationCode) {
526
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
527
+ const questionsAndAnswers = yield this._configuratorService.getQuestionAndAnswers(false, publicationCode);
528
+ this._answers = questionsAndAnswers.answers;
529
+ this.answersReceived.next(questionsAndAnswers.answers);
530
+ });
531
+ }
532
+ selectAnswer(answer) {
533
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
534
+ yield this._configuratorService.selectAnswer(answer, false);
535
+ yield this.getQuestionAndAnswers();
536
+ if (this._answers.length === 0) {
537
+ this._build();
538
+ }
539
+ });
540
+ }
541
+ getImageForSelectionOrAnswer(object) {
542
+ const includeMimeType = true, thumb = true;
543
+ return new Promise((resolve, reject) => {
544
+ if (object && object.nodeId) {
545
+ if (!this._imageCache.has(object.nodeId)) {
546
+ return this._configuratorService.getSingleImage(object.nodeId, 4, includeMimeType, thumb, true)
547
+ .then((responseData) => {
548
+ const base64 = this._handleResponseData(includeMimeType, thumb, responseData);
549
+ this._imageCache.set(object.nodeId, base64);
550
+ resolve(base64);
551
+ }).catch(() => {
552
+ reject();
553
+ });
554
+ }
555
+ else {
556
+ resolve(this._imageCache.get(object.nodeId));
557
+ }
558
+ }
559
+ else {
560
+ reject();
561
+ }
562
+ });
563
+ }
564
+ _cleanUp() {
565
+ this._sku = undefined;
566
+ this._goodId = undefined;
567
+ this._instanceId = undefined;
568
+ this._variationHelper.clearCache();
569
+ }
570
+ _handleResponseData(includeMimetype, thumb, responseData) {
571
+ if (responseData && responseData.resultObject) {
572
+ if (responseData.resultObject.filePath !== null && responseData.resultObject.filePath !== "") {
573
+ return image_utils_1.ImageUtils.getFixedImageFilepathUrl(responseData.resultObject.filePath);
574
+ }
575
+ else {
576
+ if (includeMimetype) {
577
+ return image_utils_1.ImageUtils.getDocBodyWithMimeTypeDefinition(responseData.resultObject.fileName, thumb ? responseData.resultObject.thumbnailBody : responseData.resultObject.documentBody);
578
+ }
579
+ else {
580
+ return thumb ? responseData.resultObject.thumbnailBody : responseData.resultObject.documentBody;
581
+ }
582
+ }
583
+ }
584
+ else {
585
+ return '';
586
+ }
587
+ }
588
+ _preloadMaterials() {
589
+ this._variationHelper.preloadVariations(this._decos
590
+ .filter(d => d.gameObjectName && d.type === deco_node_type_enum_1.DecoNodeType.Variation)
591
+ .map(d => d.gameObjectName));
592
+ }
593
+ _setInstanceId(sku, instanceId, goodId) {
594
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
595
+ if (!instanceId && !this._instanceId) {
596
+ if (!goodId) {
597
+ goodId = yield this._getGoodIdFromSku(sku);
598
+ }
599
+ this._goodId = goodId;
600
+ const result = yield this.initNodeInstance(this._goodId);
601
+ if (result && result.resultObject) {
602
+ this._instanceId = result.resultObject;
603
+ }
604
+ else {
605
+ throw 'Failed to initialize node instance';
606
+ }
607
+ }
608
+ else if (!this._instanceId) {
609
+ this._instanceId = instanceId;
610
+ }
611
+ if (!this._sku) {
612
+ this._sku = sku;
613
+ }
614
+ });
615
+ }
616
+ _prepareConfiguration(sku, goodId) {
617
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
618
+ const article = yield this._getArticle(sku, goodId);
619
+ if (article && article.assetUrl) {
620
+ if (article.contentDeliveryUrl) {
621
+ this._variationHelper.assetPath =
622
+ article.contentDeliveryUrl +
623
+ (article.contentDeliveryUrl.endsWith('/') ? '' : '/') +
624
+ (article.distSchema ? article.distSchema : 'UP_DBA');
625
+ }
626
+ yield this._downloadAsset(article.assetUrl, article.contentDeliveryUrl, article.distSchema);
627
+ }
628
+ });
629
+ }
630
+ _downloadAsset(assetUrl, cdnUrl, schema) {
631
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
632
+ this._source = yield this._threedUtils.download3DSource(assetUrl, cdnUrl)
633
+ .catch((error) => {
634
+ throw error;
635
+ });
636
+ if (cdnUrl) {
637
+ this._variationHelper.assetPath =
638
+ cdnUrl +
639
+ (cdnUrl.endsWith('/') ? '' : '/') +
640
+ (schema ? schema : 'UP_DBA');
641
+ }
642
+ });
643
+ }
644
+ _build() {
645
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
646
+ const adjustables = this._getAdjustables();
647
+ if (adjustables && adjustables.length === 0 && this._selections && this._selections.length > 0) { // check if article has a gameObject
648
+ if (this._selections[0].nodeType === node_type_enum_1.NodeType.Article && this._selections[0].gameObject) {
649
+ adjustables.push(this._selections[0]);
650
+ }
651
+ }
652
+ if (adjustables && adjustables.length > 0) {
653
+ const obj = new THREE.Object3D();
654
+ obj.visible = false; // no need to render visualy
655
+ this._scene.add(obj);
656
+ let connected = false;
657
+ this._log('build main model');
658
+ for (let i = 0, len = adjustables.length; i < len; i++) {
659
+ const adjustable = this._createAdjustable(obj, adjustables[i]);
660
+ if (adjustable) {
661
+ for (let ii = 0, lenii = this._placedAdjustables.length; ii < lenii; ii++) {
662
+ if (scene_utils_1.SceneUtils.TrySelectorConnection(this._scene, obj, this._placedAdjustables[ii], adjustable, i === 1)) {
663
+ this._placedAdjustables[ii].visible = true;
664
+ adjustable.visible = true;
665
+ connected = true;
666
+ break;
667
+ }
668
+ connected = false;
669
+ }
670
+ }
671
+ if (!connected && this._placedAdjustables.length > 1) {
672
+ console.warn('No connection found for: ', adjustable.name);
673
+ }
674
+ }
675
+ this._log('place addables');
676
+ this._placeAddables(obj);
677
+ this._log('update pivot');
678
+ this._updatePivot(obj);
679
+ this._log('load variations');
680
+ yield this._loadVariations(obj);
681
+ // this._variationHelper.clearCache();
682
+ this._log('remove from scene');
683
+ this._scene.remove(obj);
684
+ object_utils_1.ObjectUtils.DisposeObject(this._source);
685
+ // this._cleanUp();
686
+ this._log('ready!');
687
+ this.modelLoaded.next(obj);
688
+ return obj;
689
+ }
690
+ else {
691
+ throw 'No adjustables found!';
692
+ // this._building = false;
693
+ // if (this.selections.length < 2) {
694
+ // this._errorService.addError(this.activeInstance, {message: 'NO_SELECTIONS_OR_DECOS', description: 'NO_SELECTIONS_OR_DECOS_INFO'});
695
+ // this.buildFinished.next({instanceId: this.activeInstance, resultType: ResultType.NoSelections});
696
+ // } else if (this.decos.size === 0) {
697
+ // this._errorService.addError(this.activeInstance, {message: 'NO_SELECTIONS_OR_DECOS', description: 'NO_SELECTIONS_OR_DECOS_INFO'});
698
+ // this.buildFinished.next({instanceId: this.activeInstance, resultType: ResultType.NoDecoNodes});
699
+ // } else {
700
+ // this._errorService.addError(this.activeInstance, {message: 'NO_ADJUSTABLES', description: 'NO_ADJUSTABLES_INFO'});
701
+ // this.buildFinished.next({instanceId: this.activeInstance, resultType: ResultType.NoAdjustables});
702
+ // }
703
+ }
704
+ });
705
+ }
706
+ _prepareTheSelections() {
707
+ const selections = this._selections.slice();
708
+ const selectionOfArticle = selections.find(s => s.nodeType === node_type_enum_1.NodeType.Article);
709
+ const adjustableSelections = selections.filter(s => s.addAdjust === '2');
710
+ const isArticleWithMaterial = adjustableSelections.length === 0 &&
711
+ selectionOfArticle.gameObject &&
712
+ selectionOfArticle.gameObject.length > 0;
713
+ // get generic variations
714
+ const globalVariations = this._selections
715
+ .filter(s => (s.generic || adjustableSelections.length === 1) && s.decoNode.variation && !s.decoNode.type)
716
+ .map((value, index, array) => {
717
+ // find selection of variation
718
+ const sel = this._selections.find(s => s.artNodeIdDeco === value.decoNode.variation.parentId);
719
+ if (sel) {
720
+ value.decoNode.variation.supplierArticleNr = sel.supplierArticleNr;
721
+ }
722
+ value.decoNode.variation.materialId = this._getMaterialIdFromParent(value.node);
723
+ return value.decoNode.variation;
724
+ });
725
+ // commented out for the moment
726
+ // globalVariations.forEach(g => {
727
+ // const parentIdx = selections.findIndex(s => s.decoNode && s.decoNode.id === g.parentId);
728
+ // if (parentIdx) { // remove parent selection
729
+ // selections.splice(parentIdx, 1);
730
+ // }
731
+ // const idx = selections.findIndex(s => s.decoNode && s.decoNode.id === g.id);
732
+ // if (idx) { // move generic variations to top
733
+ // const selection = selections[idx];
734
+ // selections.splice(idx, 1);
735
+ // selections.unshift(selection);
736
+ // }
737
+ // });
738
+ // const usedVariations: FurniturePartVariation[] = [];
739
+ let globalVariationsRewrite = true;
740
+ const len = selections.length;
741
+ let lastAdded;
742
+ let lastAdjustable;
743
+ let newPart = false;
744
+ let previousPresLevel = -1;
745
+ let positioning;
746
+ let optionText;
747
+ for (let i = 0; i < len; i++) {
748
+ const selection = selections[i];
749
+ if (selection.presentationLevel === 1) {
750
+ positioning = selection.hdecoPositioning;
751
+ optionText = selection.question;
752
+ }
753
+ if (selection.presentationLevel > previousPresLevel) {
754
+ selection.hdecoPositioning = selection.hdecoPositioning || positioning;
755
+ }
756
+ if (selection.decoNode) {
757
+ if (selection.decoNode.type === deco_node_type_enum_1.DecoNodeType.Variation) {
758
+ const decoNode = selection.decoNode;
759
+ decoNode.optionText = optionText;
760
+ // find selection of variation and set materialId in case of multimaterial
761
+ decoNode.materialId = this._getMaterialIdFromParent(decoNode.nodeId);
762
+ if (lastAdded) {
763
+ if (newPart) {
764
+ if (decoNode.materialId) {
765
+ if (!lastAdded.variations.find(v => v.id === decoNode.id)) {
766
+ lastAdded.variations.push(decoNode);
767
+ }
768
+ }
769
+ else {
770
+ lastAdded.variations = [decoNode];
771
+ }
772
+ }
773
+ else {
774
+ if (!lastAdded.variations.find(v => v.id === decoNode.id)) {
775
+ lastAdded.variations.push(decoNode);
776
+ }
777
+ }
778
+ newPart = false;
779
+ }
780
+ else {
781
+ if (globalVariationsRewrite) {
782
+ globalVariations.length = 0;
783
+ globalVariationsRewrite = false;
784
+ }
785
+ if (!globalVariations.find(v => v.id === decoNode.id)) {
786
+ globalVariations.push(decoNode);
787
+ }
788
+ }
789
+ // const variation: FurniturePartVariation = new FurniturePartVariation();
790
+ // variation.BrandId = selection.decoNode.brandId;
791
+ // variation.Description = selection.decoNode.gameObjectName;
792
+ // variation.MaterialId = (selection.decoNode as any).materialId;
793
+ // variation.SupplierArticleNr = (selection.decoNode as any).supplierArticleNr;
794
+ // usedVariations.push(variation);
795
+ }
796
+ else if ((selection.decoNode.type === deco_node_type_enum_1.DecoNodeType.Part &&
797
+ typeof selection.decoNode.gameObjectName === 'string' &&
798
+ selection.decoNode.gameObjectName.length) || (isArticleWithMaterial)) {
799
+ if (selection.decoNode.kind === deco_node_kind_enum_1.DecoNodeKind.Adjustable || (isArticleWithMaterial)) {
800
+ selection.variations = globalVariations;
801
+ this._adjustables.push(selection);
802
+ if (!lastAdded || (lastAdded.nodeId !== selection.nodeId || lastAdded.node !== selection.node)) {
803
+ newPart = true;
804
+ }
805
+ lastAdded = selection;
806
+ lastAdjustable = selection;
807
+ }
808
+ else if (selection.decoNode.kind === deco_node_kind_enum_1.DecoNodeKind.Addable) {
809
+ selection.variations = lastAdjustable ? lastAdjustable.variations : globalVariations;
810
+ if (lastAdjustable) {
811
+ lastAdjustable.addables.push(selection);
812
+ }
813
+ this._addables.push(selection);
814
+ if (!lastAdded || (lastAdded.nodeId !== selection.nodeId || lastAdded.node !== selection.node)) {
815
+ newPart = true;
816
+ }
817
+ lastAdded = selection;
818
+ }
819
+ }
820
+ }
821
+ previousPresLevel = selection.presentationLevel;
822
+ }
823
+ // this._upsertFurniture(this.activeInstance,
824
+ // {Variations: usedVariations});
825
+ }
826
+ /**
827
+ * Returns the materialId of the parent up the tree until presentionlevel 1 is reached
828
+ * @param id
829
+ * @private
830
+ */
831
+ _getMaterialIdFromParent(id) {
832
+ const idx = this._selections.findIndex(s => s.node === id);
833
+ let currentLevel = 999;
834
+ if (idx > -1) {
835
+ for (let i = idx; i > 0; i--) {
836
+ const selection = this._selections[i];
837
+ if (selection.presentationLevel >= currentLevel) {
838
+ break;
839
+ }
840
+ currentLevel = selection.presentationLevel;
841
+ if (selection.hdecoGameObject) {
842
+ return selection.hdecoGameObject;
843
+ }
844
+ }
845
+ }
846
+ return undefined;
847
+ }
848
+ _createAdjustable(parent, adj) {
849
+ let obj = this._source ? this._source.getObjectByName(adj.decoNode.gameObjectName || adj.gameObject) : null;
850
+ if (!obj) {
851
+ // in case of glb files, the importer removes dots from names
852
+ const name = adj.decoNode.gameObjectName.replace(/[.]/g, '');
853
+ obj = this._source ? this._source.getObjectByName(name) : null;
854
+ if (!obj) {
855
+ console.warn(`No object with name ${adj.decoNode.gameObjectName} found!`);
856
+ return null;
857
+ }
858
+ }
859
+ let adjustable = obj.clone();
860
+ adjustable.name = this._createUniqueName(parent, obj);
861
+ adjustable.userData.selection = adj;
862
+ adjustable.position.set(0, 0, 0);
863
+ adjustable.traverse(c => {
864
+ c.visible = !c.name.toLowerCase().startsWith('c_');
865
+ });
866
+ parent.add(adjustable);
867
+ // the object being added to the customFloorGroup is being recreated so we loose the reference
868
+ // therefor we need to retrieve the created object again
869
+ adjustable = parent.getObjectByName(adjustable.name);
870
+ this._placedAdjustables.push(adjustable);
871
+ return adjustable;
872
+ }
873
+ _createAddable(parent, add, part2, part1) {
874
+ const obj = this._source.getObjectByName(add.decoNode.gameObjectName);
875
+ if (!obj) {
876
+ return null;
877
+ }
878
+ // const selection: Selection = this._getSelectionFromId(adj.artNodeIdDeco);
879
+ const addable = obj.clone();
880
+ addable.name = this._createUniqueName(parent, obj);
881
+ addable.userData.selection = add;
882
+ addable.position.set(0, 0, 0);
883
+ addable.visible = true;
884
+ if (part1 && part2) {
885
+ parent.add(addable);
886
+ this._placedAddables.push(addable);
887
+ return addable;
888
+ }
889
+ return addable;
890
+ }
891
+ _placeAddables(parent) {
892
+ const len = this._placedAdjustables.length;
893
+ for (let i = 0; i < len; i++) {
894
+ if (this._placedAdjustables[i].userData.hasOwnProperty('selection') && this._placedAdjustables[i].userData.selection) {
895
+ const adjustableSelection = this._placedAdjustables[i].userData.selection;
896
+ if (adjustableSelection) {
897
+ const lena = adjustableSelection.addables.length;
898
+ let conAddable;
899
+ for (let ia = 0; ia < lena; ia++) {
900
+ scene_utils_1.SceneUtils.TrySelectorConnection(this._scene, parent, this._placedAdjustables[i], adjustableSelection.addables[ia], false, (add, part2, part1) => this._createAddable(parent, add, part2, part1));
901
+ if (conAddable) {
902
+ scene_utils_1.SceneUtils.TrySelectorConnection(this._scene, parent, conAddable, adjustableSelection.addables[ia], false, (add, part2, part1) => this._createAddable(parent, add, part2, part1));
903
+ }
904
+ conAddable = this._placedAddables[this._placedAddables.length - 1];
905
+ }
906
+ }
907
+ }
908
+ }
909
+ }
910
+ _createUniqueName(parent, obj) {
911
+ let iteration = 0;
912
+ let name = obj.name;
913
+ let existingObj = parent.getObjectByName(name);
914
+ while (existingObj) {
915
+ iteration++;
916
+ name = obj.name + (iteration !== 0 ? ('_' + iteration) : '');
917
+ existingObj = parent.getObjectByName(name);
918
+ }
919
+ return name;
920
+ }
921
+ _getGoodIdFromSku(sku) {
922
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
923
+ const response = yield this._configuratorService.getGoodIdFromSku(sku, false);
924
+ if (response.validationResult.success && response.resultObject) {
925
+ return response.resultObject;
926
+ }
927
+ });
928
+ }
929
+ _getArticle(sku, goodId) {
930
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
931
+ if (this._articleCache.has(sku)) {
932
+ this.articleLoaded.next(this._articleCache.get(sku));
933
+ return this._articleCache.get(sku);
934
+ }
935
+ if (!goodId) {
936
+ goodId = yield this._getGoodIdFromSku(sku)
937
+ .catch((error) => {
938
+ throw `Article with sku ${sku} not found!`;
939
+ });
940
+ }
941
+ let article;
942
+ const articleResponse = yield this._configuratorService.getArticleQuickSel(goodId, false);
943
+ if (articleResponse.validationResult.success && articleResponse.resultObject) {
944
+ if (articleResponse.resultObject.hasOwnProperty('oArticle')) {
945
+ const obj = Array.isArray(articleResponse.resultObject['oArticle']) ? articleResponse.resultObject['oArticle'][0] : articleResponse.resultObject['oArticle'];
946
+ article = this._boFactory.makeWithRawBackendData(article_1.Article, obj);
947
+ }
948
+ else {
949
+ article = this._boFactory.makeWithRawBackendData(article_1.Article, articleResponse.resultObject);
950
+ }
951
+ }
952
+ this._articleCache.set(sku, article);
953
+ this.articleLoaded.next(article);
954
+ return article;
955
+ });
956
+ }
957
+ _getSelections(instanceId, publicationCode) {
958
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
959
+ this._selections = [];
960
+ const selectionResponse = yield this._configuratorService.getSelections(false, publicationCode);
961
+ if (selectionResponse.resultObjects && selectionResponse.resultObjects.length > 0) {
962
+ this._selections = this._boFactory.makeBOArrayFromRawBackendDataArray(selection_1.Selection, selectionResponse.resultObjects);
963
+ this._selections.forEach(s => s.instanceId = instanceId);
964
+ // const filtered: Selection[] = this._selections.filter(s => s.nodeType !== NodeType.Article && s.presentationLevel === 1);
965
+ this.selectionsReceived.next(this._selections);
966
+ }
967
+ else {
968
+ throw 'No selections found!';
969
+ }
970
+ });
971
+ }
972
+ _getDecos() {
973
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
974
+ this._decos = [];
975
+ const decosResponse = yield this._configuratorService.getDecos(false);
976
+ if (decosResponse.resultObjects && decosResponse.resultObjects.length > 0) {
977
+ this._decos = this._boFactory.makeBOArrayFromRawBackendDataArray(deco_node_1.DecoNode, decosResponse.resultObjects);
978
+ this.decosReceived.next(this._decos);
979
+ }
980
+ else {
981
+ throw 'No deconodes found!';
982
+ }
983
+ });
984
+ }
985
+ _linkSelectionsAndDecos() {
986
+ const len = this._selections.length;
987
+ for (let i = 0; i < len; i++) {
988
+ // const id: string = this.selections[i].artNodeIdDeco;
989
+ let deco = this._decos.find(d => d.nodeId === this._selections[i].node);
990
+ if (!deco) {
991
+ deco = new deco_node_1.DecoNode();
992
+ }
993
+ if (deco.type !== deco_node_type_enum_1.DecoNodeType.Variation) {
994
+ const variation = this._getVariations().find(v => v.parentId === this._selections[i].artNodeIdDeco);
995
+ if (variation) {
996
+ deco.variation = variation;
997
+ }
998
+ }
999
+ this._selections[i].decoNode = deco;
1000
+ }
1001
+ }
1002
+ _getVariations() {
1003
+ return this._decos.filter((deco) => {
1004
+ return deco.type === deco_node_type_enum_1.DecoNodeType.Variation;
1005
+ });
1006
+ }
1007
+ _loadVariations(obj) {
1008
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
1009
+ this._log('load variation for parts');
1010
+ yield this._variationHelper.loadPart(obj, this._adjustables, true);
1011
+ this._log('load variation for adjustables');
1012
+ yield this._variationHelper.loadVariation(obj, this._adjustables, true);
1013
+ this._log('load variation for addables');
1014
+ yield this._variationHelper.loadVariation(obj, this._addables, true);
1015
+ this._log('load variation clear cache');
1016
+ this._variationHelper.clearCache();
1017
+ this._log('load variations done');
1018
+ });
1019
+ }
1020
+ _getAdjustables() {
1021
+ return this._selections.filter(s => {
1022
+ const node = s.decoNode;
1023
+ return node && node.gameObjectName && node.type === deco_node_type_enum_1.DecoNodeType.Part && node.kind === deco_node_kind_enum_1.DecoNodeKind.Adjustable;
1024
+ });
1025
+ }
1026
+ _updatePivot(obj) {
1027
+ const boundingBox = new THREE.Box3().setFromObject(obj);
1028
+ const bbCenterPivot = new THREE.Vector3();
1029
+ boundingBox.getCenter(bbCenterPivot);
1030
+ const delta = new THREE.Vector3().sub(bbCenterPivot).setY(Math.abs(Math.min(boundingBox.min.y, 0)));
1031
+ obj.children.forEach((child) => {
1032
+ child.position.add(delta);
1033
+ });
1034
+ obj.updateWorldMatrix(false, true);
1035
+ }
1036
+ _reset() {
1037
+ this._placedAddables.length = 0;
1038
+ this._placedAdjustables.length = 0;
1039
+ this._adjustables.length = 0;
1040
+ this._addables.length = 0;
1041
+ // this._prepareTheSelections();
1042
+ }
1043
+ _log(message) {
1044
+ if (this.debug) {
1045
+ this.debug(message);
1046
+ console.log(new Date(), message);
1047
+ }
1048
+ }
1049
+ }
1050
+ exports.Builder = Builder;
1051
+ Builder.ɵfac = function Builder_Factory(t) { return new (t || Builder)(); };
1052
+ Builder.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: Builder, factory: Builder.ɵfac, providedIn: "root" });
1053
+
1054
+
1055
+ /***/ }),
1056
+
1057
+ /***/ 35674:
1058
+ /*!***************************************************************!*\
1059
+ !*** ./src/app/components/answers/answer/answer.component.ts ***!
1060
+ \***************************************************************/
1061
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1062
+
1063
+ "use strict";
1064
+
1065
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
1066
+ exports.AnswerComponent = void 0;
1067
+ const tslib_1 = __webpack_require__(/*! tslib */ 42321);
1068
+ const animations_1 = __webpack_require__(/*! @angular/animations */ 97175);
1069
+ const i0 = tslib_1.__importStar(__webpack_require__(/*! @angular/core */ 2316));
1070
+ const i1 = tslib_1.__importStar(__webpack_require__(/*! ../../../builder */ 24529));
1071
+ const i2 = tslib_1.__importStar(__webpack_require__(/*! @angular/common */ 54364));
1072
+ const i3 = tslib_1.__importStar(__webpack_require__(/*! ../../shared/loader/loader.component */ 98506));
1073
+ function AnswerComponent_rp_loader_4_Template(rf, ctx) { if (rf & 1) {
1074
+ i0.ɵɵelement(0, "rp-loader");
1075
+ } }
1076
+ function AnswerComponent_img_5_Template(rf, ctx) { if (rf & 1) {
1077
+ i0.ɵɵelement(0, "img", 10);
1078
+ } if (rf & 2) {
1079
+ const ctx_r1 = i0.ɵɵnextContext();
1080
+ i0.ɵɵproperty("src", ctx_r1.answer.imageData, i0.ɵɵsanitizeUrl);
1081
+ } }
1082
+ class AnswerComponent {
1083
+ constructor(_builder) {
1084
+ this._builder = _builder;
1085
+ }
1086
+ set showing(value) {
1087
+ this.answer.imageData = '';
1088
+ if (value && this.answer.answer !== 'Skip / Cancel') {
1089
+ this._loadThumbnail(this.answer);
1090
+ }
1091
+ else {
1092
+ this.answer.imageData = null;
1093
+ }
1094
+ }
1095
+ ngOnInit() {
1096
+ }
1097
+ _loadThumbnail(answer) {
1098
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
1099
+ yield this._builder.getImageForSelectionOrAnswer(answer).then((imageSrc) => {
1100
+ answer.imageData = imageSrc === "" ? null : imageSrc;
1101
+ });
1102
+ });
1103
+ }
1104
+ }
1105
+ exports.AnswerComponent = AnswerComponent;
1106
+ AnswerComponent.ɵfac = function AnswerComponent_Factory(t) { return new (t || AnswerComponent)(i0.ɵɵdirectiveInject(i1.Builder)); };
1107
+ AnswerComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: AnswerComponent, selectors: [["answer"]], inputs: { answer: "answer", showing: "showing" }, decls: 10, vars: 4, consts: [[1, "ione-configurator"], [1, "answer-wrapper"], [1, "answer-content"], [1, "answer-thumbnail"], [4, "ngIf"], ["class", "answer-img", 3, "src", 4, "ngIf"], [1, "answer-title-wrapper"], [1, "answer-title", 3, "textContent"], [1, "price"], [1, "price-value"], [1, "answer-img", 3, "src"]], template: function AnswerComponent_Template(rf, ctx) { if (rf & 1) {
1108
+ i0.ɵɵelementStart(0, "div", 0);
1109
+ i0.ɵɵelementStart(1, "div", 1);
1110
+ i0.ɵɵelementStart(2, "div", 2);
1111
+ i0.ɵɵelementStart(3, "div", 3);
1112
+ i0.ɵɵtemplate(4, AnswerComponent_rp_loader_4_Template, 1, 0, "rp-loader", 4);
1113
+ i0.ɵɵtemplate(5, AnswerComponent_img_5_Template, 1, 1, "img", 5);
1114
+ i0.ɵɵelementEnd();
1115
+ i0.ɵɵelementStart(6, "div", 6);
1116
+ i0.ɵɵelement(7, "span", 7);
1117
+ i0.ɵɵelementEnd();
1118
+ i0.ɵɵelementStart(8, "div", 8);
1119
+ i0.ɵɵelement(9, "span", 9);
1120
+ i0.ɵɵelementEnd();
1121
+ i0.ɵɵelementEnd();
1122
+ i0.ɵɵelementEnd();
1123
+ i0.ɵɵelementEnd();
1124
+ } if (rf & 2) {
1125
+ i0.ɵɵadvance(2);
1126
+ i0.ɵɵproperty("@answerAppear", undefined);
1127
+ i0.ɵɵadvance(2);
1128
+ i0.ɵɵproperty("ngIf", ctx.answer.imageData === "");
1129
+ i0.ɵɵadvance(1);
1130
+ i0.ɵɵproperty("ngIf", ctx.answer.imageData !== "" && ctx.answer.imageData !== null);
1131
+ i0.ɵɵadvance(2);
1132
+ i0.ɵɵproperty("textContent", ctx.answer.commercialAnswer);
1133
+ } }, directives: [i2.NgIf, i3.LoaderComponent], styles: [".ione-configurator[_ngcontent-%COMP%] .rp-answers-slideout[_ngcontent-%COMP%] {\n position: absolute;\n top: 0;\n right: 0;\n width: 400px;\n height: -moz-fit-content;\n height: fit-content;\n}\n.ione-configurator[_ngcontent-%COMP%] .answers-title[_ngcontent-%COMP%] {\n margin-left: 10px;\n color: #1a1a1a;\n}\n.ione-configurator[_ngcontent-%COMP%] .answers-container[_ngcontent-%COMP%] {\n height: 100vh;\n overflow-y: scroll;\n}\n.ione-configurator[_ngcontent-%COMP%] .answer-content[_ngcontent-%COMP%] {\n position: relative;\n overflow: hidden;\n cursor: pointer;\n font-size: 12px;\n border: 1px solid lightgray;\n padding: 10px;\n display: flex;\n flex-direction: row;\n border-radius: 3px;\n margin-bottom: 3px;\n box-shadow: 2px 1px rgba(211, 211, 211, 0.5);\n background: white;\n}\n.ione-configurator[_ngcontent-%COMP%] .thumbnail[_ngcontent-%COMP%] {\n width: 54px;\n min-width: 54px;\n height: 54px;\n min-height: 54px;\n border: 1px solid #d3d3d3;\n border-radius: 5px;\n}\n.ione-configurator[_ngcontent-%COMP%] .img-size[_ngcontent-%COMP%] {\n width: 54px;\n min-width: 54px;\n height: 54px;\n min-height: 54px;\n border-radius: 5px;\n}\n.ione-configurator[_ngcontent-%COMP%] .unloaded[_ngcontent-%COMP%] {\n background-color: lightgrey;\n}\n.ione-configurator[_ngcontent-%COMP%] .answer-wrapper[_ngcontent-%COMP%] {\n display: block;\n}\n.ione-configurator[_ngcontent-%COMP%] .answer-title[_ngcontent-%COMP%] {\n font-size: 12px;\n position: relative;\n overflow: hidden;\n cursor: pointer;\n}\n.ione-configurator[_ngcontent-%COMP%] .question[_ngcontent-%COMP%] {\n font-weight: bold;\n color: #1a1a1a;\n}\n.ione-configurator[_ngcontent-%COMP%] .answer[_ngcontent-%COMP%] {\n font-size: 12px;\n font-style: italic;\n margin-top: 3px;\n}\n.ione-configurator[_ngcontent-%COMP%] .collapse-wrapper[_ngcontent-%COMP%] {\n display: block;\n}\n.ione-configurator[_ngcontent-%COMP%] .collapse-content[_ngcontent-%COMP%] {\n display: block;\n}\n.ione-configurator[_ngcontent-%COMP%] .collapse-handle[_ngcontent-%COMP%] {\n position: absolute;\n top: 10px;\n right: 12px;\n border: solid black;\n border-width: 0 3px 3px 0;\n display: inline-block;\n padding: 3px;\n transform: rotate(45deg);\n -webkit-transform: rotate(45deg);\n}\n.ione-configurator[_ngcontent-%COMP%] .collapse-handle.expanded[_ngcontent-%COMP%] {\n transform: rotate(-135deg);\n -webkit-transform: rotate(-135deg);\n}\n.ione-configurator[_ngcontent-%COMP%] .child-selection[_ngcontent-%COMP%] {\n margin-left: 10px;\n display: flex;\n flex-direction: column;\n margin-top: 5px;\n}\n.ione-configurator[_ngcontent-%COMP%] .mat-title[_ngcontent-%COMP%] {\n margin-left: 10px;\n color: #1a1a1a;\n}\n.ione-configurator[_ngcontent-%COMP%] .drawer__header[_ngcontent-%COMP%] {\n height: 48px;\n}\n.ione-configurator[_ngcontent-%COMP%] .rp-selections-summary[_ngcontent-%COMP%] {\n height: -moz-fit-content;\n height: fit-content;\n background: transparent;\n overflow: auto;\n position: absolute;\n top: 0;\n right: 0;\n width: 400px;\n}\n.ione-configurator[_ngcontent-%COMP%] .selections-content[_ngcontent-%COMP%] {\n overflow-y: auto;\n}\n.ione-configurator[_ngcontent-%COMP%] .co-summary-line[_ngcontent-%COMP%] {\n position: relative;\n overflow: hidden;\n cursor: pointer;\n font-size: 12px;\n border: 1px solid lightgray;\n padding: 10px;\n display: flex;\n flex-direction: row;\n border-radius: 3px;\n margin-bottom: 3px;\n box-shadow: 2px 1px rgba(211, 211, 211, 0.5);\n background: white;\n}\n.ione-configurator[_ngcontent-%COMP%] .selection-thumbnail[_ngcontent-%COMP%] {\n width: 54px;\n min-width: 54px;\n height: 54px;\n min-height: 54px;\n border: 1px solid #d3d3d3;\n border-radius: 5px;\n}\n.ione-configurator[_ngcontent-%COMP%] .selection-img[_ngcontent-%COMP%] {\n width: 54px;\n min-width: 54px;\n height: 54px;\n min-height: 54px;\n border-radius: 5px;\n}\n.ione-configurator[_ngcontent-%COMP%] .answer-thumbnail[_ngcontent-%COMP%] {\n width: 54px;\n min-width: 54px;\n height: 54px;\n min-height: 54px;\n border: 1px solid #d3d3d3;\n border-radius: 5px;\n}\n.ione-configurator[_ngcontent-%COMP%] .answer-img[_ngcontent-%COMP%] {\n width: 54px;\n min-width: 54px;\n height: 54px;\n min-height: 54px;\n border-radius: 5px;\n}\n.ione-configurator[_ngcontent-%COMP%] .unloaded[_ngcontent-%COMP%] {\n background-color: lightgrey;\n}\n.ione-configurator[_ngcontent-%COMP%] .titles[_ngcontent-%COMP%] {\n margin-left: 14px;\n align-self: center;\n}\n.ione-configurator[_ngcontent-%COMP%] .title-wrapper[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n}\n.ione-configurator[_ngcontent-%COMP%] .answer-title-wrapper[_ngcontent-%COMP%] {\n text-align: center;\n align-self: center;\n margin-left: 14px;\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNoYXJlZC5zY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNFO0VBQ0Usa0JBQUE7RUFDQSxNQUFBO0VBQ0EsUUFBQTtFQUNBLFl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ogNXB4O1xyXG4gIH1cclxuICAuYW5zd2VyLWltZyB7XHJcbiAgICB3aWR0aDogNTRweDtcclxuICAgIG1pbi13aWR0aDogNTRweDtcclxuICAgIGhlaWdodDogNTRweDtcclxuICAgIG1pbi1oZWlnaHQ6IDU0cHg7XHJcbiAgICBib3JkZXItcmFkaXVzOiA1cHg7XHJcbiAgfVxyXG4gIC51bmxvYWRlZCB7XHJcbiAgICBiYWNrZ3JvdW5kLWNvbG9yOiBsaWdodGdyZXk7XHJcbiAgfVxyXG4gIC50aXRsZXMge1xyXG4gICAgbWFyZ2luLWxlZnQ6IDE0cHg7XHJcbiAgICBhbGlnbi1zZWxmOiBjZW50ZXI7XHJcbiAgfVxyXG4gIC50aXRsZS13cmFwcGVyIHtcclxuICAgIGRpc3BsYXk6IGZsZXg7XHJcbiAgICBmbGV4LWRpcmVjdGlvbjogY29sdW1uO1xyXG4gIH1cclxuICAuYW5zd2VyLXRpdGxlLXdyYXBwZXIge1xyXG4gICAgdGV4dC1hbGlnbjogY2VudGVyO1xyXG4gICAgYWxpZ24tc2VsZjogY2VudGVyO1xyXG4gICAgbWFyZ2luLWxlZnQ6IDE0cHg7XHJcbiAgfVxyXG59XHJcbiJdfQ== */"], data: { animation: [
1134
+ animations_1.trigger('answerAppear', [
1135
+ animations_1.state('void', animations_1.style({ 'background': '#dbdbdb' })),
1136
+ animations_1.state('white', animations_1.style({ 'background': 'white' })),
1137
+ animations_1.transition('void <=> *', animations_1.animate(500))
1138
+ ])
1139
+ ] } });
1140
+
1141
+
1142
+ /***/ }),
1143
+
1144
+ /***/ 84780:
1145
+ /*!*********************************************************!*\
1146
+ !*** ./src/app/components/answers/answers.component.ts ***!
1147
+ \*********************************************************/
1148
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1149
+
1150
+ "use strict";
1151
+
1152
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
1153
+ exports.AnswersComponent = void 0;
1154
+ const tslib_1 = __webpack_require__(/*! tslib */ 42321);
1155
+ const core_1 = __webpack_require__(/*! @angular/core */ 2316);
1156
+ const i0 = tslib_1.__importStar(__webpack_require__(/*! @angular/core */ 2316));
1157
+ const i1 = tslib_1.__importStar(__webpack_require__(/*! ../../directives/visibility-observer-master.directive */ 52966));
1158
+ const i2 = tslib_1.__importStar(__webpack_require__(/*! @angular/common */ 54364));
1159
+ const i3 = tslib_1.__importStar(__webpack_require__(/*! ./answer/answer.component */ 35674));
1160
+ const i4 = tslib_1.__importStar(__webpack_require__(/*! ../../directives/visibility-observer.directive */ 27789));
1161
+ function AnswersComponent_answer_4_Template(rf, ctx) { if (rf & 1) {
1162
+ const _r4 = i0.ɵɵgetCurrentView();
1163
+ i0.ɵɵelementStart(0, "answer", 5, 6);
1164
+ i0.ɵɵlistener("click", function AnswersComponent_answer_4_Template_answer_click_0_listener() { const restoredCtx = i0.ɵɵrestoreView(_r4); const answer_r1 = restoredCtx.$implicit; const ctx_r3 = i0.ɵɵnextContext(); return ctx_r3.answerClick.emit(answer_r1); });
1165
+ i0.ɵɵelementEnd();
1166
+ } if (rf & 2) {
1167
+ const answer_r1 = ctx.$implicit;
1168
+ const _r2 = i0.ɵɵreference(1);
1169
+ i0.ɵɵproperty("answer", answer_r1)("observerEnabled", true)("showing", _r2.isIntersecting);
1170
+ } }
1171
+ class AnswersComponent {
1172
+ constructor() {
1173
+ this.answers = [];
1174
+ this.answerClick = new core_1.EventEmitter();
1175
+ }
1176
+ }
1177
+ exports.AnswersComponent = AnswersComponent;
1178
+ AnswersComponent.ɵfac = function AnswersComponent_Factory(t) { return new (t || AnswersComponent)(); };
1179
+ AnswersComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: AnswersComponent, selectors: [["answers"]], inputs: { answers: "answers", selectionTitle: "selectionTitle" }, outputs: { answerClick: "answerClick" }, decls: 5, vars: 2, consts: [[1, "ione-configurator"], [1, "rp-answers-slideout"], [1, "answers-title", 3, "textContent"], ["visibilityObserverMaster", "", 1, "answers-container"], ["visibilityObserver", "", 3, "answer", "observerEnabled", "showing", "click", 4, "ngFor", "ngForOf"], ["visibilityObserver", "", 3, "answer", "observerEnabled", "showing", "click"], ["intersection", "intersection"]], template: function AnswersComponent_Template(rf, ctx) { if (rf & 1) {
1180
+ i0.ɵɵelementStart(0, "div", 0);
1181
+ i0.ɵɵelementStart(1, "div", 1);
1182
+ i0.ɵɵelement(2, "h2", 2);
1183
+ i0.ɵɵelementStart(3, "div", 3);
1184
+ i0.ɵɵtemplate(4, AnswersComponent_answer_4_Template, 2, 3, "answer", 4);
1185
+ i0.ɵɵelementEnd();
1186
+ i0.ɵɵelementEnd();
1187
+ i0.ɵɵelementEnd();
1188
+ } if (rf & 2) {
1189
+ i0.ɵɵadvance(2);
1190
+ i0.ɵɵproperty("textContent", ctx.selectionTitle);
1191
+ i0.ɵɵadvance(2);
1192
+ i0.ɵɵproperty("ngForOf", ctx.answers);
1193
+ } }, directives: [i1.VisibilityObserverMasterDirective, i2.NgForOf, i3.AnswerComponent, i4.VisibilityObserverDirective], styles: [".ione-configurator[_ngcontent-%COMP%] .rp-answers-slideout[_ngcontent-%COMP%] {\n position: absolute;\n top: 0;\n right: 0;\n width: 400px;\n height: -moz-fit-content;\n height: fit-content;\n}\n.ione-configurator[_ngcontent-%COMP%] .answers-title[_ngcontent-%COMP%] {\n margin-left: 10px;\n color: #1a1a1a;\n}\n.ione-configurator[_ngcontent-%COMP%] .answers-container[_ngcontent-%COMP%] {\n height: 100vh;\n overflow-y: scroll;\n}\n.ione-configurator[_ngcontent-%COMP%] .answer-content[_ngcontent-%COMP%] {\n position: relative;\n overflow: hidden;\n cursor: pointer;\n font-size: 12px;\n border: 1px solid lightgray;\n padding: 10px;\n display: flex;\n flex-direction: row;\n border-radius: 3px;\n margin-bottom: 3px;\n box-shadow: 2px 1px rgba(211, 211, 211, 0.5);\n background: white;\n}\n.ione-configurator[_ngcontent-%COMP%] .thumbnail[_ngcontent-%COMP%] {\n width: 54px;\n min-width: 54px;\n height: 54px;\n min-height: 54px;\n border: 1px solid #d3d3d3;\n border-radius: 5px;\n}\n.ione-configurator[_ngcontent-%COMP%] .img-size[_ngcontent-%COMP%] {\n width: 54px;\n min-width: 54px;\n height: 54px;\n min-height: 54px;\n border-radius: 5px;\n}\n.ione-configurator[_ngcontent-%COMP%] .unloaded[_ngcontent-%COMP%] {\n background-color: lightgrey;\n}\n.ione-configurator[_ngcontent-%COMP%] .answer-wrapper[_ngcontent-%COMP%] {\n display: block;\n}\n.ione-configurator[_ngcontent-%COMP%] .answer-title[_ngcontent-%COMP%] {\n font-size: 12px;\n position: relative;\n overflow: hidden;\n cursor: pointer;\n}\n.ione-configurator[_ngcontent-%COMP%] .question[_ngcontent-%COMP%] {\n font-weight: bold;\n color: #1a1a1a;\n}\n.ione-configurator[_ngcontent-%COMP%] .answer[_ngcontent-%COMP%] {\n font-size: 12px;\n font-style: italic;\n margin-top: 3px;\n}\n.ione-configurator[_ngcontent-%COMP%] .collapse-wrapper[_ngcontent-%COMP%] {\n display: block;\n}\n.ione-configurator[_ngcontent-%COMP%] .collapse-content[_ngcontent-%COMP%] {\n display: block;\n}\n.ione-configurator[_ngcontent-%COMP%] .collapse-handle[_ngcontent-%COMP%] {\n position: absolute;\n top: 10px;\n right: 12px;\n border: solid black;\n border-width: 0 3px 3px 0;\n display: inline-block;\n padding: 3px;\n transform: rotate(45deg);\n -webkit-transform: rotate(45deg);\n}\n.ione-configurator[_ngcontent-%COMP%] .collapse-handle.expanded[_ngcontent-%COMP%] {\n transform: rotate(-135deg);\n -webkit-transform: rotate(-135deg);\n}\n.ione-configurator[_ngcontent-%COMP%] .child-selection[_ngcontent-%COMP%] {\n margin-left: 10px;\n display: flex;\n flex-direction: column;\n margin-top: 5px;\n}\n.ione-configurator[_ngcontent-%COMP%] .mat-title[_ngcontent-%COMP%] {\n margin-left: 10px;\n color: #1a1a1a;\n}\n.ione-configurator[_ngcontent-%COMP%] .drawer__header[_ngcontent-%COMP%] {\n height: 48px;\n}\n.ione-configurator[_ngcontent-%COMP%] .rp-selections-summary[_ngcontent-%COMP%] {\n height: -moz-fit-content;\n height: fit-content;\n background: transparent;\n overflow: auto;\n position: absolute;\n top: 0;\n right: 0;\n width: 400px;\n}\n.ione-configurator[_ngcontent-%COMP%] .selections-content[_ngcontent-%COMP%] {\n overflow-y: auto;\n}\n.ione-configurator[_ngcontent-%COMP%] .co-summary-line[_ngcontent-%COMP%] {\n position: relative;\n overflow: hidden;\n cursor: pointer;\n font-size: 12px;\n border: 1px solid lightgray;\n padding: 10px;\n display: flex;\n flex-direction: row;\n border-radius: 3px;\n margin-bottom: 3px;\n box-shadow: 2px 1px rgba(211, 211, 211, 0.5);\n background: white;\n}\n.ione-configurator[_ngcontent-%COMP%] .selection-thumbnail[_ngcontent-%COMP%] {\n width: 54px;\n min-width: 54px;\n height: 54px;\n min-height: 54px;\n border: 1px solid #d3d3d3;\n border-radius: 5px;\n}\n.ione-configurator[_ngcontent-%COMP%] .selection-img[_ngcontent-%COMP%] {\n width: 54px;\n min-width: 54px;\n height: 54px;\n min-height: 54px;\n border-radius: 5px;\n}\n.ione-configurator[_ngcontent-%COMP%] .answer-thumbnail[_ngcontent-%COMP%] {\n width: 54px;\n min-width: 54px;\n height: 54px;\n min-height: 54px;\n border: 1px solid #d3d3d3;\n border-radius: 5px;\n}\n.ione-configurator[_ngcontent-%COMP%] .answer-img[_ngcontent-%COMP%] {\n width: 54px;\n min-width: 54px;\n height: 54px;\n min-height: 54px;\n border-radius: 5px;\n}\n.ione-configurator[_ngcontent-%COMP%] .unloaded[_ngcontent-%COMP%] {\n background-color: lightgrey;\n}\n.ione-configurator[_ngcontent-%COMP%] .titles[_ngcontent-%COMP%] {\n margin-left: 14px;\n align-self: center;\n}\n.ione-configurator[_ngcontent-%COMP%] .title-wrapper[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n}\n.ione-configurator[_ngcontent-%COMP%] .answer-title-wrapper[_ngcontent-%COMP%] {\n text-align: center;\n align-self: center;\n margin-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cbiAgICB3aWR0aDogNTRweDtcclxuICAgIG1pbi13aWR0aDogNTRweDtcclxuICAgIGhlaWdodDogNTRweDtcclxuICAgIG1pbi1oZWlnaHQ6IDU0cHg7XHJcbiAgICBib3JkZXI6IDFweCBzb2xpZCAjZDNkM2QzO1xyXG4gICAgYm9yZGVyLXJhZGl1czogNXB4O1xyXG4gIH1cclxuICAuYW5zd2VyLWltZyB7XHJcbiAgICB3aWR0aDogNTRweDtcclxuICAgIG1pbi13aWR0aDogNTRweDtcclxuICAgIGhlaWdodDogNTRweDtcclxuICAgIG1pbi1oZWlnaHQ6IDU0cHg7XHJcbiAgICBib3JkZXItcmFkaXVzOiA1cHg7XHJcbiAgfVxyXG4gIC51bmxvYWRlZCB7XHJcbiAgICBiYWNrZ3JvdW5kLWNvbG9yOiBsaWdodGdyZXk7XHJcbiAgfVxyXG4gIC50aXRsZXMge1xyXG4gICAgbWFyZ2luLWxlZnQ6IDE0cHg7XHJcbiAgICBhbGlnbi1zZWxmOiBjZW50ZXI7XHJcbiAgfVxyXG4gIC50aXRsZS13cmFwcGVyIHtcclxuICAgIGRpc3BsYXk6IGZsZXg7XHJcbiAgICBmbGV4LWRpcmVjdGlvbjogY29sdW1uO1xyXG4gIH1cclxuICAuYW5zd2VyLXRpdGxlLXdyYXBwZXIge1xyXG4gICAgdGV4dC1hbGlnbjogY2VudGVyO1xyXG4gICAgYWxpZ24tc2VsZjogY2VudGVyO1xyXG4gICAgbWFyZ2luLWxlZnQ6IDE0cHg7XHJcbiAgfVxyXG59XHJcbiJdfQ== */"] });
1194
+
1195
+
1196
+ /***/ }),
1197
+
1198
+ /***/ 8852:
1199
+ /*!******************************************************!*\
1200
+ !*** ./src/app/components/answers/answers.module.ts ***!
1201
+ \******************************************************/
1202
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1203
+
1204
+ "use strict";
1205
+
1206
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
1207
+ exports.AnswersModule = void 0;
1208
+ const tslib_1 = __webpack_require__(/*! tslib */ 42321);
1209
+ const common_1 = __webpack_require__(/*! @angular/common */ 54364);
1210
+ const answers_component_1 = __webpack_require__(/*! ./answers.component */ 84780);
1211
+ const answer_component_1 = __webpack_require__(/*! ./answer/answer.component */ 35674);
1212
+ const visibility_observer_directive_1 = __webpack_require__(/*! ../../directives/visibility-observer.directive */ 27789);
1213
+ const visibility_observer_master_directive_1 = __webpack_require__(/*! ../../directives/visibility-observer-master.directive */ 52966);
1214
+ const shared_module_1 = __webpack_require__(/*! ../shared/shared.module */ 4065);
1215
+ const i0 = tslib_1.__importStar(__webpack_require__(/*! @angular/core */ 2316));
1216
+ class AnswersModule {
1217
+ }
1218
+ exports.AnswersModule = AnswersModule;
1219
+ AnswersModule.ɵfac = function AnswersModule_Factory(t) { return new (t || AnswersModule)(); };
1220
+ AnswersModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: AnswersModule });
1221
+ AnswersModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [[
1222
+ common_1.CommonModule,
1223
+ shared_module_1.SharedModule
1224
+ ]] });
1225
+ (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(AnswersModule, { declarations: [answers_component_1.AnswersComponent,
1226
+ answer_component_1.AnswerComponent,
1227
+ visibility_observer_directive_1.VisibilityObserverDirective,
1228
+ visibility_observer_master_directive_1.VisibilityObserverMasterDirective], imports: [common_1.CommonModule,
1229
+ shared_module_1.SharedModule], exports: [answers_component_1.AnswersComponent] }); })();
1230
+
1231
+
1232
+ /***/ }),
1233
+
1234
+ /***/ 42226:
1235
+ /*!***************************************************************!*\
1236
+ !*** ./src/app/components/selections/selections.component.ts ***!
1237
+ \***************************************************************/
1238
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1239
+
1240
+ "use strict";
1241
+
1242
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
1243
+ exports.SelectionsComponent = void 0;
1244
+ const tslib_1 = __webpack_require__(/*! tslib */ 42321);
1245
+ const core_1 = __webpack_require__(/*! @angular/core */ 2316);
1246
+ const animations_1 = __webpack_require__(/*! @angular/animations */ 97175);
1247
+ const i0 = tslib_1.__importStar(__webpack_require__(/*! @angular/core */ 2316));
1248
+ const i1 = tslib_1.__importStar(__webpack_require__(/*! ../../builder */ 24529));
1249
+ const i2 = tslib_1.__importStar(__webpack_require__(/*! @angular/common */ 54364));
1250
+ const i3 = tslib_1.__importStar(__webpack_require__(/*! ../shared/loader/loader.component */ 98506));
1251
+ function SelectionsComponent_ng_container_5_rp_loader_3_Template(rf, ctx) { if (rf & 1) {
1252
+ i0.ɵɵelement(0, "rp-loader");
1253
+ } }
1254
+ function SelectionsComponent_ng_container_5_img_4_Template(rf, ctx) { if (rf & 1) {
1255
+ i0.ɵɵelement(0, "img", 19);
1256
+ } if (rf & 2) {
1257
+ const selectionViewModel_r1 = i0.ɵɵnextContext().$implicit;
1258
+ i0.ɵɵproperty("src", selectionViewModel_r1.thumbnail, i0.ɵɵsanitizeUrl);
1259
+ } }
1260
+ function SelectionsComponent_ng_container_5_div_9_div_1_Template(rf, ctx) { if (rf & 1) {
1261
+ const _r10 = i0.ɵɵgetCurrentView();
1262
+ i0.ɵɵelementStart(0, "div", 21);
1263
+ i0.ɵɵlistener("click", function SelectionsComponent_ng_container_5_div_9_div_1_Template_div_click_0_listener($event) { const restoredCtx = i0.ɵɵrestoreView(_r10); const selection_r8 = restoredCtx.$implicit; const ctx_r9 = i0.ɵɵnextContext(3); return ctx_r9.selectSelection(selection_r8, $event); });
1264
+ i0.ɵɵelement(1, "label", 12);
1265
+ i0.ɵɵelement(2, "span", 13);
1266
+ i0.ɵɵelementEnd();
1267
+ } if (rf & 2) {
1268
+ const selection_r8 = ctx.$implicit;
1269
+ i0.ɵɵadvance(1);
1270
+ i0.ɵɵproperty("textContent", selection_r8.commercialQuestion);
1271
+ i0.ɵɵadvance(1);
1272
+ i0.ɵɵproperty("textContent", selection_r8.answer);
1273
+ } }
1274
+ function SelectionsComponent_ng_container_5_div_9_Template(rf, ctx) { if (rf & 1) {
1275
+ i0.ɵɵelementStart(0, "div");
1276
+ i0.ɵɵtemplate(1, SelectionsComponent_ng_container_5_div_9_div_1_Template, 3, 2, "div", 20);
1277
+ i0.ɵɵelementEnd();
1278
+ } if (rf & 2) {
1279
+ const selectionViewModel_r1 = i0.ɵɵnextContext().$implicit;
1280
+ i0.ɵɵproperty("@showHideChildren", undefined);
1281
+ i0.ɵɵadvance(1);
1282
+ i0.ɵɵproperty("ngForOf", selectionViewModel_r1.children);
1283
+ } }
1284
+ function SelectionsComponent_ng_container_5_div_14_Template(rf, ctx) { if (rf & 1) {
1285
+ const _r14 = i0.ɵɵgetCurrentView();
1286
+ i0.ɵɵelementStart(0, "div", 22);
1287
+ i0.ɵɵlistener("click", function SelectionsComponent_ng_container_5_div_14_Template_div_click_0_listener($event) { i0.ɵɵrestoreView(_r14); const selectionViewModel_r1 = i0.ɵɵnextContext().$implicit; const ctx_r12 = i0.ɵɵnextContext(); return ctx_r12.expandClicked(selectionViewModel_r1, $event); });
1288
+ i0.ɵɵelementEnd();
1289
+ } if (rf & 2) {
1290
+ const selectionViewModel_r1 = i0.ɵɵnextContext().$implicit;
1291
+ i0.ɵɵclassProp("expanded", selectionViewModel_r1.expanded);
1292
+ } }
1293
+ function SelectionsComponent_ng_container_5_Template(rf, ctx) { if (rf & 1) {
1294
+ const _r17 = i0.ɵɵgetCurrentView();
1295
+ i0.ɵɵelementContainerStart(0);
1296
+ i0.ɵɵelementStart(1, "div", 6);
1297
+ i0.ɵɵlistener("click", function SelectionsComponent_ng_container_5_Template_div_click_1_listener($event) { const restoredCtx = i0.ɵɵrestoreView(_r17); const selectionViewModel_r1 = restoredCtx.$implicit; const ctx_r16 = i0.ɵɵnextContext(); return ctx_r16.selectSelection(selectionViewModel_r1.selection, $event); });
1298
+ i0.ɵɵelementStart(2, "div", 7);
1299
+ i0.ɵɵtemplate(3, SelectionsComponent_ng_container_5_rp_loader_3_Template, 1, 0, "rp-loader", 8);
1300
+ i0.ɵɵtemplate(4, SelectionsComponent_ng_container_5_img_4_Template, 1, 1, "img", 9);
1301
+ i0.ɵɵelementEnd();
1302
+ i0.ɵɵelementStart(5, "div", 10);
1303
+ i0.ɵɵelementStart(6, "div", 11);
1304
+ i0.ɵɵelement(7, "label", 12);
1305
+ i0.ɵɵelement(8, "span", 13);
1306
+ i0.ɵɵtemplate(9, SelectionsComponent_ng_container_5_div_9_Template, 2, 2, "div", 8);
1307
+ i0.ɵɵelementEnd();
1308
+ i0.ɵɵelementEnd();
1309
+ i0.ɵɵelementStart(10, "div", 14);
1310
+ i0.ɵɵelement(11, "span", 15);
1311
+ i0.ɵɵelementEnd();
1312
+ i0.ɵɵelementStart(12, "div", 16);
1313
+ i0.ɵɵelementStart(13, "div", 17);
1314
+ i0.ɵɵtemplate(14, SelectionsComponent_ng_container_5_div_14_Template, 1, 2, "div", 18);
1315
+ i0.ɵɵelementEnd();
1316
+ i0.ɵɵelementEnd();
1317
+ i0.ɵɵelementEnd();
1318
+ i0.ɵɵelementContainerEnd();
1319
+ } if (rf & 2) {
1320
+ const selectionViewModel_r1 = ctx.$implicit;
1321
+ i0.ɵɵadvance(3);
1322
+ i0.ɵɵproperty("ngIf", selectionViewModel_r1.thumbnail === "");
1323
+ i0.ɵɵadvance(1);
1324
+ i0.ɵɵproperty("ngIf", selectionViewModel_r1.thumbnail !== "" && selectionViewModel_r1.thumbnail !== null);
1325
+ i0.ɵɵadvance(3);
1326
+ i0.ɵɵproperty("textContent", selectionViewModel_r1.selection.question);
1327
+ i0.ɵɵadvance(1);
1328
+ i0.ɵɵproperty("textContent", selectionViewModel_r1.selection.answer);
1329
+ i0.ɵɵadvance(1);
1330
+ i0.ɵɵproperty("ngIf", selectionViewModel_r1.children.length > 0 && selectionViewModel_r1.expanded);
1331
+ i0.ɵɵadvance(5);
1332
+ i0.ɵɵproperty("ngIf", selectionViewModel_r1.children.length > 0);
1333
+ } }
1334
+ class SelectionViewModel {
1335
+ constructor() {
1336
+ this.children = [];
1337
+ this.expanded = false;
1338
+ this.thumbnail = '';
1339
+ }
1340
+ }
1341
+ class SelectionsComponent {
1342
+ constructor(_builder) {
1343
+ this._builder = _builder;
1344
+ this.selectionViewModels = [];
1345
+ this.selectionClick = new core_1.EventEmitter();
1346
+ }
1347
+ set selections(value) {
1348
+ this._prepareSelections(value);
1349
+ this._loadThumbnails();
1350
+ }
1351
+ expandClicked(selectionViewModel, mouseEvent) {
1352
+ mouseEvent.preventDefault();
1353
+ mouseEvent.stopImmediatePropagation();
1354
+ selectionViewModel.expanded = !selectionViewModel.expanded;
1355
+ }
1356
+ selectSelection(selection, mouseEvent) {
1357
+ mouseEvent.preventDefault();
1358
+ mouseEvent.stopImmediatePropagation();
1359
+ this.selectionClick.next(selection);
1360
+ }
1361
+ _loadThumbnails() {
1362
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
1363
+ if (this.selectionViewModels.length > 0) {
1364
+ this.selectionViewModels.forEach((viewModel) => tslib_1.__awaiter(this, void 0, void 0, function* () {
1365
+ yield this._builder.getImageForSelectionOrAnswer(viewModel.selection).then((imageSrc) => {
1366
+ viewModel.thumbnail = imageSrc === "" ? null : imageSrc;
1367
+ });
1368
+ }));
1369
+ }
1370
+ });
1371
+ }
1372
+ _prepareSelections(value) {
1373
+ this.selectionViewModels.length = 0;
1374
+ let selectionViewModel;
1375
+ value.forEach(s => {
1376
+ if (s.presentationLevel === 1) {
1377
+ selectionViewModel = new SelectionViewModel();
1378
+ selectionViewModel.selection = s;
1379
+ this.selectionViewModels.push(selectionViewModel);
1380
+ }
1381
+ else if (s.presentationLevel > 1) {
1382
+ if (selectionViewModel) {
1383
+ selectionViewModel.children.push(s);
1384
+ }
1385
+ }
1386
+ });
1387
+ }
1388
+ }
1389
+ exports.SelectionsComponent = SelectionsComponent;
1390
+ SelectionsComponent.ɵfac = function SelectionsComponent_Factory(t) { return new (t || SelectionsComponent)(i0.ɵɵdirectiveInject(i1.Builder)); };
1391
+ SelectionsComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SelectionsComponent, selectors: [["selections"]], inputs: { selections: "selections" }, outputs: { selectionClick: "selectionClick" }, decls: 6, vars: 2, consts: [[1, "ione-configurator"], [1, "rp-selections-summary"], [1, "drawer__header"], [1, "mat-title", 3, "textContent"], [1, "selections-content"], [4, "ngFor", "ngForOf"], [1, "co-summary-line", 3, "click"], [1, "selection-thumbnail"], [4, "ngIf"], ["visibilityObserver", "", "class", "selection-img", 3, "src", 4, "ngIf"], [1, "titles"], [1, "title-wrapper"], [1, "question", 3, "textContent"], [1, "answer", 3, "textContent"], [1, "price-wrapper"], [1, "price-value"], [1, "collapse-wrapper"], [1, "collapse-content"], ["class", "collapse-handle", 3, "expanded", "click", 4, "ngIf"], ["visibilityObserver", "", 1, "selection-img", 3, "src"], ["class", "child-selection", 3, "click", 4, "ngFor", "ngForOf"], [1, "child-selection", 3, "click"], [1, "collapse-handle", 3, "click"]], template: function SelectionsComponent_Template(rf, ctx) { if (rf & 1) {
1392
+ i0.ɵɵelementStart(0, "div", 0);
1393
+ i0.ɵɵelementStart(1, "div", 1);
1394
+ i0.ɵɵelementStart(2, "header", 2);
1395
+ i0.ɵɵelement(3, "h2", 3);
1396
+ i0.ɵɵelementEnd();
1397
+ i0.ɵɵelementStart(4, "div", 4);
1398
+ i0.ɵɵtemplate(5, SelectionsComponent_ng_container_5_Template, 15, 6, "ng-container", 5);
1399
+ i0.ɵɵelementEnd();
1400
+ i0.ɵɵelementEnd();
1401
+ i0.ɵɵelementEnd();
1402
+ } if (rf & 2) {
1403
+ i0.ɵɵadvance(3);
1404
+ i0.ɵɵproperty("textContent", "Configuratie");
1405
+ i0.ɵɵadvance(2);
1406
+ i0.ɵɵproperty("ngForOf", ctx.selectionViewModels);
1407
+ } }, directives: [i2.NgForOf, i2.NgIf, i3.LoaderComponent], styles: [".ione-configurator[_ngcontent-%COMP%] .rp-answers-slideout[_ngcontent-%COMP%] {\n position: absolute;\n top: 0;\n right: 0;\n width: 400px;\n height: -moz-fit-content;\n height: fit-content;\n}\n.ione-configurator[_ngcontent-%COMP%] .answers-title[_ngcontent-%COMP%] {\n margin-left: 10px;\n color: #1a1a1a;\n}\n.ione-configurator[_ngcontent-%COMP%] .answers-container[_ngcontent-%COMP%] {\n height: 100vh;\n overflow-y: scroll;\n}\n.ione-configurator[_ngcontent-%COMP%] .answer-content[_ngcontent-%COMP%] {\n position: relative;\n overflow: hidden;\n cursor: pointer;\n font-size: 12px;\n border: 1px solid lightgray;\n padding: 10px;\n display: flex;\n flex-direction: row;\n border-radius: 3px;\n margin-bottom: 3px;\n box-shadow: 2px 1px rgba(211, 211, 211, 0.5);\n background: white;\n}\n.ione-configurator[_ngcontent-%COMP%] .thumbnail[_ngcontent-%COMP%] {\n width: 54px;\n min-width: 54px;\n height: 54px;\n min-height: 54px;\n border: 1px solid #d3d3d3;\n border-radius: 5px;\n}\n.ione-configurator[_ngcontent-%COMP%] .img-size[_ngcontent-%COMP%] {\n width: 54px;\n min-width: 54px;\n height: 54px;\n min-height: 54px;\n border-radius: 5px;\n}\n.ione-configurator[_ngcontent-%COMP%] .unloaded[_ngcontent-%COMP%] {\n background-color: lightgrey;\n}\n.ione-configurator[_ngcontent-%COMP%] .answer-wrapper[_ngcontent-%COMP%] {\n display: block;\n}\n.ione-configurator[_ngcontent-%COMP%] .answer-title[_ngcontent-%COMP%] {\n font-size: 12px;\n position: relative;\n overflow: hidden;\n cursor: pointer;\n}\n.ione-configurator[_ngcontent-%COMP%] .question[_ngcontent-%COMP%] {\n font-weight: bold;\n color: #1a1a1a;\n}\n.ione-configurator[_ngcontent-%COMP%] .answer[_ngcontent-%COMP%] {\n font-size: 12px;\n font-style: italic;\n margin-top: 3px;\n}\n.ione-configurator[_ngcontent-%COMP%] .collapse-wrapper[_ngcontent-%COMP%] {\n display: block;\n}\n.ione-configurator[_ngcontent-%COMP%] .collapse-content[_ngcontent-%COMP%] {\n display: block;\n}\n.ione-configurator[_ngcontent-%COMP%] .collapse-handle[_ngcontent-%COMP%] {\n position: absolute;\n top: 10px;\n right: 12px;\n border: solid black;\n border-width: 0 3px 3px 0;\n display: inline-block;\n padding: 3px;\n transform: rotate(45deg);\n -webkit-transform: rotate(45deg);\n}\n.ione-configurator[_ngcontent-%COMP%] .collapse-handle.expanded[_ngcontent-%COMP%] {\n transform: rotate(-135deg);\n -webkit-transform: rotate(-135deg);\n}\n.ione-configurator[_ngcontent-%COMP%] .child-selection[_ngcontent-%COMP%] {\n margin-left: 10px;\n display: flex;\n flex-direction: column;\n margin-top: 5px;\n}\n.ione-configurator[_ngcontent-%COMP%] .mat-title[_ngcontent-%COMP%] {\n margin-left: 10px;\n color: #1a1a1a;\n}\n.ione-configurator[_ngcontent-%COMP%] .drawer__header[_ngcontent-%COMP%] {\n height: 48px;\n}\n.ione-configurator[_ngcontent-%COMP%] .rp-selections-summary[_ngcontent-%COMP%] {\n height: -moz-fit-content;\n height: fit-content;\n background: transparent;\n overflow: auto;\n position: absolute;\n top: 0;\n right: 0;\n width: 400px;\n}\n.ione-configurator[_ngcontent-%COMP%] .selections-content[_ngcontent-%COMP%] {\n overflow-y: auto;\n}\n.ione-configurator[_ngcontent-%COMP%] .co-summary-line[_ngcontent-%COMP%] {\n position: relative;\n overflow: hidden;\n cursor: pointer;\n font-size: 12px;\n border: 1px solid lightgray;\n padding: 10px;\n display: flex;\n flex-direction: row;\n border-radius: 3px;\n margin-bottom: 3px;\n box-shadow: 2px 1px rgba(211, 211, 211, 0.5);\n background: white;\n}\n.ione-configurator[_ngcontent-%COMP%] .selection-thumbnail[_ngcontent-%COMP%] {\n width: 54px;\n min-width: 54px;\n height: 54px;\n min-height: 54px;\n border: 1px solid #d3d3d3;\n border-radius: 5px;\n}\n.ione-configurator[_ngcontent-%COMP%] .selection-img[_ngcontent-%COMP%] {\n width: 54px;\n min-width: 54px;\n height: 54px;\n min-height: 54px;\n border-radius: 5px;\n}\n.ione-configurator[_ngcontent-%COMP%] .answer-thumbnail[_ngcontent-%COMP%] {\n width: 54px;\n min-width: 54px;\n height: 54px;\n min-height: 54px;\n border: 1px solid #d3d3d3;\n border-radius: 5px;\n}\n.ione-configurator[_ngcontent-%COMP%] .answer-img[_ngcontent-%COMP%] {\n width: 54px;\n min-width: 54px;\n height: 54px;\n min-height: 54px;\n border-radius: 5px;\n}\n.ione-configurator[_ngcontent-%COMP%] .unloaded[_ngcontent-%COMP%] {\n background-color: lightgrey;\n}\n.ione-configurator[_ngcontent-%COMP%] .titles[_ngcontent-%COMP%] {\n margin-left: 14px;\n align-self: center;\n}\n.ione-configurator[_ngcontent-%COMP%] .title-wrapper[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n}\n.ione-configurator[_ngcontent-%COMP%] .answer-title-wrapper[_ngcontent-%COMP%] {\n text-align: center;\n align-self: center;\n margin-left: 14px;\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNoYXJlZC5zY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNFO0VBQ0Usa0JBQUE7RUFDQSxNQUFBO0VBQ0EsUUFBQTtFQUNBLFlBQUE7RUFDQSx3QkFBQTtFQUFBLG1CQUFBO0FBQUo7QUFFRTtFQUNFLGlCQUFBO0VBQ0EsY0FBQTtBQUFKO0FBRUU7RUFDRSxhQUFBO0VBQ0Esa0JBQUE7QUFBSjtBQUVFO0VBQ0Usa0JBQUE7RUFDQSxnQkFBQTtFQUNBLGVBQUE7RUFDQSxlQUFBO0VBQ0EsMkJBQUE7RUFDQSxhQUFBO0VBQ0EsYUFBQTtFQUNBLG1CQUFBO0VBQ0Esa0JBQUE7RUFDQSxrQkFBQTtFQUNBLDRDQUFBO0VBQ0EsaUJBQUE7QUFBSjtBQUVFO0VBQ0UsV0FBQTtFQUNBLGVBQUE7RUFDQSxZQUFBO0VBQ0EsZ0JBQUE7RUFDQSx5QkFBQTtFQU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GRpc3BsYXk6IGZsZXg7XHJcbiAgICBmbGV4LWRpcmVjdGlvbjogY29sdW1uO1xyXG4gIH1cclxuICAuYW5zd2VyLXRpdGxlLXdyYXBwZXIge1xyXG4gICAgdGV4dC1hbGlnbjogY2VudGVyO1xyXG4gICAgYWxpZ24tc2VsZjogY2VudGVyO1xyXG4gICAgbWFyZ2luLWxlZnQ6IDE0cHg7XHJcbiAgfVxyXG59XHJcbiJdfQ== */"], data: { animation: [
1408
+ animations_1.trigger('showHideChildren', [
1409
+ animations_1.state('void', animations_1.style({ 'height': '0' })),
1410
+ animations_1.state('*', animations_1.style({ 'height': '*' })),
1411
+ animations_1.transition('void <=> *', animations_1.animate(200))
1412
+ ])
1413
+ ] } });
1414
+
1415
+
1416
+ /***/ }),
1417
+
1418
+ /***/ 715:
1419
+ /*!************************************************************!*\
1420
+ !*** ./src/app/components/selections/selections.module.ts ***!
1421
+ \************************************************************/
1422
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1423
+
1424
+ "use strict";
1425
+
1426
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
1427
+ exports.SelectionsModule = void 0;
1428
+ const tslib_1 = __webpack_require__(/*! tslib */ 42321);
1429
+ const common_1 = __webpack_require__(/*! @angular/common */ 54364);
1430
+ const selections_component_1 = __webpack_require__(/*! ./selections.component */ 42226);
1431
+ const shared_module_1 = __webpack_require__(/*! ../shared/shared.module */ 4065);
1432
+ const i0 = tslib_1.__importStar(__webpack_require__(/*! @angular/core */ 2316));
1433
+ class SelectionsModule {
1434
+ }
1435
+ exports.SelectionsModule = SelectionsModule;
1436
+ SelectionsModule.ɵfac = function SelectionsModule_Factory(t) { return new (t || SelectionsModule)(); };
1437
+ SelectionsModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: SelectionsModule });
1438
+ SelectionsModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [[
1439
+ common_1.CommonModule,
1440
+ shared_module_1.SharedModule
1441
+ ]] });
1442
+ (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(SelectionsModule, { declarations: [selections_component_1.SelectionsComponent], imports: [common_1.CommonModule,
1443
+ shared_module_1.SharedModule], exports: [selections_component_1.SelectionsComponent] }); })();
1444
+
1445
+
1446
+ /***/ }),
1447
+
1448
+ /***/ 98506:
1449
+ /*!**************************************************************!*\
1450
+ !*** ./src/app/components/shared/loader/loader.component.ts ***!
1451
+ \**************************************************************/
1452
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1453
+
1454
+ "use strict";
1455
+
1456
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
1457
+ exports.LoaderComponent = void 0;
1458
+ const tslib_1 = __webpack_require__(/*! tslib */ 42321);
1459
+ const i0 = tslib_1.__importStar(__webpack_require__(/*! @angular/core */ 2316));
1460
+ class LoaderComponent {
1461
+ }
1462
+ exports.LoaderComponent = LoaderComponent;
1463
+ LoaderComponent.ɵfac = function LoaderComponent_Factory(t) { return new (t || LoaderComponent)(); };
1464
+ LoaderComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LoaderComponent, selectors: [["rp-loader"]], decls: 5, vars: 0, consts: [[1, "loader-wrapper"], ["xmlns", "http://www.w3.org/2000/svg", "width", "44", "height", "44", "viewBox", "0 0 44 44", "stroke", "#3760a1"], ["fill", "none", "fill-rule", "evenodd", "stroke-width", "3"], ["cx", "22", "cy", "22", "r", "19", 1, "ripple1"], ["cx", "22", "cy", "22", "r", "19", 1, "ripple2"]], template: function LoaderComponent_Template(rf, ctx) { if (rf & 1) {
1465
+ i0.ɵɵelementStart(0, "div", 0);
1466
+ i0.ɵɵnamespaceSVG();
1467
+ i0.ɵɵelementStart(1, "svg", 1);
1468
+ i0.ɵɵelementStart(2, "g", 2);
1469
+ i0.ɵɵelement(3, "circle", 3);
1470
+ i0.ɵɵelement(4, "circle", 4);
1471
+ i0.ɵɵelementEnd();
1472
+ i0.ɵɵelementEnd();
1473
+ i0.ɵɵelementEnd();
1474
+ } }, styles: ["[_nghost-%COMP%] {\n -webkit-user-select: none;\n user-select: none;\n pointer-events: none;\n}\n[_nghost-%COMP%] .loader-wrapper[_ngcontent-%COMP%] {\n z-index: 1100;\n position: absolute;\n width: 54px;\n height: 54px;\n}\n[_nghost-%COMP%] .loader-wrapper[_ngcontent-%COMP%] svg[_ngcontent-%COMP%] {\n width: 100%;\n height: 100%;\n}\n[_nghost-%COMP%] .loader-wrapper[_ngcontent-%COMP%] svg[_ngcontent-%COMP%] .ripple1[_ngcontent-%COMP%] {\n transform-origin: center;\n animation: ripple 1.5s infinite;\n}\n[_nghost-%COMP%] .loader-wrapper[_ngcontent-%COMP%] svg[_ngcontent-%COMP%] .ripple2[_ngcontent-%COMP%] {\n transform-origin: center;\n animation: ripple 1.5s infinite 0.4s;\n}\n@keyframes ripple {\n 0% {\n transform: scale(0);\n opacity: 1;\n }\n 100% {\n transform: scale(1);\n opacity: 0;\n }\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxvYWRlci5jb21wb25lbnQuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNFLHlCQUFBO1VBQUEsaUJBQUE7RUFDQSxvQkFBQTtBQUNGO0FBQUU7RUFDRSxhQUFBO0VBQ0Esa0JBQUE7RUFDQSxXQUFBO0VBQ0EsWUFBQTtBQUVKO0FBREk7RUFDRSxXQUFBO0VBQ0EsWUFBQTtBQUdOO0FBRk07RUFDRSx3QkFBQTtFQUNBLCtCQUFBO0FBSVI7QUFGTTtFQUNFLHdCQUFBO0VBQ0Esb0NBQUE7QUFJUjtBQUVBO0VBQ0U7SUFDRSxtQkFBQTtJQUNBLFVBQUE7RUFDRjtFQUNBO0lBQ0UsbUJBQUE7SUFDQSxVQUFBO0VBQ0Y7QUFDRiIsImZpbGUiOiJsb2FkZXIuY29tcG9uZW50LnNjc3MiLCJzb3VyY2VzQ29udGVudCI6WyI6aG9zdCB7XHJcbiAgdXNlci1zZWxlY3Q6IG5vbmU7XHJcbiAgcG9pbnRlci1ldmVudHM6IG5vbmU7XHJcbiAgLmxvYWRlci13cmFwcGVyIHtcclxuICAgIHotaW5kZXg6IDExMDA7IC8vIGFib3ZlIGRpYWxvZ3NcclxuICAgIHBvc2l0aW9uOiBhYnNvbHV0ZTtcclxuICAgIHdpZHRoOiA1NHB4O1xyXG4gICAgaGVpZ2h0OiA1NHB4O1xyXG4gICAgc3ZnIHtcclxuICAgICAgd2lkdGg6IDEwMCU7XHJcbiAgICAgIGhlaWdodDogMTAwJTtcclxuICAgICAgLnJpcHBsZTEge1xyXG4gICAgICAgIHRyYW5zZm9ybS1vcmlnaW46IGNlbnRlcjtcclxuICAgICAgICBhbmltYXRpb246IHJpcHBsZSAxLjVzIGluZmluaXRlO1xyXG4gICAgICB9XHJcbiAgICAgIC5yaXBwbGUyIHtcclxuICAgICAgICB0cmFuc2Zvcm0tb3JpZ2luOiBjZW50ZXI7XHJcbiAgICAgICAgYW5pbWF0aW9uOiByaXBwbGUgMS41cyBpbmZpbml0ZSAuNHM7XHJcbiAgICAgIH1cclxuICAgIH1cclxuICB9XHJcbn1cclxuXHJcbkBrZXlmcmFtZXMgcmlwcGxlIHtcclxuICAwJSB7XHJcbiAgICB0cmFuc2Zvcm06IHNjYWxlKDApO1xyXG4gICAgb3BhY2l0eTogMTtcclxuICB9XHJcbiAgMTAwJSB7XHJcbiAgICB0cmFuc2Zvcm06IHNjYWxlKDEpO1xyXG4gICAgb3BhY2l0eTogMDtcclxuICB9XHJcbn1cclxuIl19 */"] });
1475
+
1476
+
1477
+ /***/ }),
1478
+
1479
+ /***/ 4065:
1480
+ /*!****************************************************!*\
1481
+ !*** ./src/app/components/shared/shared.module.ts ***!
1482
+ \****************************************************/
1483
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1484
+
1485
+ "use strict";
1486
+
1487
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
1488
+ exports.SharedModule = void 0;
1489
+ const tslib_1 = __webpack_require__(/*! tslib */ 42321);
1490
+ const common_1 = __webpack_require__(/*! @angular/common */ 54364);
1491
+ const loader_component_1 = __webpack_require__(/*! ./loader/loader.component */ 98506);
1492
+ const i0 = tslib_1.__importStar(__webpack_require__(/*! @angular/core */ 2316));
1493
+ class SharedModule {
1494
+ }
1495
+ exports.SharedModule = SharedModule;
1496
+ SharedModule.ɵfac = function SharedModule_Factory(t) { return new (t || SharedModule)(); };
1497
+ SharedModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: SharedModule });
1498
+ SharedModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [[
1499
+ common_1.CommonModule
1500
+ ]] });
1501
+ (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(SharedModule, { declarations: [loader_component_1.LoaderComponent], imports: [common_1.CommonModule], exports: [loader_component_1.LoaderComponent] }); })();
1502
+
1503
+
1504
+ /***/ }),
1505
+
1506
+ /***/ 52966:
1507
+ /*!********************************************************************!*\
1508
+ !*** ./src/app/directives/visibility-observer-master.directive.ts ***!
1509
+ \********************************************************************/
1510
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1511
+
1512
+ "use strict";
1513
+
1514
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
1515
+ exports.VisibilityObserverMasterDirective = void 0;
1516
+ const tslib_1 = __webpack_require__(/*! tslib */ 42321);
1517
+ const i0 = tslib_1.__importStar(__webpack_require__(/*! @angular/core */ 2316));
1518
+ class VisibilityObserverMasterDirective {
1519
+ // I initialize the intersection observer parent directive.
1520
+ constructor() {
1521
+ // As each observable child attaches itself to the parent observer, we need to
1522
+ // map Elements to Callbacks so that when an Element's intersection changes,
1523
+ // we'll know which callback to invoke. For this, we'll use an ES6 Map.
1524
+ this._mapping = new Map();
1525
+ this._observer = new IntersectionObserver((entries) => {
1526
+ for (const entry of entries) {
1527
+ const callback = this._mapping.get(entry.target);
1528
+ if (callback) {
1529
+ callback(entry.isIntersecting);
1530
+ }
1531
+ }
1532
+ }, {
1533
+ // This classifies the "intersection" as being a bit outside the
1534
+ // viewport. The intent here is give the elements a little time to react
1535
+ // to the change before the element is actually visible to the user.
1536
+ rootMargin: '300px 0px 300px 0px'
1537
+ });
1538
+ }
1539
+ // I get called once when the host element is being destroyed.
1540
+ ngOnDestroy() {
1541
+ this._mapping.clear();
1542
+ this._observer.disconnect();
1543
+ }
1544
+ // ---
1545
+ // PUBLIC METHODS.
1546
+ // ---
1547
+ // I add the given Element for intersection observation. When the intersection status
1548
+ // changes, the given callback is invoked with the new status.
1549
+ add(element, callback) {
1550
+ this._mapping.set(element, callback);
1551
+ this._observer.observe(element);
1552
+ }
1553
+ // I remove the given Element from intersection observation.
1554
+ remove(element) {
1555
+ this._mapping.delete(element);
1556
+ this._observer.unobserve(element);
1557
+ }
1558
+ }
1559
+ exports.VisibilityObserverMasterDirective = VisibilityObserverMasterDirective;
1560
+ VisibilityObserverMasterDirective.ɵfac = function VisibilityObserverMasterDirective_Factory(t) { return new (t || VisibilityObserverMasterDirective)(); };
1561
+ VisibilityObserverMasterDirective.ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: VisibilityObserverMasterDirective, selectors: [["", "visibilityObserverMaster", ""]] });
1562
+
1563
+
1564
+ /***/ }),
1565
+
1566
+ /***/ 27789:
1567
+ /*!*************************************************************!*\
1568
+ !*** ./src/app/directives/visibility-observer.directive.ts ***!
1569
+ \*************************************************************/
1570
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1571
+
1572
+ "use strict";
1573
+
1574
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
1575
+ exports.VisibilityObserverDirective = void 0;
1576
+ const tslib_1 = __webpack_require__(/*! tslib */ 42321);
1577
+ const i0 = tslib_1.__importStar(__webpack_require__(/*! @angular/core */ 2316));
1578
+ const i1 = tslib_1.__importStar(__webpack_require__(/*! ./visibility-observer-master.directive */ 52966));
1579
+ class VisibilityObserverDirective {
1580
+ // I initialize the intersection observer directive.
1581
+ constructor(parent, elementRef) {
1582
+ this.observerEnabled = false;
1583
+ // These are just some human-friendly constants to make the HTML template a bit more
1584
+ // readable when being consumed as part of SWTCH/CASE statements.
1585
+ this.IS_INTERSECTING = true;
1586
+ this.IS_NOT_INTERSECTING = false;
1587
+ this._parent = parent;
1588
+ this._elementRef = elementRef;
1589
+ // By default, we're going to assume that the host element is NOT intersecting.
1590
+ // Then, we'll use the IntersectionObserver to asynchronously check for changes
1591
+ // in viewport visibility.
1592
+ this.isIntersecting = false;
1593
+ }
1594
+ // ---
1595
+ // PUBLIC METHODS.
1596
+ // ---
1597
+ // I get called once when the host element is being destroyed.
1598
+ ngOnDestroy() {
1599
+ this._parent.remove(this._elementRef.nativeElement);
1600
+ this._elementRef = undefined;
1601
+ }
1602
+ // I get called once after the inputs have been bound for the first time.
1603
+ ngOnInit() {
1604
+ // In this demo, instead of using an IntersectionObserver per Element, we're
1605
+ // going to use a shared observer in the parent element. However, we're still
1606
+ // going to use a CALLBACK style approach so that we're only reducing the number
1607
+ // of IntersectionObserver instances, not the number of Function calls.
1608
+ if (this.observerEnabled) {
1609
+ this._parent.add(this._elementRef.nativeElement, (isIntersecting) => {
1610
+ this.isIntersecting = isIntersecting;
1611
+ if (this.isIntersecting) {
1612
+ this._parent.remove(this._elementRef.nativeElement);
1613
+ }
1614
+ });
1615
+ }
1616
+ }
1617
+ }
1618
+ exports.VisibilityObserverDirective = VisibilityObserverDirective;
1619
+ VisibilityObserverDirective.ɵfac = function VisibilityObserverDirective_Factory(t) { return new (t || VisibilityObserverDirective)(i0.ɵɵdirectiveInject(i1.VisibilityObserverMasterDirective), i0.ɵɵdirectiveInject(i0.ElementRef)); };
1620
+ VisibilityObserverDirective.ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: VisibilityObserverDirective, selectors: [["", "visibilityObserver", ""]], inputs: { observerEnabled: "observerEnabled" }, exportAs: ["intersection"] });
1621
+
1622
+
1623
+ /***/ }),
1624
+
1625
+ /***/ 13965:
1626
+ /*!**************************************************!*\
1627
+ !*** ./src/app/services/configurator.service.ts ***!
1628
+ \**************************************************/
1629
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1630
+
1631
+ "use strict";
1632
+
1633
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
1634
+ exports.ConfiguratorService = void 0;
1635
+ const tslib_1 = __webpack_require__(/*! tslib */ 42321);
1636
+ const configurator_1 = __webpack_require__(/*! @colijnit/configuratorapi/build/configurator */ 9374);
1637
+ const not_nill_function_1 = __webpack_require__(/*! @colijnit/configuratorapi/build/utils/function/not-nill.function */ 41878);
1638
+ const node_type_enum_1 = __webpack_require__(/*! @colijnit/configuratorapi/build/enum/node-type.enum */ 3085);
1639
+ const is_nill_function_1 = __webpack_require__(/*! @colijnit/configuratorapi/build/utils/function/is-nill.function */ 81866);
1640
+ class ConfiguratorService {
1641
+ initApi(options) {
1642
+ this._configuratorApi = new configurator_1.Configurator(options);
1643
+ }
1644
+ initNodeInstance(goodId) {
1645
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
1646
+ return yield this._configuratorApi.initNodeInstance(goodId);
1647
+ });
1648
+ }
1649
+ setInstanceToConfigure(id, showLoader = false) {
1650
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
1651
+ return yield this._configuratorApi.setInstanceToConfigure(id, showLoader);
1652
+ });
1653
+ }
1654
+ getGoodIdFromSku(sku, showLoader = false) {
1655
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
1656
+ return yield this._configuratorApi.getGoodIdFromSku(sku, showLoader);
1657
+ });
1658
+ }
1659
+ getArticleQuickSel(goodId, showLoader = false) {
1660
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
1661
+ return yield this._configuratorApi.getArticleQuickSel(goodId, showLoader);
1662
+ });
1663
+ }
1664
+ getSelections(showLoader = false, publicationCode = 2) {
1665
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
1666
+ const selections = yield this._configuratorApi.getSelections(showLoader);
1667
+ selections.resultObjects.filter((s) => {
1668
+ (is_nill_function_1.isNill(s.hierarchicalPublicationCode) || ((s.hierarchicalPublicationCode & publicationCode) > 0)) && ((s.nodeType === node_type_enum_1.NodeType.Question && (((s.questionPublicationCode & publicationCode) > 0) || is_nill_function_1.isNill(s.questionPublicationCode))) ||
1669
+ (s.nodeType === node_type_enum_1.NodeType.Answer && (((s.answerPublicationCode & publicationCode) > 0) || is_nill_function_1.isNill(s.answerPublicationCode))));
1670
+ });
1671
+ return selections;
1672
+ });
1673
+ }
1674
+ getDecos(showLoader = false) {
1675
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
1676
+ return yield this._configuratorApi.getDecos(showLoader);
1677
+ });
1678
+ }
1679
+ getQuestionAndAnswers(showLoader = false, publicationCode = 2) {
1680
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
1681
+ const questionAndAnswers = yield this._configuratorApi.getQuestionAndAnswers(showLoader);
1682
+ questionAndAnswers.answers.filter((answer) => {
1683
+ (not_nill_function_1.notNill(answer.hierarchicalPublicationCode) && (answer.hierarchicalPublicationCode & publicationCode) === 0) ||
1684
+ (answer.type === node_type_enum_1.NodeType.Question && (answer.questionPublicationCode & publicationCode) === 0 && not_nill_function_1.notNill(answer.questionPublicationCode)) ||
1685
+ (answer.type === node_type_enum_1.NodeType.Answer && (answer.publicationCode & publicationCode) === 0 && not_nill_function_1.notNill(answer.publicationCode));
1686
+ });
1687
+ return questionAndAnswers;
1688
+ });
1689
+ }
1690
+ getSingleImage(nodeId, publication, includeMimetype, thumb, showLoader) {
1691
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
1692
+ if (!nodeId) {
1693
+ return null;
1694
+ }
1695
+ return yield this._configuratorApi.getSingleImage(nodeId, publication, includeMimetype, thumb, showLoader);
1696
+ });
1697
+ }
1698
+ selectSelection(selection, showLoader = false) {
1699
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
1700
+ return yield this._configuratorApi.selectSelection(selection, showLoader);
1701
+ });
1702
+ }
1703
+ selectAnswer(answer, showLoader = false) {
1704
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
1705
+ return yield this._configuratorApi.selectAnswer(answer, showLoader);
1706
+ });
1707
+ }
1708
+ }
1709
+ exports.ConfiguratorService = ConfiguratorService;
1710
+
1711
+
1712
+ /***/ }),
1713
+
1714
+ /***/ 30609:
1715
+ /*!***************************************!*\
1716
+ !*** ./src/app/utils/object.utils.ts ***!
1717
+ \***************************************/
1718
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1719
+
1720
+ "use strict";
1721
+
1722
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
1723
+ exports.ObjectUtils = void 0;
1724
+ const three_1 = __webpack_require__(/*! three */ 30712);
1725
+ class ObjectUtils {
1726
+ static DisposeNode(node) {
1727
+ node.traverse((obj) => {
1728
+ if (obj instanceof three_1.Mesh) {
1729
+ if (obj.geometry) {
1730
+ obj.geometry.dispose();
1731
+ }
1732
+ ObjectUtils.DisposeMaterial(obj.material);
1733
+ }
1734
+ if (typeof obj.dispose === 'function') {
1735
+ // @ts-ignore
1736
+ obj.dispose();
1737
+ }
1738
+ });
1739
+ }
1740
+ static DisposeMaterial(material) {
1741
+ if (!material) {
1742
+ return;
1743
+ }
1744
+ if (Array.isArray(material)) {
1745
+ material.forEach(mtrl => {
1746
+ this.materialProps
1747
+ .filter(mapType => mtrl[mapType])
1748
+ .forEach(mapType => mtrl[mapType].dispose());
1749
+ mtrl.dispose(); // disposes any programs associated with the material
1750
+ });
1751
+ }
1752
+ else {
1753
+ this.materialProps
1754
+ .filter(mapType => material[mapType] && material[mapType].dispose)
1755
+ .forEach(mapType => material[mapType].dispose());
1756
+ if (material.dispose) {
1757
+ material.dispose(); // disposes any programs associated with the material
1758
+ }
1759
+ }
1760
+ }
1761
+ static DisposeObject(object) {
1762
+ if (!object) {
1763
+ return;
1764
+ }
1765
+ if (object.children.length) {
1766
+ object.children.forEach(child => this.DisposeObject(child));
1767
+ }
1768
+ this.DisposeNode(object);
1769
+ }
1770
+ }
1771
+ exports.ObjectUtils = ObjectUtils;
1772
+ ObjectUtils.materialProps = ['map', 'lightMap', 'bumpMap', 'normalMap', 'specularMap', 'envMap', 'aoMap', 'roughnessMap', 'metalnessMap'];
1773
+
1774
+
1775
+ /***/ }),
1776
+
1777
+ /***/ 92340:
1778
+ /*!*****************************************!*\
1779
+ !*** ./src/environments/environment.ts ***!
1780
+ \*****************************************/
1781
+ /***/ ((__unused_webpack_module, exports) => {
1782
+
1783
+ "use strict";
1784
+
1785
+ // The file contents for the current environment will overwrite these during build.
1786
+ // The build system defaults to the dev environment which uses `environment.ts`, but if you do
1787
+ // `ng build --env=prod` then `environment.prod.ts` will be used instead.
1788
+ // The list of which env maps to which file can be found in `.angular-cli.json`.
1789
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
1790
+ exports.environment = void 0;
1791
+ exports.environment = {
1792
+ production: false
1793
+ };
1794
+
1795
+
1796
+ /***/ }),
1797
+
1798
+ /***/ 41086:
1799
+ /*!****************************************!*\
1800
+ !*** ./src/helper/variation-helper.ts ***!
1801
+ \****************************************/
1802
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1803
+
1804
+ "use strict";
1805
+
1806
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
1807
+ exports.VariationHelper = void 0;
1808
+ const tslib_1 = __webpack_require__(/*! tslib */ 42321);
1809
+ const deco_node_type_enum_1 = __webpack_require__(/*! @colijnit/configuratorapi/build/enum/deco-node-type.enum */ 63447);
1810
+ const variation_settings_1 = __webpack_require__(/*! ../model/variation-settings */ 95664);
1811
+ const asset_utils_1 = __webpack_require__(/*! ../utils/asset.utils */ 27743);
1812
+ const variation_1 = __webpack_require__(/*! ../model/variation */ 33009);
1813
+ const variation_utils_1 = __webpack_require__(/*! ../utils/variation-utils */ 4876);
1814
+ const image_utils_1 = __webpack_require__(/*! ../utils/image.utils */ 22700);
1815
+ const three_1 = __webpack_require__(/*! three */ 30712);
1816
+ const operators_1 = __webpack_require__(/*! rxjs/operators */ 41873);
1817
+ const material_1 = __webpack_require__(/*! ../model/material */ 68497);
1818
+ class VariationHelper {
1819
+ constructor() {
1820
+ this._variations = [];
1821
+ this._lastKnownVariations = new Map();
1822
+ }
1823
+ clearCache() {
1824
+ const variationMap = Array.from(this._lastKnownVariations.values());
1825
+ variationMap.forEach((variations) => {
1826
+ variations.forEach((variation) => {
1827
+ try {
1828
+ if (variation.material) {
1829
+ if (variation.material.texture) {
1830
+ variation.material.texture.dispose();
1831
+ }
1832
+ if (variation.material.normal) {
1833
+ variation.material.normal.dispose();
1834
+ }
1835
+ if (variation.material.metalness) {
1836
+ variation.material.metalness.dispose();
1837
+ }
1838
+ if (variation.material.roughness) {
1839
+ variation.material.roughness.dispose();
1840
+ }
1841
+ if (variation.material.ao) {
1842
+ variation.material.ao.dispose();
1843
+ }
1844
+ }
1845
+ }
1846
+ catch (e) {
1847
+ }
1848
+ });
1849
+ });
1850
+ variation_utils_1.VariationUtils.ClearCache();
1851
+ image_utils_1.ImageUtils.ClearCache();
1852
+ }
1853
+ loadPart(obj, parts, usePbr = false) {
1854
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
1855
+ try {
1856
+ const len = parts.length;
1857
+ for (let i = 0; i < len; i++) {
1858
+ if (parts[i].decoNode && parts[i].decoNode.gameObjectName && parts[i].decoNode.type === deco_node_type_enum_1.DecoNodeType.Part) {
1859
+ const partSettings = yield variation_utils_1.VariationUtils.LoadVariation(this.assetPath, parts[i].decoNode.gameObjectName || parts[i].decoId);
1860
+ if (partSettings) {
1861
+ const partVariation = new variation_1.Variation();
1862
+ partVariation.decoId = parseFloat(parts[i].decoNode.id);
1863
+ partVariation.brandId = parts[i].decoNode.brandId;
1864
+ partVariation.gameObjectName = parts[i].decoNode.gameObjectName;
1865
+ partVariation.material = yield asset_utils_1.AssetUtils.CreateMaterialFromAsset(partSettings);
1866
+ // parts[i].variation = partVariation;
1867
+ this._applyMaterialPart(obj, partVariation, parts[i].node, usePbr);
1868
+ }
1869
+ }
1870
+ }
1871
+ }
1872
+ catch (e) {
1873
+ console.error(e);
1874
+ }
1875
+ });
1876
+ }
1877
+ loadVariation(obj, parts, usePbr = false) {
1878
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
1879
+ try {
1880
+ const len = parts.length;
1881
+ for (let i = 0; i < len; i++) {
1882
+ const variations = parts[i].variations;
1883
+ if (!variations || variations.length === 0) {
1884
+ if (this._getLastKnownVariations(parts[i].nodeId)) {
1885
+ parts[i].variations = this._getLastKnownVariations(parts[i].nodeId);
1886
+ this._applyVariations(obj, parts[i], usePbr);
1887
+ continue;
1888
+ }
1889
+ else {
1890
+ continue;
1891
+ }
1892
+ }
1893
+ const lastKnownVariations = [];
1894
+ const variationPromise = [];
1895
+ for (let j = 0; j < variations.length; j++) {
1896
+ variationPromise.push(this.loadTheVariation(variations[j].gameObjectName || parts[i].decoId)
1897
+ .then((variationSettings) => {
1898
+ const newVariation = new variation_1.Variation();
1899
+ newVariation.decoId = variations[j].constructor.name === 'Variation' ? variations[j].decoId : parseFloat(variations[j].id);
1900
+ newVariation.node = variations[j].constructor.name === 'Variation' ? variations[j].node : variations[j].nodeId;
1901
+ newVariation.brandId = variations[j].brandId;
1902
+ newVariation.optionText = variations[j].optionText;
1903
+ newVariation.gameObjectName = variations[j].gameObjectName;
1904
+ newVariation.supplierArticleNr = variations[j].supplierArticleNr;
1905
+ newVariation.materialId = variations[j].materialId;
1906
+ newVariation.material = variationSettings ? variationSettings.material : null;
1907
+ lastKnownVariations.push(newVariation);
1908
+ }));
1909
+ }
1910
+ yield Promise.all(variationPromise);
1911
+ this._setLastKnownVariations(`${parts[i].nodeId}_${parts[i].node}`, lastKnownVariations);
1912
+ parts[i].variations = lastKnownVariations;
1913
+ this._applyVariations(obj, parts[i], usePbr);
1914
+ }
1915
+ }
1916
+ catch (e) {
1917
+ this._log(e.message);
1918
+ }
1919
+ });
1920
+ }
1921
+ get(id) {
1922
+ const len = this._variations.length;
1923
+ for (let i = 0; i < len; i++) {
1924
+ if (this._variations[i].id && this._variations[i].id === id) {
1925
+ return this._variations[i];
1926
+ }
1927
+ }
1928
+ }
1929
+ set(variations) {
1930
+ const idx = this._variations.findIndex(v => v.id === variations.id);
1931
+ if (idx > -1) {
1932
+ this._variations[idx] = variations;
1933
+ }
1934
+ else {
1935
+ this._variations.push(variations);
1936
+ }
1937
+ }
1938
+ preloadVariations(fileNames) {
1939
+ for (let i = 0; i < fileNames.length; i++) {
1940
+ const fileName = fileNames[i];
1941
+ if (fileName && !this.get(fileName)) {
1942
+ const settings = new variation_settings_1.VariationSettings();
1943
+ settings.id = fileName;
1944
+ settings.loading = true;
1945
+ this._variations.push(settings);
1946
+ variation_utils_1.VariationUtils.LoadVariation(this.assetPath, fileName)
1947
+ .then((variationSettings) => {
1948
+ settings.loading = false;
1949
+ if (variationSettings) {
1950
+ // this.set(variationSettings);
1951
+ settings.copyFrom(variationSettings);
1952
+ }
1953
+ settings.loaded.next(settings);
1954
+ })
1955
+ .catch((err) => {
1956
+ console.error(`Error loading variation ${fileName}:`, err);
1957
+ settings.loading = false;
1958
+ settings.loaded.next(null);
1959
+ });
1960
+ }
1961
+ }
1962
+ }
1963
+ loadTheVariation(fileName) {
1964
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
1965
+ if (!fileName) {
1966
+ return null;
1967
+ }
1968
+ const settings = this.get(fileName);
1969
+ if (!settings) {
1970
+ return null;
1971
+ }
1972
+ if (settings.loading) {
1973
+ const sett = yield this._waitForVariationToLoad(settings);
1974
+ yield this._loadMaterialFromSettings(sett);
1975
+ return sett;
1976
+ }
1977
+ else {
1978
+ yield this._loadMaterialFromSettings(settings);
1979
+ return settings;
1980
+ }
1981
+ });
1982
+ }
1983
+ _loadMaterialFromSettings(settings) {
1984
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
1985
+ if (settings) {
1986
+ if (!settings.material) {
1987
+ settings.material = yield asset_utils_1.AssetUtils.CreateMaterialFromAsset(settings);
1988
+ }
1989
+ }
1990
+ });
1991
+ }
1992
+ _waitForVariationToLoad(settings) {
1993
+ return new Promise((resolve) => {
1994
+ settings.loaded.pipe(operators_1.filter((value) => value !== undefined), operators_1.take(1)).subscribe((value) => {
1995
+ resolve(value);
1996
+ });
1997
+ });
1998
+ }
1999
+ _getChildrenFilterByProp(obj, userDataObjectProp, prop, value) {
2000
+ return obj.children.filter((child) => {
2001
+ return child.userData &&
2002
+ child.userData.hasOwnProperty(userDataObjectProp) &&
2003
+ child.userData[userDataObjectProp].hasOwnProperty(prop) &&
2004
+ child.userData[userDataObjectProp][prop] === value;
2005
+ });
2006
+ }
2007
+ _applyMaterialPart(obj, partMaterial, nodeId, usePbr = false) {
2008
+ const children = this._getChildrenFilterByProp(obj, 'selection', 'node', nodeId);
2009
+ const len = children.length;
2010
+ for (let i = 0; i < len; i++) {
2011
+ const child = children[i];
2012
+ if (child !== null && child !== undefined) {
2013
+ child.traverse((mesh) => {
2014
+ if ((mesh instanceof three_1.Mesh || mesh.constructor.name === 'Mesh') && partMaterial) {
2015
+ if (Array.isArray(mesh.material)) { // multimaterial support
2016
+ for (let j = 0, jlen = mesh.material.length; j < jlen; j++) {
2017
+ if (mesh.material[j].name.toLowerCase().indexOf('fixed_frame') !== -1) {
2018
+ mesh.material[j] = this._setMeshMaterialFromVariation(mesh.material[j].name, partMaterial, usePbr);
2019
+ }
2020
+ }
2021
+ }
2022
+ else {
2023
+ if (mesh.material.name && mesh.material.name.toLowerCase().indexOf('fixed_frame') !== -1) {
2024
+ mesh.material = this._setMeshMaterialFromVariation(mesh.material.name, partMaterial, usePbr);
2025
+ }
2026
+ }
2027
+ }
2028
+ });
2029
+ }
2030
+ }
2031
+ }
2032
+ _applyVariations(obj, part, usePbr = false) {
2033
+ const children = this._getChildrenFilterByProp(obj, 'selection', 'node', part.node);
2034
+ const len = children.length;
2035
+ for (let i = 0; i < len; i++) {
2036
+ const child = children[i];
2037
+ if (child !== null && child !== undefined) {
2038
+ child.traverse((mesh) => {
2039
+ if ((mesh instanceof three_1.Mesh || mesh.constructor.name === 'Mesh') && part.variations && part.variations.length > 0 && mesh.name.toLowerCase().indexOf('c_')) {
2040
+ for (let j = 0; j < part.variations.length; j++) {
2041
+ const variation = part.variations[j];
2042
+ if (variation.material) {
2043
+ const materialToSearch = !!variation.materialId ? variation.materialId.toLowerCase() : 'default';
2044
+ if (Array.isArray(mesh.material)) { // multimaterial support
2045
+ for (let m = 0, mlen = mesh.material.length; m < mlen; m++) {
2046
+ if (mesh.material[m].name.toLowerCase().indexOf(materialToSearch) !== -1) {
2047
+ if ((variation.material instanceof material_1.Material || variation.material.constructor.name === 'Material') && variation.material.isMaterial) {
2048
+ // it's a THREE.Material
2049
+ mesh.material[m] = variation.material;
2050
+ if (mesh.material[m].name && (mesh.material[m].name === 'Fixed_Glass' || mesh.material[m].name === 'Default_Glass')) {
2051
+ mesh.castShadow = false;
2052
+ }
2053
+ }
2054
+ else {
2055
+ mesh.material[m] = this._setMeshMaterialFromVariation(mesh.material[m].name, variation, usePbr);
2056
+ if (mesh.material[m].name && (mesh.material[m].name === 'Fixed_Glass' || mesh.material[m].name === 'Default_Glass')) {
2057
+ mesh.castShadow = false;
2058
+ }
2059
+ }
2060
+ }
2061
+ }
2062
+ }
2063
+ else {
2064
+ if (mesh.material.name && mesh.material.name.toLowerCase().indexOf(materialToSearch) !== -1) {
2065
+ if ((variation.material instanceof material_1.Material || variation.material.constructor.name === 'Material') && variation.material.isMaterial) {
2066
+ // it's a THREE.Material
2067
+ mesh.material = variation.material;
2068
+ if (mesh.material.name === 'Fixed_Glass' || mesh.material.name === 'Default_Glass') {
2069
+ mesh.castShadow = false;
2070
+ }
2071
+ }
2072
+ else {
2073
+ mesh.material = this._setMeshMaterialFromVariation(mesh.material.name, variation, usePbr);
2074
+ if (mesh.material.name === 'Fixed_Glass' || mesh.material.name === 'Default_Glass') {
2075
+ mesh.castShadow = false;
2076
+ }
2077
+ }
2078
+ }
2079
+ }
2080
+ }
2081
+ }
2082
+ }
2083
+ });
2084
+ }
2085
+ }
2086
+ }
2087
+ _setMeshMaterialFromVariation(name, variation, usePbr = false) {
2088
+ const material = variation.material;
2089
+ if (material.texture) {
2090
+ material.texture.needsUpdate = true;
2091
+ material.texture.mapping = three_1.EquirectangularReflectionMapping;
2092
+ }
2093
+ if (!usePbr) {
2094
+ const newMaterial = new three_1.MeshPhongMaterial({
2095
+ name: name,
2096
+ shininess: material.shininess,
2097
+ specular: material.specular,
2098
+ map: material.texture,
2099
+ normalMap: material.normal
2100
+ });
2101
+ newMaterial.color.setRGB(0.8, 0.8, 0.8);
2102
+ newMaterial.needsUpdate = true;
2103
+ return newMaterial;
2104
+ }
2105
+ if (material.sheen || material.sheenColor || material.reflectivity || material.transmission) { // TODO: Proper check for all unique physical material properties
2106
+ const params = {
2107
+ // side: material.side ? material.side : FrontSide,
2108
+ name: name,
2109
+ roughness: material.roughnessValue !== undefined && material.roughnessValue !== null ? material.roughnessValue : 1,
2110
+ metalness: material.metalnessValue !== undefined && material.metalnessValue !== null ? material.metalnessValue : 0,
2111
+ envMapIntensity: material.envMapIntensity ? material.envMapIntensity : 0.01,
2112
+ clearcoatMap: material.clearcoatMap ? material.clearcoatMap : null,
2113
+ clearcoatRoughnessMap: material.clearcoatRoughnessMap ? material.clearcoatRoughnessMap : null,
2114
+ attenuationDistance: Infinity
2115
+ // wireframe: true,
2116
+ // opacity: 0.3,
2117
+ // transparent: true,
2118
+ };
2119
+ if (material.displacementValue) {
2120
+ params.displacementScale = material.displacementValue;
2121
+ }
2122
+ if (material.opacity) {
2123
+ params.opacity = material.opacity;
2124
+ }
2125
+ if (material.transparent) {
2126
+ params.transparent = material.transparent;
2127
+ }
2128
+ if (material.emissiveValue) {
2129
+ params.emissive = material.emissiveValue;
2130
+ }
2131
+ if (material.emissiveIntensityValue) {
2132
+ params.emissiveIntensity = material.emissiveIntensityValue;
2133
+ }
2134
+ if (material.texture) {
2135
+ params.map = material.texture;
2136
+ params.map.needsUpdate = true;
2137
+ }
2138
+ if (material.ao) {
2139
+ params.aoMap = material.ao;
2140
+ params.aoMap.needsUpdate = true;
2141
+ }
2142
+ if (material.roughness) {
2143
+ params.roughnessMap = material.roughness;
2144
+ params.roughnessMap.needsUpdate = true;
2145
+ // material.roughness.magFilter = NearestFilter;
2146
+ }
2147
+ if (material.metalness) {
2148
+ params.metalnessMap = material.metalness;
2149
+ params.metalnessMap.needsUpdate = true;
2150
+ }
2151
+ if (material.normal) {
2152
+ params.normalMap = material.normal;
2153
+ params.normalMap.needsUpdate = true;
2154
+ }
2155
+ if (material.displacement) {
2156
+ params.displacementMap = material.displacement;
2157
+ params.displacementMap.needsUpdate = true;
2158
+ }
2159
+ if (material.emissive) {
2160
+ params.emissiveMap = material.emissive;
2161
+ params.emissiveMap.needsUpdate = true;
2162
+ }
2163
+ if (material.envMap) {
2164
+ if (material.envMapIntensity != null || 0) {
2165
+ params.envMap = material.envMap;
2166
+ params.envMap.needsUpdate = true;
2167
+ material.envMap.mapping = three_1.EquirectangularReflectionMapping;
2168
+ material.envMap.minFilter = three_1.NearestFilter;
2169
+ material.envMap.magFilter = three_1.NearestFilter;
2170
+ }
2171
+ }
2172
+ if (material.reflectivity) {
2173
+ params.reflectivity = material.reflectivity;
2174
+ }
2175
+ if (material.side) {
2176
+ params.side = material.side;
2177
+ }
2178
+ else {
2179
+ params.side = three_1.DoubleSide;
2180
+ }
2181
+ const newMaterial = new three_1.MeshPhysicalMaterial(params);
2182
+ newMaterial.color.setRGB(1, 1, 1);
2183
+ if (material.sheen) {
2184
+ newMaterial.sheen = material.sheen;
2185
+ }
2186
+ if (material.sheenColor) {
2187
+ newMaterial.sheenColor = this._createValidColor(material.sheenColor);
2188
+ }
2189
+ else {
2190
+ // Add fallback for blender render
2191
+ newMaterial.sheenColor = new three_1.Color(1, 1, 1);
2192
+ }
2193
+ if (material.sheenRoughness) {
2194
+ newMaterial.sheenRoughness = material.sheenRoughness;
2195
+ }
2196
+ if (material.sheenColorMap) {
2197
+ newMaterial.sheenColorMap = material.sheenColorMap;
2198
+ newMaterial.sheenColorMap.needsUpdate = true;
2199
+ }
2200
+ if (material.sheenRoughnessMap) {
2201
+ newMaterial.sheenRoughnessMap = material.sheenRoughnessMap;
2202
+ newMaterial.sheenRoughnessMap.needsUpdate = true;
2203
+ }
2204
+ if (material.transmission) {
2205
+ newMaterial.transmission = material.transmission;
2206
+ }
2207
+ if (material.ior !== undefined && material.ior !== null) {
2208
+ newMaterial.ior = material.ior;
2209
+ }
2210
+ if (material.thickness !== undefined && material.thickness !== null) {
2211
+ newMaterial.thickness = material.thickness;
2212
+ }
2213
+ if (material.specularIntensity !== undefined && material.specularIntensity !== null) {
2214
+ newMaterial.specularIntensity = material.specularIntensity;
2215
+ }
2216
+ if (material.transmissionMap) {
2217
+ newMaterial.transmissionMap = material.transmissionMap;
2218
+ newMaterial.transmissionMap.needsUpdate = true;
2219
+ }
2220
+ newMaterial.needsUpdate = true;
2221
+ return newMaterial;
2222
+ }
2223
+ else {
2224
+ const params = {
2225
+ // side: material.side ? material.side : FrontSide,
2226
+ name: name,
2227
+ roughness: material.roughnessValue !== undefined && material.roughnessValue !== null ? material.roughnessValue : 1,
2228
+ metalness: material.metalnessValue !== undefined && material.metalnessValue !== null ? material.metalnessValue : 0,
2229
+ envMapIntensity: material.envMapIntensity ? material.envMapIntensity : 0.01
2230
+ // wireframe: true,
2231
+ // opacity: 0.3,
2232
+ // transparent: true,
2233
+ };
2234
+ if (material.displacementValue) {
2235
+ params.displacementScale = material.displacementValue;
2236
+ }
2237
+ if (material.opacity) {
2238
+ params.opacity = material.opacity;
2239
+ }
2240
+ if (material.transparent) {
2241
+ params.transparent = material.transparent;
2242
+ }
2243
+ if (material.emissiveValue) {
2244
+ params.emissive = material.emissiveValue;
2245
+ }
2246
+ if (material.emissiveIntensityValue) {
2247
+ params.emissiveIntensity = material.emissiveIntensityValue;
2248
+ }
2249
+ if (material.texture) {
2250
+ params.map = material.texture;
2251
+ params.map.needsUpdate = true;
2252
+ }
2253
+ if (material.ao) {
2254
+ params.aoMap = material.ao;
2255
+ params.aoMap.needsUpdate = true;
2256
+ }
2257
+ if (material.roughness) {
2258
+ params.roughnessMap = material.roughness;
2259
+ params.roughnessMap.needsUpdate = true;
2260
+ // material.roughness.magFilter = NearestFilter;
2261
+ }
2262
+ if (material.metalness) {
2263
+ params.metalnessMap = material.metalness;
2264
+ params.metalnessMap.needsUpdate = true;
2265
+ }
2266
+ if (material.normal) {
2267
+ params.normalMap = material.normal;
2268
+ params.normalMap.needsUpdate = true;
2269
+ }
2270
+ if (material.displacement) {
2271
+ params.displacementMap = material.displacement;
2272
+ params.displacementMap.needsUpdate = true;
2273
+ }
2274
+ if (material.emissive) {
2275
+ params.emissiveMap = material.emissive;
2276
+ params.emissiveMap.needsUpdate = true;
2277
+ }
2278
+ if (material.envMap) {
2279
+ if (material.envMapIntensity != null || 0) {
2280
+ params.envMap = material.envMap;
2281
+ params.envMap.needsUpdate = true;
2282
+ material.envMap.mapping = three_1.EquirectangularReflectionMapping;
2283
+ material.envMap.minFilter = three_1.NearestFilter;
2284
+ material.envMap.magFilter = three_1.NearestFilter;
2285
+ }
2286
+ }
2287
+ if (material.side) {
2288
+ params.side = material.side;
2289
+ }
2290
+ else {
2291
+ params.side = three_1.DoubleSide;
2292
+ }
2293
+ const newMaterial = new three_1.MeshStandardMaterial(params);
2294
+ newMaterial.color.setRGB(1, 1, 1);
2295
+ newMaterial.needsUpdate = true;
2296
+ return newMaterial;
2297
+ }
2298
+ }
2299
+ _setLastKnownVariations(id, variation) {
2300
+ this._lastKnownVariations.set(id, variation);
2301
+ }
2302
+ _getLastKnownVariations(id) {
2303
+ if (this._lastKnownVariations.has(id)) {
2304
+ return this._lastKnownVariations.get(id);
2305
+ }
2306
+ return null;
2307
+ }
2308
+ _createValidColor(color) {
2309
+ if (typeof color === 'string') {
2310
+ if (/^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(color)) {
2311
+ return new three_1.Color(`#${color.replace('#', '')}`);
2312
+ }
2313
+ }
2314
+ else if (color instanceof three_1.Color || color.constructor.name === 'Color') {
2315
+ return color;
2316
+ }
2317
+ else {
2318
+ try {
2319
+ return new three_1.Color(color);
2320
+ }
2321
+ catch (e) {
2322
+ return new three_1.Color();
2323
+ }
2324
+ }
2325
+ return new three_1.Color();
2326
+ }
2327
+ _log(message) {
2328
+ if (this.debug) {
2329
+ this.debug(message);
2330
+ console.log(new Date(), message);
2331
+ }
2332
+ }
2333
+ }
2334
+ exports.VariationHelper = VariationHelper;
2335
+
2336
+
2337
+ /***/ }),
2338
+
2339
+ /***/ 14431:
2340
+ /*!*********************!*\
2341
+ !*** ./src/main.ts ***!
2342
+ \*********************/
2343
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2344
+
2345
+ "use strict";
2346
+
2347
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
2348
+ const tslib_1 = __webpack_require__(/*! tslib */ 42321);
2349
+ const __NgCli_bootstrap_1 = tslib_1.__importStar(__webpack_require__(/*! @angular/platform-browser */ 71570));
2350
+ const core_1 = __webpack_require__(/*! @angular/core */ 2316);
2351
+ const environment_1 = __webpack_require__(/*! ./environments/environment */ 92340);
2352
+ const app_module_1 = __webpack_require__(/*! ./app/app.module */ 36747);
2353
+ if (environment_1.environment.production) {
2354
+ core_1.enableProdMode();
2355
+ }
2356
+ __NgCli_bootstrap_1.platformBrowser().bootstrapModule(app_module_1.AppModule);
2357
+
2358
+
2359
+ /***/ }),
2360
+
2361
+ /***/ 68497:
2362
+ /*!*******************************!*\
2363
+ !*** ./src/model/material.ts ***!
2364
+ \*******************************/
2365
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2366
+
2367
+ "use strict";
2368
+
2369
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
2370
+ exports.Material = void 0;
2371
+ const three_1 = __webpack_require__(/*! three */ 30712);
2372
+ class Material {
2373
+ constructor() {
2374
+ this.specular = new three_1.Color(0.3, 0.3, 0.3);
2375
+ this.shininess = 0;
2376
+ this.repeatX = 4;
2377
+ this.repeatY = 4;
2378
+ this.loaded = false;
2379
+ }
2380
+ }
2381
+ exports.Material = Material;
2382
+
2383
+
2384
+ /***/ }),
2385
+
2386
+ /***/ 95664:
2387
+ /*!*****************************************!*\
2388
+ !*** ./src/model/variation-settings.ts ***!
2389
+ \*****************************************/
2390
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2391
+
2392
+ "use strict";
2393
+
2394
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
2395
+ exports.VariationSettings = exports.VariationSettingsSettings = void 0;
2396
+ const rxjs_1 = __webpack_require__(/*! rxjs */ 67740);
2397
+ class VariationSettingsSettings {
2398
+ }
2399
+ exports.VariationSettingsSettings = VariationSettingsSettings;
2400
+ class VariationSettings {
2401
+ constructor() {
2402
+ this.settings = new VariationSettingsSettings();
2403
+ this.loading = false;
2404
+ this.loaded = new rxjs_1.BehaviorSubject(undefined);
2405
+ }
2406
+ copyFrom(settings) {
2407
+ this.settings = settings.settings;
2408
+ this.texture = settings.texture;
2409
+ this.textureFilename = settings.textureFilename;
2410
+ this.normal = settings.normal;
2411
+ this.normalFilename = settings.normalFilename;
2412
+ this.ao = settings.ao;
2413
+ this.aoFilename = settings.aoFilename;
2414
+ this.metalness = settings.metalness;
2415
+ this.metalnessFilename = settings.metalnessFilename;
2416
+ this.roughness = settings.roughness;
2417
+ this.roughnessFilename = settings.roughnessFilename;
2418
+ this.orm = settings.orm;
2419
+ this.ormFilename = settings.ormFilename;
2420
+ this.displacement = settings.displacement;
2421
+ this.displacementValue = settings.displacementValue;
2422
+ this.displacementFilename = settings.displacementFilename;
2423
+ this.sheen = settings.sheen;
2424
+ this.sheenColor = settings.sheenColor;
2425
+ this.sheenColorMap = settings.sheenColorMap;
2426
+ this.sheenColorMapFilename = settings.sheenColorMapFilename;
2427
+ this.transmissionMap = settings.transmissionMap;
2428
+ this.transmissionMapFilename = settings.transmissionMapFilename;
2429
+ this.sheenRoughness = settings.sheenRoughness;
2430
+ this.sheenRoughnessMap = settings.sheenRoughnessMap;
2431
+ this.sheenRoughnessMapFilename = settings.sheenRoughnessMapFilename;
2432
+ this.emissive = settings.emissive;
2433
+ this.emissiveFilename = settings.emissiveFilename;
2434
+ this.emissiveIntensity = settings.emissiveIntensity;
2435
+ this.emissiveValue = settings.emissiveValue;
2436
+ this.opacity = settings.opacity;
2437
+ this.transparent = settings.transparent;
2438
+ this.envMap = settings.envMap;
2439
+ this.envMapFilename = settings.envMapFilename;
2440
+ this.envMapIntensity = settings.envMapIntensity;
2441
+ this.reflectivity = settings.reflectivity;
2442
+ this.side = settings.side;
2443
+ this.transmission = settings.transmission;
2444
+ this.ior = settings.ior;
2445
+ this.thickness = settings.thickness;
2446
+ this.specularIntensity = settings.specularIntensity;
2447
+ this.material = settings.material;
2448
+ }
2449
+ }
2450
+ exports.VariationSettings = VariationSettings;
2451
+
2452
+
2453
+ /***/ }),
2454
+
2455
+ /***/ 33009:
2456
+ /*!********************************!*\
2457
+ !*** ./src/model/variation.ts ***!
2458
+ \********************************/
2459
+ /***/ ((__unused_webpack_module, exports) => {
2460
+
2461
+ "use strict";
2462
+
2463
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
2464
+ exports.Variation = void 0;
2465
+ class Variation {
2466
+ }
2467
+ exports.Variation = Variation;
2468
+
2469
+
2470
+ /***/ }),
2471
+
2472
+ /***/ 27743:
2473
+ /*!**********************************!*\
2474
+ !*** ./src/utils/asset.utils.ts ***!
2475
+ \**********************************/
2476
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2477
+
2478
+ "use strict";
2479
+
2480
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
2481
+ exports.AssetUtils = exports.FurnitureMaterial = void 0;
2482
+ const tslib_1 = __webpack_require__(/*! tslib */ 42321);
2483
+ const material_1 = __webpack_require__(/*! ../model/material */ 68497);
2484
+ const image_utils_1 = __webpack_require__(/*! ./image.utils */ 22700);
2485
+ const three_1 = __webpack_require__(/*! three */ 30712);
2486
+ class FurnitureMaterial extends material_1.Material {
2487
+ }
2488
+ exports.FurnitureMaterial = FurnitureMaterial;
2489
+ class AssetUtils {
2490
+ static CreateMaterialFromAsset(asset) {
2491
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
2492
+ const material = new material_1.Material();
2493
+ try {
2494
+ if (!asset) {
2495
+ return material;
2496
+ }
2497
+ if (asset.settings) {
2498
+ AssetUtils.setSettingsOfMaterial(material, asset.settings);
2499
+ }
2500
+ if (asset.texture) {
2501
+ material.texture = yield image_utils_1.ImageUtils.CreateTextureFromBase64(asset.id + '_texture', asset.texture, material);
2502
+ material.texture.colorSpace = three_1.SRGBColorSpace;
2503
+ material.textureFilename = asset.textureFilename;
2504
+ }
2505
+ if (asset.normal) {
2506
+ material.normal = yield image_utils_1.ImageUtils.CreateTextureFromBase64(asset.id + '_normal', asset.normal, material);
2507
+ material.normalFilename = asset.normalFilename;
2508
+ }
2509
+ if (asset.orm) {
2510
+ material.ao = yield image_utils_1.ImageUtils.CreateTextureFromBase64(asset.id + '_orm', asset.orm, material);
2511
+ material.roughness = material.ao;
2512
+ material.metalness = material.ao;
2513
+ material.aoFilename = asset.ormFilename;
2514
+ material.roughnessFilename = asset.ormFilename;
2515
+ material.metalnessFilename = asset.ormFilename;
2516
+ }
2517
+ else {
2518
+ if (asset.ao) {
2519
+ material.ao = yield image_utils_1.ImageUtils.CreateTextureFromBase64(asset.id + '_ao', asset.ao, material);
2520
+ material.aoFilename = asset.aoFilename;
2521
+ }
2522
+ if (asset.metalness) {
2523
+ material.metalness = yield image_utils_1.ImageUtils.CreateTextureFromBase64(asset.id + '_metalness', asset.metalness, material);
2524
+ material.metalnessFilename = asset.metalnessFilename;
2525
+ }
2526
+ if (asset.roughness) {
2527
+ material.roughness = yield image_utils_1.ImageUtils.CreateTextureFromBase64(asset.id + '_roughness', asset.roughness, material);
2528
+ material.roughnessFilename = asset.roughnessFilename;
2529
+ }
2530
+ }
2531
+ if (asset.displacement) {
2532
+ material.displacement = yield image_utils_1.ImageUtils.CreateTextureFromBase64(asset.id + '_displacement', asset.displacement, material);
2533
+ material.displacementFilename = asset.displacementFilename;
2534
+ }
2535
+ if (asset.envMap) {
2536
+ material.envMap = yield image_utils_1.ImageUtils.CreateTextureFromBase64(asset.id + '_env', asset.envMap, material, true);
2537
+ material.envMapFilename = asset.envMapFilename;
2538
+ }
2539
+ if (asset.sheenColorMap) {
2540
+ material.sheenColorMap = yield image_utils_1.ImageUtils.CreateTextureFromBase64(asset.id + '_sheen_color', asset.sheenColorMap, material);
2541
+ material.sheenColorMapFileName = asset.sheenColorMapFilename;
2542
+ }
2543
+ if (asset.sheenRoughnessMap) {
2544
+ material.sheenRoughnessMap = yield image_utils_1.ImageUtils.CreateTextureFromBase64(asset.id + '_sheen_roughness', asset.sheenRoughnessMap, material);
2545
+ material.sheenRoughnessMapFileName = asset.sheenRoughnessMapFilename;
2546
+ }
2547
+ if (asset.transmissionMap) {
2548
+ material.transmissionMap = yield image_utils_1.ImageUtils.CreateTextureFromBase64(asset.id + '_transmission', asset.transmissionMap, material);
2549
+ material.transmissionMapFileName = asset.transmissionMapFilename;
2550
+ }
2551
+ if (asset.emissive) {
2552
+ material.emissive = yield image_utils_1.ImageUtils.CreateTextureFromBase64(asset.id + '_emissive', asset.emissive, material);
2553
+ material.emissiveFileName = asset.emissiveFilename;
2554
+ }
2555
+ material.sheen = asset.sheen;
2556
+ material.emissiveIntensityValue = asset.emissiveIntensity;
2557
+ material.emissiveValue = asset.emissiveValue;
2558
+ material.side = asset.side;
2559
+ material.sheenColor = asset.sheenColor;
2560
+ material.sheenRoughness = asset.sheenRoughness;
2561
+ material.opacity = asset.opacity;
2562
+ material.transparent = asset.transparent;
2563
+ material.envMapIntensity = asset.envMapIntensity;
2564
+ material.reflectivity = asset.reflectivity;
2565
+ material.displacementValue = asset.displacementValue;
2566
+ material.transmission = asset.transmission;
2567
+ material.ior = asset.ior;
2568
+ material.thickness = asset.thickness;
2569
+ material.specularIntensity = asset.specularIntensity;
2570
+ }
2571
+ catch (e) {
2572
+ console.error(e);
2573
+ }
2574
+ return material;
2575
+ });
2576
+ }
2577
+ static setSettingsOfMaterial(material, settings) {
2578
+ const shininess = parseFloat(settings['power']);
2579
+ if (!isNaN(shininess)) {
2580
+ material.shininess = shininess;
2581
+ // material.roughness = 1 - (shininess / 100);
2582
+ }
2583
+ const level = parseFloat(settings['level']);
2584
+ if (!isNaN(level)) {
2585
+ material.specular = new three_1.Color(level, level, level);
2586
+ }
2587
+ const repeatObjectUsed = settings.hasOwnProperty('repeat');
2588
+ const repeatx = repeatObjectUsed ? parseFloat(settings['repeat']['repeatx']) : parseFloat(settings['repeatx']);
2589
+ if (!isNaN(repeatx)) {
2590
+ material.repeatX = repeatx;
2591
+ }
2592
+ const repeaty = repeatObjectUsed ? parseFloat(settings['repeat']['repeaty']) : parseFloat(settings['repeaty']);
2593
+ if (!isNaN(repeaty)) {
2594
+ material.repeatY = repeaty;
2595
+ }
2596
+ const metalness = parseFloat(settings['metalness']);
2597
+ if (!isNaN(metalness)) {
2598
+ material.metalnessValue = Math.min(1, metalness);
2599
+ }
2600
+ const roughness = parseFloat(settings['roughness']);
2601
+ if (!isNaN(roughness)) {
2602
+ material.roughnessValue = Math.min(1, roughness);
2603
+ }
2604
+ }
2605
+ }
2606
+ exports.AssetUtils = AssetUtils;
2607
+
2608
+
2609
+ /***/ }),
2610
+
2611
+ /***/ 22700:
2612
+ /*!**********************************!*\
2613
+ !*** ./src/utils/image.utils.ts ***!
2614
+ \**********************************/
2615
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2616
+
2617
+ "use strict";
2618
+
2619
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
2620
+ exports.ImageUtils = void 0;
2621
+ const tslib_1 = __webpack_require__(/*! tslib */ 42321);
2622
+ const THREE = tslib_1.__importStar(__webpack_require__(/*! three */ 30712));
2623
+ // @dynamic
2624
+ class ImageUtils {
2625
+ static CreateTextureFromBase64(id, base64, material, defaultFlip = false) {
2626
+ return new Promise((resolve) => tslib_1.__awaiter(this, void 0, void 0, function* () {
2627
+ if (ImageUtils.textures.has(id)) {
2628
+ resolve(ImageUtils.textures.get(id));
2629
+ }
2630
+ else {
2631
+ if (!base64) {
2632
+ resolve(new THREE.Texture());
2633
+ }
2634
+ else {
2635
+ if (window.hasOwnProperty('textureLoader')) {
2636
+ resolve(yield window.textureLoader(base64));
2637
+ }
2638
+ else {
2639
+ const loader = new THREE.TextureLoader();
2640
+ loader.load(base64, (texture) => {
2641
+ texture.anisotropy = 16;
2642
+ texture.wrapS = THREE.RepeatWrapping;
2643
+ texture.wrapT = THREE.RepeatWrapping;
2644
+ texture.repeat = new THREE.Vector2(material ? material.repeatX : 1, material ? material.repeatY : 1);
2645
+ texture.flipY = defaultFlip;
2646
+ texture.needsUpdate = true;
2647
+ ImageUtils.textures.set(id, texture);
2648
+ resolve(texture);
2649
+ }, () => {
2650
+ }, () => {
2651
+ resolve(new THREE.Texture());
2652
+ });
2653
+ }
2654
+ }
2655
+ }
2656
+ }));
2657
+ }
2658
+ static getDocBodyWithMimeTypeDefinition(fileName, documentBody) {
2659
+ if (documentBody === null) {
2660
+ return documentBody;
2661
+ }
2662
+ const fileExtension = fileName.substr(fileName.lastIndexOf('.') + 1);
2663
+ switch (fileExtension.toLowerCase()) {
2664
+ case 'jpg':
2665
+ case 'jpeg':
2666
+ return 'data:image/jpg;base64,' + documentBody;
2667
+ case 'png':
2668
+ return 'data:image/png;base64,' + documentBody;
2669
+ case 'gif':
2670
+ return 'data:image/gif;base64,' + documentBody;
2671
+ case 'bmp':
2672
+ return 'data:image/bmp;base64,' + documentBody;
2673
+ default:
2674
+ return 'data:image/png;base64,' + documentBody;
2675
+ }
2676
+ }
2677
+ static getFixedImageFilepathUrl(imageFilepathUrl) {
2678
+ return imageFilepathUrl.replace('/content/', '/content43/');
2679
+ }
2680
+ static ClearCache() {
2681
+ ImageUtils.textures.forEach(value => {
2682
+ value.dispose();
2683
+ });
2684
+ ImageUtils.textures.clear();
2685
+ }
2686
+ }
2687
+ exports.ImageUtils = ImageUtils;
2688
+ ImageUtils.textures = new Map();
2689
+
2690
+
2691
+ /***/ }),
2692
+
2693
+ /***/ 37922:
2694
+ /*!***********************************!*\
2695
+ !*** ./src/utils/object.utils.ts ***!
2696
+ \***********************************/
2697
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2698
+
2699
+ "use strict";
2700
+
2701
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
2702
+ exports.ObjectUtils = void 0;
2703
+ const three_1 = __webpack_require__(/*! three */ 30712);
2704
+ class ObjectUtils {
2705
+ static DisposeMaterial(material) {
2706
+ if (!material) {
2707
+ return;
2708
+ }
2709
+ if (Array.isArray(material)) {
2710
+ material.forEach(mtrl => {
2711
+ this.materialProps
2712
+ .filter(mapType => mtrl[mapType])
2713
+ .forEach(mapType => mtrl[mapType].dispose());
2714
+ mtrl.dispose();
2715
+ });
2716
+ }
2717
+ else {
2718
+ this.materialProps
2719
+ .filter(mapType => material[mapType] && material[mapType].dispose)
2720
+ .forEach(mapType => material[mapType].dispose());
2721
+ if (material.dispose) {
2722
+ material.dispose();
2723
+ }
2724
+ }
2725
+ }
2726
+ static DisposeObject(object) {
2727
+ if (!object) {
2728
+ return;
2729
+ }
2730
+ if (object.children.length) {
2731
+ object.children.forEach(child => this.DisposeObject(child));
2732
+ }
2733
+ this.DisposeNode(object);
2734
+ }
2735
+ static DisposeNode(node) {
2736
+ node.traverse((obj) => {
2737
+ if (obj instanceof three_1.Mesh) {
2738
+ if (obj.geometry) {
2739
+ obj.geometry.dispose();
2740
+ }
2741
+ this.DisposeMaterial(obj.material);
2742
+ }
2743
+ if (typeof obj.dispose === 'function') {
2744
+ // @ts-ignore
2745
+ obj.dispose();
2746
+ }
2747
+ });
2748
+ }
2749
+ }
2750
+ exports.ObjectUtils = ObjectUtils;
2751
+ ObjectUtils.materialProps = ['map', 'lightMap', 'bumpMap', 'normalMap', 'specularMap', 'envMap', 'aoMap', 'roughnessMap', 'metalnessMap'];
2752
+
2753
+
2754
+ /***/ }),
2755
+
2756
+ /***/ 78606:
2757
+ /*!**********************************!*\
2758
+ !*** ./src/utils/scene-utils.ts ***!
2759
+ \**********************************/
2760
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2761
+
2762
+ "use strict";
2763
+
2764
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
2765
+ exports.SceneUtils = void 0;
2766
+ const tslib_1 = __webpack_require__(/*! tslib */ 42321);
2767
+ const THREE = tslib_1.__importStar(__webpack_require__(/*! three */ 30712));
2768
+ const selection_1 = __webpack_require__(/*! @colijnit/configuratorapi/build/model/selection */ 58427);
2769
+ class SceneUtils {
2770
+ static TrySelectorConnection(scene, parent, part1, part2, isFirstElement, createAddableFn) {
2771
+ let addable;
2772
+ if (createAddableFn) {
2773
+ addable = part2;
2774
+ part2 = createAddableFn(addable);
2775
+ }
2776
+ if (part1 && part2) {
2777
+ let con1;
2778
+ let con2;
2779
+ // if part2 is an addable and decoConnection is present, then no need to iterate through connectors
2780
+ if (addable && addable instanceof selection_1.Selection && addable.decoConnection) {
2781
+ con1 = part1.children.find(c => c.name === addable.decoConnection);
2782
+ if (!con1) {
2783
+ return false;
2784
+ }
2785
+ for (let ii = 0; ii < part2.children.length; ii++) {
2786
+ con2 = part2.children[ii];
2787
+ // if these connectors can connect connect them
2788
+ if (!con1['connected'] && !con2['connected'] && this.CanSelectorConnect(part1.children, con1, con2, isFirstElement)) {
2789
+ // if addable, continue this loop with a new addable
2790
+ if (addable) {
2791
+ const newPart2 = createAddableFn(addable, part2, part1);
2792
+ // reference of part2 changed, so refresh con2
2793
+ this.SelectorConnect(scene, parent, con1, newPart2.children[ii]);
2794
+ }
2795
+ else {
2796
+ return this.SelectorConnect(scene, parent, con1, con2);
2797
+ }
2798
+ }
2799
+ }
2800
+ }
2801
+ else {
2802
+ for (let i = 0; i < part1.children.length; i++) {
2803
+ for (let ii = 0; ii < part2.children.length; ii++) {
2804
+ con1 = part1.children[i];
2805
+ con2 = part2.children[ii];
2806
+ // if these connectors can connect connect them
2807
+ if (!con1['connected'] && !con2['connected'] && this.CanSelectorConnect(part1.children, con1, con2, isFirstElement)) {
2808
+ // if addable, continue this loop with a new addable
2809
+ if (addable) {
2810
+ const newPart2 = createAddableFn(addable, part2, part1);
2811
+ // reference of part2 changed, so refresh con2
2812
+ this.SelectorConnect(scene, parent, con1, newPart2.children[ii]);
2813
+ }
2814
+ else {
2815
+ return this.SelectorConnect(scene, parent, con1, con2);
2816
+ }
2817
+ }
2818
+ }
2819
+ }
2820
+ }
2821
+ }
2822
+ return false;
2823
+ }
2824
+ // public static TrySelectorConnection(scene: THREE.Scene, parent: THREE.Object3D,
2825
+ // part1: any, part2: any, createAddableFn?: Function): boolean {
2826
+ // let addable: any;
2827
+ // if (createAddableFn) {
2828
+ // addable = part2;
2829
+ // part2 = createAddableFn(addable);
2830
+ // }
2831
+ // for (let i = 0; i < part1.children.length; i++) {
2832
+ // for (let ii = 0; ii < part2.children.length; ii++) {
2833
+ // const con1: THREE.Object3D = part1.children[i];
2834
+ // const con2: THREE.Object3D = part2.children[ii];
2835
+ // // if these connectors can connect connect them
2836
+ // if (!con1['connected'] && !con2['connected'] && this.CanSelectorConnect(con1, con2)) {
2837
+ // // if addable, continue this loop with a new addable
2838
+ // if (addable) {
2839
+ // const newPart2: THREE.Object3D = createAddableFn(addable, part2, part1);
2840
+ // // reference of part2 changed, so refresh con2
2841
+ // this.SelectorConnect(scene, parent, con1, newPart2.children[ii]);
2842
+ // } else {
2843
+ // return this.SelectorConnect(scene, parent, con1, con2);
2844
+ // }
2845
+ // }
2846
+ // }
2847
+ // }
2848
+ // return false;
2849
+ // }
2850
+ static Convert3DPointToScreenPoint(point, camera, width, height) {
2851
+ if (!point) {
2852
+ return new THREE.Vector2();
2853
+ }
2854
+ const vector = point.clone().project(camera);
2855
+ vector.x = (vector.x + 1) / 2 * width;
2856
+ vector.y = -(vector.y - 1) / 2 * height;
2857
+ return new THREE.Vector2(vector.x, vector.y);
2858
+ }
2859
+ static CanSelectorConnect(consPart1, con1, con2, startWithMale) {
2860
+ const con1Name = (con1.constructor.name === 'Mesh' || con1.constructor.name === 'Object3D') ? con1.name : con1.connector;
2861
+ const con2Name = (con2.constructor.name === 'Mesh' || con2.constructor.name === 'Object3D') ? con2.name : con2.connector;
2862
+ const sameParent = (con1.constructor.name === 'Mesh' || con1.constructor.name === 'Object3D') &&
2863
+ (con2.constructor.name === 'Mesh' || con2.constructor.name === 'Object3D') ? con1.parent === con2.parent : false;
2864
+ const parts1 = con1Name.toUpperCase().split('_'), parts2 = con2Name.toUpperCase().split('_');
2865
+ if (parts1.length >= 3 && parts2.length >= 3 && !sameParent) {
2866
+ const connectable = parts1[0] === 'C' && parts2[0] === 'C' &&
2867
+ parts1[1] === parts2[1] && parts1[2] !== parts2[2];
2868
+ return connectable;
2869
+ }
2870
+ return false;
2871
+ }
2872
+ // public static CanSelectorConnect(con1: THREE.Object3D | any, con2: THREE.Object3D | any): boolean {
2873
+ // const con1Name: string = con1 instanceof THREE.Object3D ? con1.name : con1.connector;
2874
+ // const con2Name: string = con2 instanceof THREE.Object3D ? con2.name : con2.connector;
2875
+ // const sameParent: boolean = con1 instanceof THREE.Object3D && con2 instanceof THREE.Object3D ? con1.parent === con2.parent : false;
2876
+ // const parts1: string[] = con1Name.toUpperCase().split('_'),
2877
+ // parts2: string[] = con2Name.toUpperCase().split('_');
2878
+ // if (parts1.length >= 3 && parts2.length >= 3 && !sameParent) {
2879
+ // const connectable: boolean = parts1[0] === 'C' && parts2[0] === 'C' &&
2880
+ // parts1[1] === parts2[1] && parts1[2] !== parts2[2];
2881
+ // return connectable;
2882
+ // }
2883
+ // return false;
2884
+ // }
2885
+ static SelectorConnect(scene, parent, con1, con2) {
2886
+ if (!scene || !parent) {
2887
+ return false;
2888
+ }
2889
+ con1['connectedTo'] = con2.parent.name;
2890
+ con2['connectedTo'] = con1.parent.name;
2891
+ const motherRotation = new THREE.Euler(0, 0, 0);
2892
+ const motherPosition = new THREE.Vector3(0, 0, 0);
2893
+ parent.updateMatrixWorld();
2894
+ motherRotation.copy(parent.rotation);
2895
+ parent.getWorldPosition(motherPosition);
2896
+ parent.rotation.set(0, 0, 0);
2897
+ parent.position.set(0, 0, 0);
2898
+ scene.updateMatrixWorld(true);
2899
+ const con1Quat = new THREE.Quaternion();
2900
+ con1.getWorldQuaternion(con1Quat);
2901
+ const con2Quat = new THREE.Quaternion();
2902
+ con2.getWorldQuaternion(con2Quat);
2903
+ const con1QuatParent = new THREE.Quaternion();
2904
+ con1.parent.getWorldQuaternion(con1QuatParent);
2905
+ const con2QuatParent = new THREE.Quaternion();
2906
+ con2.parent.getWorldQuaternion(con2QuatParent);
2907
+ const rotation = new THREE.Quaternion().multiplyQuaternions(con1Quat.invert(), con2Quat).multiply(new THREE.Quaternion().multiplyQuaternions(con1QuatParent, con1QuatParent));
2908
+ con2.parent.quaternion.copy(rotation);
2909
+ // Update because the matrix has been tempered with
2910
+ scene.updateMatrixWorld(true);
2911
+ // Move the connectors towards eachother
2912
+ const con1Pos = new THREE.Vector3();
2913
+ con1.getWorldPosition(con1Pos);
2914
+ const con2Pos = new THREE.Vector3();
2915
+ con2.getWorldPosition(con2Pos);
2916
+ const move = con1Pos.sub(con2Pos);
2917
+ con2.parent.position.x += move.x;
2918
+ con2.parent.position.y += move.y;
2919
+ con2.parent.position.z += move.z;
2920
+ // reset parent's objects rotation and position
2921
+ parent.rotation.copy(motherRotation);
2922
+ parent.position.copy(motherPosition);
2923
+ scene.updateMatrixWorld(true);
2924
+ // Set the connected flag
2925
+ con1['connected'] = true;
2926
+ con2['connected'] = true;
2927
+ return true;
2928
+ }
2929
+ }
2930
+ exports.SceneUtils = SceneUtils;
2931
+
2932
+
2933
+ /***/ }),
2934
+
2935
+ /***/ 22674:
2936
+ /*!***********************************!*\
2937
+ !*** ./src/utils/threed.utils.ts ***!
2938
+ \***********************************/
2939
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2940
+
2941
+ "use strict";
2942
+
2943
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
2944
+ exports.ThreedUtils = void 0;
2945
+ const tslib_1 = __webpack_require__(/*! tslib */ 42321);
2946
+ const THREE = tslib_1.__importStar(__webpack_require__(/*! three */ 30712));
2947
+ const object_utils_1 = __webpack_require__(/*! ./object.utils */ 37922);
2948
+ class ThreedUtils {
2949
+ constructor() {
2950
+ this._objectCache = new Map();
2951
+ }
2952
+ clearCache() {
2953
+ const objs = Array.from(this._objectCache.values());
2954
+ objs.forEach(o => object_utils_1.ObjectUtils.DisposeObject(o));
2955
+ this._objectCache.clear();
2956
+ }
2957
+ download3DSource(fileName, assetPath) {
2958
+ return new Promise((resolve, reject) => tslib_1.__awaiter(this, void 0, void 0, function* () {
2959
+ fileName = fileName.replace('.unity3d', '');
2960
+ let lookupFileName = fileName + (fileName.indexOf('.glb') < 0 ? '.glb' : '');
2961
+ if (this._objectCache.has(lookupFileName)) {
2962
+ resolve(this._objectCache.get(lookupFileName));
2963
+ return;
2964
+ }
2965
+ this.loadGlbSource(lookupFileName)
2966
+ .then((obj) => {
2967
+ this._objectCache.set(lookupFileName, obj);
2968
+ resolve(obj);
2969
+ })
2970
+ .catch(() => {
2971
+ reject(`GLB source not found! (${lookupFileName})`);
2972
+ });
2973
+ }));
2974
+ }
2975
+ readFileAsText(file) {
2976
+ const fileReader = new FileReader();
2977
+ return new Promise((resolve, reject) => {
2978
+ fileReader.onload = (e) => resolve(e.target.result);
2979
+ fileReader.onerror = error => reject(error);
2980
+ fileReader.readAsText(file);
2981
+ });
2982
+ }
2983
+ loadJsonModel(filePath) {
2984
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
2985
+ if (this._objectCache.has(filePath)) {
2986
+ return Promise.resolve(this._objectCache.get(filePath));
2987
+ }
2988
+ const json = yield this._readJsonFile(filePath);
2989
+ const loader = new THREE.ObjectLoader();
2990
+ loader.crossOrigin = 'Anonymous';
2991
+ return new Promise((resolve, reject) => {
2992
+ try {
2993
+ const obj = loader.parse(json);
2994
+ this._objectCache.set(filePath, obj);
2995
+ resolve(obj);
2996
+ }
2997
+ catch (e) {
2998
+ reject(null);
2999
+ }
3000
+ });
3001
+ });
3002
+ }
3003
+ loadJsonObjectModel(filePath) {
3004
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
3005
+ if (this._objectCache.has(filePath)) {
3006
+ return Promise.resolve(this._objectCache.get(filePath));
3007
+ }
3008
+ const loader = new THREE.ObjectLoader();
3009
+ loader.setCrossOrigin('Anonymous');
3010
+ loader.setResourcePath('');
3011
+ return new Promise((resolve, reject) => {
3012
+ loader.load(filePath, (object) => {
3013
+ const obj = (object.type === 'Scene' && object.children[0].type === 'Object3D') ? object.children[0] : object;
3014
+ this._objectCache.set(filePath, obj);
3015
+ resolve(obj);
3016
+ }, xhr => null, error => reject(error));
3017
+ });
3018
+ });
3019
+ }
3020
+ loadGlbModel(file, cleanUp = true) {
3021
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
3022
+ if (this._objectCache.has(file)) {
3023
+ return Promise.resolve(this._objectCache.get(file));
3024
+ }
3025
+ if (!window.hasOwnProperty('loadGLTF')) {
3026
+ console.error('loadGLTF not defined in window global');
3027
+ return null;
3028
+ }
3029
+ // const loader = new GLTFLoader();
3030
+ const obj = yield window.loadGLTF(file);
3031
+ if (obj) {
3032
+ this._cleanedUpObjects(obj, cleanUp);
3033
+ this._objectCache.set(file, obj);
3034
+ return obj;
3035
+ }
3036
+ else {
3037
+ return null;
3038
+ }
3039
+ });
3040
+ }
3041
+ loadGlbSource(file) {
3042
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
3043
+ const obj = yield this.loadGlbModel(file, false);
3044
+ if (obj) {
3045
+ obj.children = obj.children.filter(c => !(c instanceof THREE.Camera));
3046
+ obj.children.sort((a, b) => a['name'] < b['name'] ? 1 : -1);
3047
+ obj.children.forEach((c) => {
3048
+ c.traverse((t) => {
3049
+ t.visible = !t.name.toLowerCase().startsWith('c_');
3050
+ });
3051
+ c.visible = false;
3052
+ });
3053
+ if (obj.children.length === 1 && obj.children[0] instanceof THREE.Group) { // flatten children
3054
+ const children = obj.children[0].children.slice();
3055
+ const name = obj.children[0].name;
3056
+ obj.children.length = 0;
3057
+ const parent = new THREE.Object3D();
3058
+ parent.name = name;
3059
+ parent.children = children;
3060
+ obj.add(parent);
3061
+ }
3062
+ }
3063
+ return obj;
3064
+ });
3065
+ }
3066
+ textureFromUrl(url) {
3067
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
3068
+ // url = this._includeBaseUrl(url);
3069
+ return new Promise((resolve, reject) => {
3070
+ const textureLoader = new THREE.TextureLoader();
3071
+ // textureLoader.setBaseU(this._settingsService.settings.assetPath);
3072
+ textureLoader.load(url, (texture) => {
3073
+ texture.wrapT = THREE.RepeatWrapping;
3074
+ texture.wrapS = THREE.RepeatWrapping;
3075
+ texture.repeat.set(1, 1);
3076
+ texture.needsUpdate = true;
3077
+ return resolve(texture);
3078
+ }, null, reject);
3079
+ });
3080
+ });
3081
+ }
3082
+ _cleanedUpObjects(object, cleanUp = true) {
3083
+ let obj = new THREE.Object3D();
3084
+ object.children.forEach((c) => {
3085
+ if (!(c instanceof THREE.Camera)) {
3086
+ if (cleanUp && c instanceof THREE.Group || (c.children.length === 1 && c.children[0] instanceof THREE.Group)) {
3087
+ this._addGroupChildrenToObject(c, obj);
3088
+ }
3089
+ else if ((cleanUp && !(c instanceof THREE.Mesh)) || (!(c instanceof THREE.Mesh) && !c.name && c.children.length > 0)) {
3090
+ c.children.forEach((child) => {
3091
+ child.translateY(c.position.y);
3092
+ });
3093
+ c.translateY(-c.position.y);
3094
+ if (obj.children.length > 0) {
3095
+ obj.add(c.clone());
3096
+ }
3097
+ else {
3098
+ obj = c.clone();
3099
+ }
3100
+ }
3101
+ else {
3102
+ // if (c.position.y > 0 || c.position.y < 0) {
3103
+ // c.children.forEach((child) => {
3104
+ // child.translateY(c.position.y);
3105
+ // });
3106
+ // c.translateY(-c.position.y);
3107
+ // }
3108
+ obj.add(c.clone());
3109
+ }
3110
+ }
3111
+ });
3112
+ const boundingBox = new THREE.Box3().setFromObject(obj);
3113
+ const bbCenterPivot = new THREE.Vector3();
3114
+ boundingBox.getCenter(bbCenterPivot);
3115
+ const delta = new THREE.Vector3().add(bbCenterPivot).negate();
3116
+ obj.children.forEach((cc) => {
3117
+ cc.position.add(delta);
3118
+ });
3119
+ return obj;
3120
+ }
3121
+ _addGroupChildrenToObject(group, obj, cleanUp = true) {
3122
+ group.children.forEach((gc) => {
3123
+ if (cleanUp && gc instanceof THREE.Group) {
3124
+ this._addGroupChildrenToObject(gc, obj);
3125
+ }
3126
+ else {
3127
+ // gc.translateX(-group.position.x);
3128
+ gc.translateY(group.position.y);
3129
+ // gc.translateZ(-group.position.z);
3130
+ obj.add(gc.clone());
3131
+ }
3132
+ });
3133
+ }
3134
+ _iterateChildren(children, callback) {
3135
+ for (let i = 0; i < children.length; i++) {
3136
+ const child = children[i];
3137
+ if (child instanceof THREE.Mesh) {
3138
+ callback(child);
3139
+ }
3140
+ else {
3141
+ this._iterateChildren(child.children, callback);
3142
+ }
3143
+ }
3144
+ }
3145
+ _readJsonFile(filePath) {
3146
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
3147
+ try {
3148
+ const response = yield fetch(filePath);
3149
+ if (!response.ok) {
3150
+ return '';
3151
+ }
3152
+ else {
3153
+ let empty = false;
3154
+ yield response.clone().text().then((value) => {
3155
+ if (value === '') {
3156
+ empty = true;
3157
+ }
3158
+ });
3159
+ return empty ? {} : response.json();
3160
+ }
3161
+ }
3162
+ catch (e) {
3163
+ return '';
3164
+ }
3165
+ });
3166
+ }
3167
+ }
3168
+ exports.ThreedUtils = ThreedUtils;
3169
+
3170
+
3171
+ /***/ }),
3172
+
3173
+ /***/ 4876:
3174
+ /*!**************************************!*\
3175
+ !*** ./src/utils/variation-utils.ts ***!
3176
+ \**************************************/
3177
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3178
+
3179
+ "use strict";
3180
+
3181
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
3182
+ exports.VariationUtils = void 0;
3183
+ const tslib_1 = __webpack_require__(/*! tslib */ 42321);
3184
+ const variation_settings_1 = __webpack_require__(/*! ../model/variation-settings */ 95664);
3185
+ // @ts-ignore
3186
+ const jszip_1 = tslib_1.__importDefault(__webpack_require__(/*! jszip */ 17284));
3187
+ const three_1 = __webpack_require__(/*! three */ 30712);
3188
+ // @dynamic
3189
+ class VariationUtils {
3190
+ static ClearCache() {
3191
+ this.MaterialCache.clear();
3192
+ }
3193
+ static LoadVariation(assetPath, fileName) {
3194
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
3195
+ if (!fileName) {
3196
+ return null;
3197
+ }
3198
+ if (!fileName.includes('ione3d')) {
3199
+ fileName = fileName.concat('.ione3d');
3200
+ }
3201
+ const id = fileName.substring(0, fileName.lastIndexOf('.ione3d'));
3202
+ if (!assetPath.endsWith('/')) {
3203
+ assetPath += '/';
3204
+ }
3205
+ if (!window.hasOwnProperty('downloadVariation')) {
3206
+ console.error('downloadVariation not defined in window global');
3207
+ throw new Error('downloadVariation not defined in window global');
3208
+ }
3209
+ if (this.MaterialCache.has(id)) {
3210
+ return this.MaterialCache.get(id);
3211
+ }
3212
+ try {
3213
+ const file = yield window.downloadVariation(`${assetPath.replace('https://cdn1.colijn-it.nl/', '')}variation/${fileName}`);
3214
+ const settings = yield VariationUtils.GetVariationSettingsFromFile(id, file);
3215
+ this.MaterialCache.set(id, settings);
3216
+ return settings;
3217
+ }
3218
+ catch (err) {
3219
+ console.error('Error loading variation:', err);
3220
+ throw err;
3221
+ }
3222
+ });
3223
+ }
3224
+ // public static GetMaterialFromName(variationFolder: string, material: any): Promise<MeshStandardMaterial> {
3225
+ // return new Promise((resolve: Function) => {
3226
+ // if (!material) {
3227
+ // resolve(null);
3228
+ // }
3229
+ // if (this.MaterialCache.has(material.name)) {
3230
+ // resolve(this.MaterialCache.get(material.name).clone());
3231
+ // } else {
3232
+ // VariationUtils.LoadVariation(variationFolder, material.name, false).then((settings: VariationSettings) => {
3233
+ // if (settings) {
3234
+ // AssetUtils.CreateMaterialFromAsset(settings).then((materialObj: Material) => {
3235
+ // const materialParams: MeshStandardMaterialParameters = {};
3236
+ // materialParams.name = material.name;
3237
+ // materialParams.map = materialObj.texture;
3238
+ // materialParams.normalMap = materialObj.normal;
3239
+ // materialParams.aoMap = materialObj.ao;
3240
+ // materialParams.roughnessMap = materialObj.roughness;
3241
+ // materialParams.metalnessMap = materialObj.metalness;
3242
+ // materialParams.roughness = 1;
3243
+ // materialParams.metalness = 1;
3244
+ // const pbrMat: MeshStandardMaterial = new MeshStandardMaterial(materialParams);
3245
+ // this.MaterialCache.set(material.name, pbrMat);
3246
+ // resolve(pbrMat.clone());
3247
+ // });
3248
+ // } else {
3249
+ // resolve(material);
3250
+ // }
3251
+ // });
3252
+ // }
3253
+ // });
3254
+ // }
3255
+ static GetVariationSettingsFromFile(id, compressedFile) {
3256
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
3257
+ if (!compressedFile) {
3258
+ return null;
3259
+ }
3260
+ const zipContent = yield VariationUtils.GetZipContent(compressedFile);
3261
+ const variationSettings = new variation_settings_1.VariationSettings();
3262
+ let index;
3263
+ variationSettings.id = id;
3264
+ if (zipContent) {
3265
+ if (zipContent.files['material.glb']) {
3266
+ const material = yield zipContent.files['material.glb'].async('arraybuffer');
3267
+ variationSettings.material = yield VariationUtils.LoadMaterialFromGlb(material);
3268
+ }
3269
+ else {
3270
+ if (zipContent.files['index.json']) {
3271
+ const indexFile = yield zipContent.files['index.json'].async('string');
3272
+ index = JSON.parse(indexFile);
3273
+ }
3274
+ if (index) {
3275
+ yield VariationUtils.CreateSettingsBasedOnIndex(index, variationSettings, zipContent);
3276
+ }
3277
+ else {
3278
+ yield VariationUtils.CreateSettingsBasedOnFileName(variationSettings, zipContent);
3279
+ }
3280
+ }
3281
+ }
3282
+ return variationSettings;
3283
+ });
3284
+ }
3285
+ static CreateSettingsBasedOnIndex(index, variationSettings, zipContent) {
3286
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
3287
+ if (index.normalFile) {
3288
+ variationSettings.normal = yield VariationUtils.LoadFileContentFromZip(zipContent.files[index.normalFile], index.normalFile);
3289
+ variationSettings.normalFilename = index.normalFile;
3290
+ }
3291
+ if (index.diffuseFile) {
3292
+ variationSettings.texture = yield VariationUtils.LoadFileContentFromZip(zipContent.files[index.diffuseFile], index.diffuseFile);
3293
+ variationSettings.textureFilename = index.diffuseFile;
3294
+ }
3295
+ if (index.ormFile) {
3296
+ variationSettings.orm = yield VariationUtils.LoadFileContentFromZip(zipContent.files[index.ormFile], index.ormFile);
3297
+ variationSettings.ormFilename = index.ormFile;
3298
+ }
3299
+ else {
3300
+ if (index.aoFile) {
3301
+ variationSettings.ao = yield VariationUtils.LoadFileContentFromZip(zipContent.files[index.aoFile], index.aoFile);
3302
+ variationSettings.aoFilename = index.aoFile;
3303
+ }
3304
+ if (index.metalnessFile) {
3305
+ variationSettings.metalness = yield VariationUtils.LoadFileContentFromZip(zipContent.files[index.metalnessFile], index.metalnessFile);
3306
+ variationSettings.metalnessFilename = index.metalnessFile;
3307
+ }
3308
+ if (index.roughnessFile) {
3309
+ variationSettings.roughness = yield VariationUtils.LoadFileContentFromZip(zipContent.files[index.roughnessFile], index.roughnessFile);
3310
+ variationSettings.roughnessFilename = index.roughnessFile;
3311
+ }
3312
+ }
3313
+ if (index.displacementFile) {
3314
+ variationSettings.displacement = yield VariationUtils.LoadFileContentFromZip(zipContent.files[index.displacementFile], index.displacementFile);
3315
+ variationSettings.displacementFilename = index.displacementFile;
3316
+ }
3317
+ if (index.emissiveFile) {
3318
+ variationSettings.emissive = yield VariationUtils.LoadFileContentFromZip(zipContent.files[index.emissiveFile], index.emissiveFile);
3319
+ variationSettings.emissiveFilename = index.emissiveFile;
3320
+ }
3321
+ if (index.envMapFile) {
3322
+ variationSettings.envMap = yield VariationUtils.LoadFileContentFromZip(zipContent.files[index.envMapFile], index.envMapFile);
3323
+ variationSettings.envMapFilename = index.envMapFile;
3324
+ }
3325
+ if (index.sheenColorMapFile) {
3326
+ variationSettings.sheenColorMap = yield VariationUtils.LoadFileContentFromZip(zipContent.files[index.sheenColorMapFile], index.sheenColorMapFile);
3327
+ variationSettings.sheenColorMapFilename = index.sheenColorMapFile;
3328
+ }
3329
+ if (index.sheenRoughnessMapFile) {
3330
+ variationSettings.sheenRoughnessMap = yield VariationUtils.LoadFileContentFromZip(zipContent.files[index.sheenRoughnessMapFile], index.sheenRoughnessMapFile);
3331
+ variationSettings.sheenRoughnessMapFilename = index.sheenColorMapFile;
3332
+ }
3333
+ if (index.transmissionMapFile) {
3334
+ variationSettings.transmissionMap = yield VariationUtils.LoadFileContentFromZip(zipContent.files[index.transmissionMapFile], index.transmissionMapFile);
3335
+ variationSettings.transmissionMapFilename = index.transmissionMapFile;
3336
+ }
3337
+ if (index.repeat) {
3338
+ variationSettings.settings.repeatx = index.repeat.repeatx;
3339
+ variationSettings.settings.repeaty = index.repeat.repeaty;
3340
+ }
3341
+ variationSettings.settings.metalness = index.metalness;
3342
+ variationSettings.settings.roughness = index.roughness;
3343
+ if (index.sheen && typeof index.sheen === 'object') {
3344
+ variationSettings.sheen = 1;
3345
+ variationSettings.sheenColor = new three_1.Color(index.sheen.r, index.sheen.g, index.sheen.b).getHexString(three_1.SRGBColorSpace);
3346
+ }
3347
+ else {
3348
+ variationSettings.sheen = index.sheen;
3349
+ }
3350
+ if (index.sheenColor) {
3351
+ variationSettings.sheenColor = new three_1.Color(index.sheenColor.r, index.sheenColor.g, index.sheenColor.b).getHexString(three_1.SRGBColorSpace);
3352
+ }
3353
+ variationSettings.sheenRoughness = index.sheenRoughness;
3354
+ variationSettings.envMapIntensity = index.envMapIntensity;
3355
+ variationSettings.transparent = index.transparent;
3356
+ variationSettings.opacity = index.opacity;
3357
+ if (index.emissiveValue) {
3358
+ variationSettings.emissiveValue = new three_1.Color(index.emissiveValue.r, index.emissiveValue.g, index.emissiveValue.b).getHexString(three_1.SRGBColorSpace);
3359
+ }
3360
+ variationSettings.emissiveIntensity = index.emissiveIntensity;
3361
+ variationSettings.reflectivity = index.reflectivity;
3362
+ variationSettings.displacementValue = index.displacementValue;
3363
+ variationSettings.side = index.side;
3364
+ variationSettings.transmission = index.transmission;
3365
+ variationSettings.ior = index.ior;
3366
+ variationSettings.thickness = index.thickness;
3367
+ variationSettings.specularIntensity = index.specularIntensity;
3368
+ });
3369
+ }
3370
+ static CreateSettingsBasedOnFileName(variationSettings, zipContent) {
3371
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
3372
+ const allLoaded = [];
3373
+ for (const fileName in zipContent.files) {
3374
+ if (zipContent.files.hasOwnProperty(fileName)) {
3375
+ const file = yield zipContent.files[fileName];
3376
+ if (file.name.toLowerCase().indexOf('normal') > -1 && this.FileIsImage(file.name)) {
3377
+ allLoaded.push(zipContent.files[fileName].async('base64').then((normalFile) => {
3378
+ variationSettings.normal = `data:image/${this.GetBase64FileType(file.name)};base64,${normalFile}`;
3379
+ variationSettings.normalFilename = fileName;
3380
+ }));
3381
+ }
3382
+ else if (file.name.toLowerCase().indexOf('ao') > -1 && this.FileIsImage(file.name)) {
3383
+ allLoaded.push(zipContent.files[fileName].async('base64').then((aoFile) => {
3384
+ variationSettings.ao = `data:image/${this.GetBase64FileType(file.name)};base64,${aoFile}`;
3385
+ variationSettings.aoFilename = fileName;
3386
+ }));
3387
+ }
3388
+ else if (file.name.toLowerCase().indexOf('metalness') > -1 && this.FileIsImage(file.name)) {
3389
+ allLoaded.push(zipContent.files[fileName].async('base64').then((metalnessFile) => {
3390
+ variationSettings.metalness = `data:image/${this.GetBase64FileType(file.name)};base64,${metalnessFile}`;
3391
+ variationSettings.metalnessFilename = fileName;
3392
+ }));
3393
+ }
3394
+ else if (file.name.toLowerCase().indexOf('roughness') > -1 && this.FileIsImage(file.name)) {
3395
+ allLoaded.push(zipContent.files[fileName].async('base64').then((roughnessFile) => {
3396
+ variationSettings.roughness = `data:image/${this.GetBase64FileType(file.name)};base64,${roughnessFile}`;
3397
+ variationSettings.roughnessFilename = fileName;
3398
+ }));
3399
+ }
3400
+ else if (file.name.toLowerCase().indexOf('diffuse') > -1 && this.FileIsImage(file.name)) {
3401
+ allLoaded.push(zipContent.files[fileName].async('base64').then((diffuseFile) => {
3402
+ variationSettings.texture = `data:image/${this.GetBase64FileType(file.name)};base64,${diffuseFile}`;
3403
+ variationSettings.textureFilename = fileName;
3404
+ }));
3405
+ }
3406
+ else if (file.name.toLowerCase().indexOf('displacement') > -1 && this.FileIsImage(file.name)) {
3407
+ allLoaded.push(zipContent.files[fileName].async('base64').then((displacementFile) => {
3408
+ variationSettings.displacement = `data:image/${this.GetBase64FileType(file.name)};base64,${displacementFile}`;
3409
+ variationSettings.displacementFilename = fileName;
3410
+ }));
3411
+ }
3412
+ else if (file.name.toLowerCase().indexOf('emissive') > -1 && this.FileIsImage(file.name)) {
3413
+ allLoaded.push(zipContent.files[fileName].async('base64').then((emissiveFile) => {
3414
+ variationSettings.emissive = `data:image/${this.GetBase64FileType(file.name)};base64,${emissiveFile}`;
3415
+ variationSettings.emissiveFilename = fileName;
3416
+ }));
3417
+ }
3418
+ else if (file.name.toLowerCase().indexOf('envMap') > -1 && this.FileIsImage(file.name)) {
3419
+ allLoaded.push(zipContent.files[fileName].async('base64').then((envMapFile) => {
3420
+ variationSettings.envMap = `data:image/${this.GetBase64FileType(file.name)};base64,${envMapFile}`;
3421
+ variationSettings.envMapFilename = fileName;
3422
+ }));
3423
+ }
3424
+ else if (file.name.toLowerCase().indexOf('sheenColorMap') > -1 && this.FileIsImage(file.name)) {
3425
+ allLoaded.push(zipContent.files[fileName].async('base64').then((sheenColorMapFile) => {
3426
+ variationSettings.sheenColorMap = `data:image/${this.GetBase64FileType(file.name)};base64,${sheenColorMapFile}`;
3427
+ variationSettings.sheenColorMapFilename = fileName;
3428
+ }));
3429
+ }
3430
+ else if (file.name.toLowerCase().indexOf('sheenRoughnessMap') > -1 && this.FileIsImage(file.name)) {
3431
+ allLoaded.push(zipContent.files[fileName].async('base64').then((sheenRoughnessMapFile) => {
3432
+ variationSettings.sheenRoughnessMap = `data:image/${this.GetBase64FileType(file.name)};base64,${sheenRoughnessMapFile}`;
3433
+ variationSettings.sheenRoughnessMapFilename = fileName;
3434
+ }));
3435
+ }
3436
+ else if (file.name.toLowerCase().indexOf('transmissionMap') > -1 && this.FileIsImage(file.name)) {
3437
+ allLoaded.push(zipContent.files[fileName].async('base64').then((transmissionMapFile) => {
3438
+ variationSettings.transmissionMap = `data:image/${this.GetBase64FileType(file.name)};base64,${transmissionMapFile}`;
3439
+ variationSettings.transmissionMapFilename = fileName;
3440
+ }));
3441
+ }
3442
+ else if (file.name.indexOf('.jp') > -1) {
3443
+ allLoaded.push(zipContent.files[fileName].async('base64').then((textureFile) => {
3444
+ variationSettings.texture = 'data:image/jpeg;base64,' + textureFile;
3445
+ variationSettings.textureFilename = fileName;
3446
+ }));
3447
+ }
3448
+ else if (file.name.indexOf('.json') > -1) {
3449
+ allLoaded.push(zipContent.files[fileName].async('string').then((settingsFile) => {
3450
+ const settingsFileObj = JSON.parse(settingsFile);
3451
+ for (const key in settingsFileObj) {
3452
+ if (settingsFileObj.hasOwnProperty(key)) {
3453
+ variationSettings.settings[key] = settingsFileObj[key];
3454
+ }
3455
+ }
3456
+ }));
3457
+ }
3458
+ }
3459
+ }
3460
+ yield Promise.all(allLoaded);
3461
+ });
3462
+ }
3463
+ static LoadMaterialFromJson(material) {
3464
+ const loader = new three_1.MaterialLoader();
3465
+ if (material.textures) {
3466
+ const textures = {};
3467
+ for (let i = 0; i < material.textures.length; i++) {
3468
+ textures[material.textures[i].uuid] = material.textures[i];
3469
+ }
3470
+ loader.setTextures(textures);
3471
+ }
3472
+ return loader.parse(material);
3473
+ }
3474
+ static LoadMaterialFromGlb(material) {
3475
+ return new Promise((resolve, reject) => tslib_1.__awaiter(this, void 0, void 0, function* () {
3476
+ if (!window.hasOwnProperty('loadGLTF')) {
3477
+ console.error('loadGLTF not defined in window global');
3478
+ return reject();
3479
+ }
3480
+ const obj = yield window.loadGLTF(material, false);
3481
+ if (obj) {
3482
+ return resolve(obj.children[0].material);
3483
+ }
3484
+ }));
3485
+ }
3486
+ static LoadFileContentFromZip(zip, fileName, base64 = true) {
3487
+ return new Promise((resolve) => {
3488
+ if (zip && fileName) {
3489
+ zip.async(base64 ? 'base64' : 'string').then((fileContent) => {
3490
+ if (base64) {
3491
+ resolve(`data:image/${this.GetBase64FileType(fileName)};base64,${fileContent}`);
3492
+ }
3493
+ else {
3494
+ resolve(fileContent);
3495
+ }
3496
+ });
3497
+ }
3498
+ else {
3499
+ resolve(undefined);
3500
+ }
3501
+ });
3502
+ }
3503
+ static FileIsImage(fileName) {
3504
+ const ext = fileName.substring(fileName.lastIndexOf('.') + 1, fileName.length).toLowerCase();
3505
+ switch (ext) {
3506
+ case 'jpg':
3507
+ case 'jpeg':
3508
+ case 'png':
3509
+ case 'bmp':
3510
+ return true;
3511
+ default:
3512
+ return false;
3513
+ }
3514
+ }
3515
+ static GetBase64FileType(fileName) {
3516
+ const ext = fileName.substring(fileName.lastIndexOf('.') + 1, fileName.length).toLowerCase();
3517
+ switch (ext) {
3518
+ case 'jpg':
3519
+ case 'jpeg':
3520
+ return 'jpeg';
3521
+ case 'png':
3522
+ return 'png';
3523
+ case 'bmp':
3524
+ return 'bmp';
3525
+ default:
3526
+ return 'jpeg';
3527
+ }
3528
+ }
3529
+ // Get the content
3530
+ static GetZipContent(file) {
3531
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
3532
+ try {
3533
+ const jszip = new jszip_1.default();
3534
+ return yield jszip.loadAsync(file);
3535
+ }
3536
+ catch (e) {
3537
+ return null;
3538
+ }
3539
+ });
3540
+ }
3541
+ }
3542
+ exports.VariationUtils = VariationUtils;
3543
+ VariationUtils.MaterialCache = new Map();
3544
+
3545
+
3546
+ /***/ })
3547
+
3548
+ },
3549
+ /******/ __webpack_require__ => { // webpackRuntimeModules
3550
+ /******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
3551
+ /******/ __webpack_require__.O(0, ["vendor"], () => (__webpack_exec__(14431)));
3552
+ /******/ var __webpack_exports__ = __webpack_require__.O();
3553
+ /******/ }
3554
+ ]);
3555
+ //# sourceMappingURL=main.js.map