@crystaldesign/web-planner-logic 25.13.0-beta.29 → 25.13.0-beta.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/build/cjs/{DivaBoxPlanner-a1c27537.js → DivaBoxPlanner-19fff9fc.js} +2 -2
  2. package/build/cjs/{DivaStandardPlanner-cafdfb2e.js → DivaStandardPlanner-e13f9c94.js} +2 -2
  3. package/build/cjs/{DoorPlanner-b10008cf.js → DoorPlanner-9eee1c48.js} +1 -1
  4. package/build/cjs/{Host3DSignalR-37a3c53c.js → Host3DSignalR-eab2939e.js} +1 -1
  5. package/build/cjs/{LiviqueWWSHandler-f2975f8d.js → LiviqueWWSHandler-469f6583.js} +1 -1
  6. package/build/cjs/{PfisterWWSHandler-3f6e9c5e.js → PfisterWWSHandler-64e350c5.js} +1 -1
  7. package/build/cjs/{PlannerHandler2D-7939f975.js → PlannerHandler2D-787ed37c.js} +1 -1
  8. package/build/cjs/{SeriousBasketHandler-2826d982.js → SeriousBasketHandler-f367ca39.js} +1 -1
  9. package/build/cjs/{ShelfPlanner-fceba713.js → ShelfPlanner-ec459d7e.js} +1 -1
  10. package/build/cjs/{StandardWWSHandler-5713c9cb.js → StandardWWSHandler-0dff1df3.js} +1 -1
  11. package/build/cjs/{index-dc20d142.js → index-9720b39c.js} +773 -295
  12. package/build/cjs/index.js +1 -1
  13. package/build/esm/{DivaBoxPlanner-5b83551f.js → DivaBoxPlanner-07aaffc1.js} +2 -2
  14. package/build/esm/{DivaStandardPlanner-a1ed202f.js → DivaStandardPlanner-8659772b.js} +2 -2
  15. package/build/esm/{DoorPlanner-ac18a82d.js → DoorPlanner-1856ede2.js} +1 -1
  16. package/build/esm/{Host3DSignalR-2cbcb371.js → Host3DSignalR-06c1d471.js} +1 -1
  17. package/build/esm/{LiviqueWWSHandler-4dfa4c29.js → LiviqueWWSHandler-d6dc0f40.js} +1 -1
  18. package/build/esm/{PfisterWWSHandler-7f788dde.js → PfisterWWSHandler-1c4b02d4.js} +1 -1
  19. package/build/esm/{PlannerHandler2D-cfc90a6d.js → PlannerHandler2D-c6ad67ab.js} +1 -1
  20. package/build/esm/{SeriousBasketHandler-b1914906.js → SeriousBasketHandler-1cbe7a5b.js} +1 -1
  21. package/build/esm/{ShelfPlanner-82a898e8.js → ShelfPlanner-d4025911.js} +1 -1
  22. package/build/esm/{StandardWWSHandler-6d40ee75.js → StandardWWSHandler-b109a3d8.js} +1 -1
  23. package/build/esm/{index-2a468898.js → index-df78379b.js} +773 -295
  24. package/build/esm/index.js +1 -1
  25. package/build/types/web-planner-logic/src/index.d.ts +3 -2
  26. package/build/types/web-planner-logic/src/index.d.ts.map +1 -1
  27. package/build/types/web-planner-logic/src/interface/API/AiImageResult.d.ts +50 -0
  28. package/build/types/web-planner-logic/src/interface/API/AiImageResult.d.ts.map +1 -0
  29. package/build/types/web-planner-logic/src/interface/CoreTypes/index.d.ts +2 -0
  30. package/build/types/web-planner-logic/src/interface/CoreTypes/index.d.ts.map +1 -1
  31. package/build/types/web-planner-logic/src/interface/ViewTypes/index.d.ts +9 -0
  32. package/build/types/web-planner-logic/src/interface/ViewTypes/index.d.ts.map +1 -1
  33. package/build/types/web-planner-logic/src/interface/webPlannerParams/WebPlannerParamsType.d.ts +6 -1
  34. package/build/types/web-planner-logic/src/interface/webPlannerParams/WebPlannerParamsType.d.ts.map +1 -1
  35. package/build/types/web-planner-logic/src/logic/DivaApiHandler.d.ts +26 -0
  36. package/build/types/web-planner-logic/src/logic/DivaApiHandler.d.ts.map +1 -1
  37. package/build/types/web-planner-logic/src/logic/DivaWebPlanner.d.ts +18 -1
  38. package/build/types/web-planner-logic/src/logic/DivaWebPlanner.d.ts.map +1 -1
  39. package/build/types/web-planner-logic/src/logic/Planner/DivaPlannerHandler.d.ts +2 -1
  40. package/build/types/web-planner-logic/src/logic/Planner/DivaPlannerHandler.d.ts.map +1 -1
  41. package/build/types/web-planner-logic/src/logic/Planner/Rendering/DivaMediaServiceHandler.d.ts +10 -0
  42. package/build/types/web-planner-logic/src/logic/Planner/Rendering/DivaMediaServiceHandler.d.ts.map +1 -1
  43. package/build/types/web-planner-logic/src/logic/Planner/Rendering/PlannerHandler3D.d.ts.map +1 -1
  44. package/build/types/web-planner-logic/src/logic/Planner/Rendering/Rendering.d.ts.map +1 -1
  45. package/build/types/web-planner-logic/src/logic/Set/DivaSet.d.ts +7 -0
  46. package/build/types/web-planner-logic/src/logic/Set/DivaSet.d.ts.map +1 -1
  47. package/build/types/web-planner-logic/src/logic/Set/DivaSetHandler.d.ts +2 -1
  48. package/build/types/web-planner-logic/src/logic/Set/DivaSetHandler.d.ts.map +1 -1
  49. package/build/types/web-planner-logic/src/test/datas/environments/scripts/pfister-prod.d.ts.map +1 -1
  50. package/build/types/web-planner-logic/src/test/datas/environments/scripts/pfister-quality.d.ts.map +1 -1
  51. package/build/types/web-planner-logic/src/test/datas/environments/testing/pfister-dev.d.ts.map +1 -1
  52. package/build/types/web-planner-logic/src/test/datas/environments/testing/retail-dev.d.ts.map +1 -1
  53. package/build/types/web-planner-logic/src/test/datas/environments/testing/retail-test.d.ts.map +1 -1
  54. package/package.json +2 -2
@@ -28,6 +28,8 @@ import _typeof from '@babel/runtime/helpers/typeof';
28
28
  var _excluded = ["type"];
29
29
  function ownKeys$k(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
30
30
  function _objectSpread$k(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$k(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$k(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
31
+ // Import types from AI service
32
+
31
33
  var LOG$p = DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
32
34
  var JsonDataCache = /*#__PURE__*/function () {
33
35
  function JsonDataCache() {
@@ -82,6 +84,26 @@ var DivaApiHandler = /*#__PURE__*/function () {
82
84
  }
83
85
  }
84
86
  return _createClass(DivaApiHandler, [{
87
+ key: "getAiServiceAuthHeaders",
88
+ value:
89
+ /**
90
+ * Get standardized authentication headers for AI service calls
91
+ */
92
+ function getAiServiceAuthHeaders(leadKey) {
93
+ var headers = {};
94
+ if (this.jwt) headers = {
95
+ Authorization: 'Bearer ' + this.jwt
96
+ };else if (this.apiKey) headers = {
97
+ 'X-API-KEY': this.apiKey
98
+ };
99
+
100
+ // Add lead key header if provided
101
+ if (leadKey) {
102
+ headers['x-lead-key'] = leadKey;
103
+ }
104
+ return headers;
105
+ }
106
+ }, {
85
107
  key: "setJsonDataCache",
86
108
  value: function setJsonDataCache(cache) {
87
109
  this.jsonDataCache = cache;
@@ -105,6 +127,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
105
127
  finalUrl,
106
128
  data,
107
129
  nextSkip,
130
+ _e$response,
108
131
  _args = arguments;
109
132
  return _regeneratorRuntime.wrap(function _callee$(_context) {
110
133
  while (1) switch (_context.prev = _context.next) {
@@ -176,8 +199,21 @@ var DivaApiHandler = /*#__PURE__*/function () {
176
199
  case 37:
177
200
  _context.prev = 37;
178
201
  _context.t5 = _context["catch"](4);
202
+ if (!(axios$1.isAxiosError(_context.t5) && ((_e$response = _context.t5.response) === null || _e$response === void 0 ? void 0 : _e$response.status) === 429)) {
203
+ _context.next = 42;
204
+ break;
205
+ }
206
+ LOG$p.warn('Rate limit exceeded (429) for URL: ' + url, 'DivaApiHandler.fetchData');
207
+ throw new DivaError('Rate limit exceeded. Please try again later.', {
208
+ code: 'WC_0429',
209
+ custom: {
210
+ url: url,
211
+ status: 429
212
+ }
213
+ });
214
+ case 42:
179
215
  throw Error('fetch failed! ' + url + ' Error: ' + _context.t5);
180
- case 40:
216
+ case 43:
181
217
  case "end":
182
218
  return _context.stop();
183
219
  }
@@ -498,17 +534,23 @@ var DivaApiHandler = /*#__PURE__*/function () {
498
534
  var _this$apiConfig$media, _this$apiConfig7;
499
535
  return (_this$apiConfig$media = (_this$apiConfig7 = this.apiConfig) === null || _this$apiConfig7 === void 0 ? void 0 : _this$apiConfig7.mediaService) !== null && _this$apiConfig$media !== void 0 ? _this$apiConfig$media : '';
500
536
  }
537
+ }, {
538
+ key: "getDivaAiServiceUrl",
539
+ value: function getDivaAiServiceUrl() {
540
+ var _this$apiConfig$aiSer, _this$apiConfig8;
541
+ return (_this$apiConfig$aiSer = (_this$apiConfig8 = this.apiConfig) === null || _this$apiConfig8 === void 0 ? void 0 : _this$apiConfig8.aiService) !== null && _this$apiConfig$aiSer !== void 0 ? _this$apiConfig$aiSer : '';
542
+ }
501
543
  }, {
502
544
  key: "getConstructorServiceUrl",
503
545
  value: function getConstructorServiceUrl() {
504
- var _this$apiConfig$const, _this$apiConfig8;
505
- return (_this$apiConfig$const = (_this$apiConfig8 = this.apiConfig) === null || _this$apiConfig8 === void 0 ? void 0 : _this$apiConfig8.constructorService) !== null && _this$apiConfig$const !== void 0 ? _this$apiConfig$const : '';
546
+ var _this$apiConfig$const, _this$apiConfig9;
547
+ return (_this$apiConfig$const = (_this$apiConfig9 = this.apiConfig) === null || _this$apiConfig9 === void 0 ? void 0 : _this$apiConfig9.constructorService) !== null && _this$apiConfig$const !== void 0 ? _this$apiConfig$const : '';
506
548
  }
507
549
  }, {
508
550
  key: "getDivaBasketServiceUrl",
509
551
  value: function getDivaBasketServiceUrl() {
510
- var _this$apiConfig$baske, _this$apiConfig9;
511
- return (_this$apiConfig$baske = (_this$apiConfig9 = this.apiConfig) === null || _this$apiConfig9 === void 0 ? void 0 : _this$apiConfig9.basketService) !== null && _this$apiConfig$baske !== void 0 ? _this$apiConfig$baske : '';
552
+ var _this$apiConfig$baske, _this$apiConfig10;
553
+ return (_this$apiConfig$baske = (_this$apiConfig10 = this.apiConfig) === null || _this$apiConfig10 === void 0 ? void 0 : _this$apiConfig10.basketService) !== null && _this$apiConfig$baske !== void 0 ? _this$apiConfig$baske : '';
512
554
  }
513
555
  }, {
514
556
  key: "getLoadProductBasketParams",
@@ -519,8 +561,8 @@ var DivaApiHandler = /*#__PURE__*/function () {
519
561
  }, {
520
562
  key: "get3DServerUrl",
521
563
  value: function get3DServerUrl() {
522
- var _this$apiConfig$host, _this$apiConfig10;
523
- return (_this$apiConfig$host = (_this$apiConfig10 = this.apiConfig) === null || _this$apiConfig10 === void 0 ? void 0 : _this$apiConfig10.host3d) !== null && _this$apiConfig$host !== void 0 ? _this$apiConfig$host : '';
564
+ var _this$apiConfig$host, _this$apiConfig11;
565
+ return (_this$apiConfig$host = (_this$apiConfig11 = this.apiConfig) === null || _this$apiConfig11 === void 0 ? void 0 : _this$apiConfig11.host3d) !== null && _this$apiConfig$host !== void 0 ? _this$apiConfig$host : '';
524
566
  }
525
567
  }, {
526
568
  key: "doCheckForProductsPrice",
@@ -588,9 +630,9 @@ var DivaApiHandler = /*#__PURE__*/function () {
588
630
  }, {
589
631
  key: "getBaseUrl",
590
632
  value: function getBaseUrl() {
591
- var _this$apiConfig11, _this$apiConfig12;
592
- var url = (_this$apiConfig11 = this.apiConfig) === null || _this$apiConfig11 === void 0 ? void 0 : _this$apiConfig11.api2["default"];
593
- if (this.getApplicationEnvironment() == 'WEB' && (_this$apiConfig12 = this.apiConfig) !== null && _this$apiConfig12 !== void 0 && _this$apiConfig12.api2.web) {
633
+ var _this$apiConfig12, _this$apiConfig13;
634
+ var url = (_this$apiConfig12 = this.apiConfig) === null || _this$apiConfig12 === void 0 ? void 0 : _this$apiConfig12.api2["default"];
635
+ if (this.getApplicationEnvironment() == 'WEB' && (_this$apiConfig13 = this.apiConfig) !== null && _this$apiConfig13 !== void 0 && _this$apiConfig13.api2.web) {
594
636
  url = this.apiConfig.api2.web;
595
637
  }
596
638
  if (!url) throw new Error('No API2 defined');
@@ -846,39 +888,39 @@ var DivaApiHandler = /*#__PURE__*/function () {
846
888
  }, {
847
889
  key: "apiUrl",
848
890
  value: function apiUrl(queryString, useWebServiceApi) {
849
- var _this$apiConfig23, _this$apiConfig24, _this$apiConfig25;
891
+ var _this$apiConfig24, _this$apiConfig25, _this$apiConfig26;
850
892
  if (useWebServiceApi == 'catalog') {
851
- var _this$apiConfig13, _this$apiConfig14;
852
- if (!((_this$apiConfig13 = this.apiConfig) !== null && _this$apiConfig13 !== void 0 && _this$apiConfig13.catalogService)) throw new Error('No catalog Service defined');
853
- return ((_this$apiConfig14 = this.apiConfig) === null || _this$apiConfig14 === void 0 ? void 0 : _this$apiConfig14.catalogService) + queryString;
893
+ var _this$apiConfig14, _this$apiConfig15;
894
+ if (!((_this$apiConfig14 = this.apiConfig) !== null && _this$apiConfig14 !== void 0 && _this$apiConfig14.catalogService)) throw new Error('No catalog Service defined');
895
+ return ((_this$apiConfig15 = this.apiConfig) === null || _this$apiConfig15 === void 0 ? void 0 : _this$apiConfig15.catalogService) + queryString;
854
896
  }
855
897
  if (useWebServiceApi == 'basket') {
856
- var _this$apiConfig15, _this$apiConfig16;
857
- if (!((_this$apiConfig15 = this.apiConfig) !== null && _this$apiConfig15 !== void 0 && _this$apiConfig15.basketService)) throw new Error('No basket Service defined');
858
- return ((_this$apiConfig16 = this.apiConfig) === null || _this$apiConfig16 === void 0 ? void 0 : _this$apiConfig16.basketService) + queryString;
898
+ var _this$apiConfig16, _this$apiConfig17;
899
+ if (!((_this$apiConfig16 = this.apiConfig) !== null && _this$apiConfig16 !== void 0 && _this$apiConfig16.basketService)) throw new Error('No basket Service defined');
900
+ return ((_this$apiConfig17 = this.apiConfig) === null || _this$apiConfig17 === void 0 ? void 0 : _this$apiConfig17.basketService) + queryString;
859
901
  }
860
902
  if (useWebServiceApi == 'report') {
861
- var _this$apiConfig17, _this$apiConfig18;
862
- if (!((_this$apiConfig17 = this.apiConfig) !== null && _this$apiConfig17 !== void 0 && _this$apiConfig17.reportService)) throw new Error('No report Service defined');
863
- return ((_this$apiConfig18 = this.apiConfig) === null || _this$apiConfig18 === void 0 ? void 0 : _this$apiConfig18.reportService) + queryString;
903
+ var _this$apiConfig18, _this$apiConfig19;
904
+ if (!((_this$apiConfig18 = this.apiConfig) !== null && _this$apiConfig18 !== void 0 && _this$apiConfig18.reportService)) throw new Error('No report Service defined');
905
+ return ((_this$apiConfig19 = this.apiConfig) === null || _this$apiConfig19 === void 0 ? void 0 : _this$apiConfig19.reportService) + queryString;
864
906
  }
865
907
  if (useWebServiceApi == 'enricher') {
866
- var _this$apiConfig21, _this$apiConfig22;
908
+ var _this$apiConfig22, _this$apiConfig23;
867
909
  if (this.useIDMService) {
868
- var _this$apiConfig19, _this$apiConfig20;
869
- if (!((_this$apiConfig19 = this.apiConfig) !== null && _this$apiConfig19 !== void 0 && _this$apiConfig19.idmService)) throw new Error('No report Service defined');
870
- return ((_this$apiConfig20 = this.apiConfig) === null || _this$apiConfig20 === void 0 ? void 0 : _this$apiConfig20.idmService) + queryString;
910
+ var _this$apiConfig20, _this$apiConfig21;
911
+ if (!((_this$apiConfig20 = this.apiConfig) !== null && _this$apiConfig20 !== void 0 && _this$apiConfig20.idmService)) throw new Error('No report Service defined');
912
+ return ((_this$apiConfig21 = this.apiConfig) === null || _this$apiConfig21 === void 0 ? void 0 : _this$apiConfig21.idmService) + queryString;
871
913
  }
872
- if (!((_this$apiConfig21 = this.apiConfig) !== null && _this$apiConfig21 !== void 0 && _this$apiConfig21.enricherService)) throw new Error('No report Service defined');
873
- return ((_this$apiConfig22 = this.apiConfig) === null || _this$apiConfig22 === void 0 ? void 0 : _this$apiConfig22.enricherService) + queryString;
914
+ if (!((_this$apiConfig22 = this.apiConfig) !== null && _this$apiConfig22 !== void 0 && _this$apiConfig22.enricherService)) throw new Error('No report Service defined');
915
+ return ((_this$apiConfig23 = this.apiConfig) === null || _this$apiConfig23 === void 0 ? void 0 : _this$apiConfig23.enricherService) + queryString;
874
916
  }
875
- var url = (_this$apiConfig23 = this.apiConfig) === null || _this$apiConfig23 === void 0 ? void 0 : _this$apiConfig23.api2["default"];
876
- if (this.getApplicationEnvironment() == 'WEB' && (_this$apiConfig24 = this.apiConfig) !== null && _this$apiConfig24 !== void 0 && _this$apiConfig24.api2.web) {
917
+ var url = (_this$apiConfig24 = this.apiConfig) === null || _this$apiConfig24 === void 0 ? void 0 : _this$apiConfig24.api2["default"];
918
+ if (this.getApplicationEnvironment() == 'WEB' && (_this$apiConfig25 = this.apiConfig) !== null && _this$apiConfig25 !== void 0 && _this$apiConfig25.api2.web) {
877
919
  url = this.apiConfig.api2.web;
878
920
  }
879
- if (this.useEkPrices && (_this$apiConfig25 = this.apiConfig) !== null && _this$apiConfig25 !== void 0 && _this$apiConfig25.api2.ek) {
880
- var _this$apiConfig26;
881
- url = (_this$apiConfig26 = this.apiConfig) === null || _this$apiConfig26 === void 0 ? void 0 : _this$apiConfig26.api2.ek;
921
+ if (this.useEkPrices && (_this$apiConfig26 = this.apiConfig) !== null && _this$apiConfig26 !== void 0 && _this$apiConfig26.api2.ek) {
922
+ var _this$apiConfig27;
923
+ url = (_this$apiConfig27 = this.apiConfig) === null || _this$apiConfig27 === void 0 ? void 0 : _this$apiConfig27.api2.ek;
882
924
  }
883
925
  if (!url) throw new Error('No API2 defined');
884
926
  return url + '?' + queryString;
@@ -1173,12 +1215,151 @@ var DivaApiHandler = /*#__PURE__*/function () {
1173
1215
  return loadArticlePricesQS;
1174
1216
  }()
1175
1217
  }, {
1176
- key: "postHQRenderScript",
1218
+ key: "generateAiImageWithReferenceImages",
1177
1219
  value: function () {
1178
- var _postHQRenderScript = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(data) {
1220
+ var _generateAiImageWithReferenceImages = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(data, leadKey) {
1179
1221
  var url, headers, res;
1180
1222
  return _regeneratorRuntime.wrap(function _callee9$(_context9) {
1181
1223
  while (1) switch (_context9.prev = _context9.next) {
1224
+ case 0:
1225
+ url = this.getDivaAiServiceUrl() + '/generate-image-with-references';
1226
+ headers = this.getAiServiceAuthHeaders(leadKey);
1227
+ _context9.next = 4;
1228
+ return this.fetchData(url, {
1229
+ data: _objectSpread$k(_objectSpread$k({}, data), {}, {
1230
+ organizationId: this.OrganizationId
1231
+ }),
1232
+ config: {
1233
+ headers: headers
1234
+ },
1235
+ method: 'POST'
1236
+ });
1237
+ case 4:
1238
+ res = _context9.sent;
1239
+ return _context9.abrupt("return", res);
1240
+ case 6:
1241
+ case "end":
1242
+ return _context9.stop();
1243
+ }
1244
+ }, _callee9, this);
1245
+ }));
1246
+ function generateAiImageWithReferenceImages(_x24, _x25) {
1247
+ return _generateAiImageWithReferenceImages.apply(this, arguments);
1248
+ }
1249
+ return generateAiImageWithReferenceImages;
1250
+ }()
1251
+ }, {
1252
+ key: "getUsageLimits",
1253
+ value: function () {
1254
+ var _getUsageLimits = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(data) {
1255
+ var url, headers, res;
1256
+ return _regeneratorRuntime.wrap(function _callee10$(_context10) {
1257
+ while (1) switch (_context10.prev = _context10.next) {
1258
+ case 0:
1259
+ url = this.getDivaAiServiceUrl() + '/usage/limits?organizationId=' + data.organizationId + '&userId=' + data.userId;
1260
+ headers = this.getAiServiceAuthHeaders();
1261
+ _context10.next = 4;
1262
+ return this.fetchData(url, {
1263
+ data: {},
1264
+ config: {
1265
+ headers: headers
1266
+ },
1267
+ method: 'GET'
1268
+ });
1269
+ case 4:
1270
+ res = _context10.sent;
1271
+ return _context10.abrupt("return", res);
1272
+ case 6:
1273
+ case "end":
1274
+ return _context10.stop();
1275
+ }
1276
+ }, _callee10, this);
1277
+ }));
1278
+ function getUsageLimits(_x26) {
1279
+ return _getUsageLimits.apply(this, arguments);
1280
+ }
1281
+ return getUsageLimits;
1282
+ }()
1283
+ }, {
1284
+ key: "getAiRoomRenderings",
1285
+ value: function () {
1286
+ var _getAiRoomRenderings = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee11(organizationId) {
1287
+ var orgParam, url, headers, res;
1288
+ return _regeneratorRuntime.wrap(function _callee11$(_context11) {
1289
+ while (1) switch (_context11.prev = _context11.next) {
1290
+ case 0:
1291
+ orgParam = organizationId ? "?organizationId=".concat(organizationId) : '';
1292
+ url = this.getDivaAiServiceUrl() + '/room-renderings' + orgParam; // No authentication headers needed - public endpoint
1293
+ headers = this.getAiServiceAuthHeaders();
1294
+ _context11.next = 5;
1295
+ return this.fetchData(url, {
1296
+ data: {},
1297
+ config: {
1298
+ headers: headers
1299
+ },
1300
+ method: 'GET'
1301
+ });
1302
+ case 5:
1303
+ res = _context11.sent;
1304
+ return _context11.abrupt("return", res);
1305
+ case 7:
1306
+ case "end":
1307
+ return _context11.stop();
1308
+ }
1309
+ }, _callee11, this);
1310
+ }));
1311
+ function getAiRoomRenderings(_x27) {
1312
+ return _getAiRoomRenderings.apply(this, arguments);
1313
+ }
1314
+ return getAiRoomRenderings;
1315
+ }()
1316
+ }, {
1317
+ key: "createLeadKey",
1318
+ value: function () {
1319
+ var _createLeadKey = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee12(email) {
1320
+ var url, headers, res;
1321
+ return _regeneratorRuntime.wrap(function _callee12$(_context12) {
1322
+ while (1) switch (_context12.prev = _context12.next) {
1323
+ case 0:
1324
+ url = this.getDivaAiServiceUrl() + '/lead-key';
1325
+ headers = this.getAiServiceAuthHeaders();
1326
+ _context12.prev = 2;
1327
+ _context12.next = 5;
1328
+ return this.fetchData(url, {
1329
+ data: {
1330
+ email: email
1331
+ },
1332
+ config: {
1333
+ headers: headers
1334
+ },
1335
+ method: 'POST'
1336
+ });
1337
+ case 5:
1338
+ res = _context12.sent;
1339
+ return _context12.abrupt("return", res);
1340
+ case 9:
1341
+ _context12.prev = 9;
1342
+ _context12.t0 = _context12["catch"](2);
1343
+ LOG$p.error(new Error("Failed to create lead key for email ".concat(email, ": ").concat((_context12.t0 === null || _context12.t0 === void 0 ? void 0 : _context12.t0.message) || _context12.t0)));
1344
+ throw _context12.t0;
1345
+ case 13:
1346
+ case "end":
1347
+ return _context12.stop();
1348
+ }
1349
+ }, _callee12, this, [[2, 9]]);
1350
+ }));
1351
+ function createLeadKey(_x28) {
1352
+ return _createLeadKey.apply(this, arguments);
1353
+ }
1354
+ return createLeadKey;
1355
+ }()
1356
+ }, {
1357
+ key: "postHQRenderScript",
1358
+ value: function () {
1359
+ var _postHQRenderScript = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee13(data) {
1360
+ var url, headers, res;
1361
+ return _regeneratorRuntime.wrap(function _callee13$(_context13) {
1362
+ while (1) switch (_context13.prev = _context13.next) {
1182
1363
  case 0:
1183
1364
  url = this.getDivaMediaServiceUrl() + '/hqrenderscripts';
1184
1365
  headers = {};
@@ -1187,7 +1368,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
1187
1368
  };else if (this.apiKey) headers = {
1188
1369
  'X-API-KEY': this.apiKey
1189
1370
  };
1190
- _context9.next = 5;
1371
+ _context13.next = 5;
1191
1372
  return this.fetchData(url, {
1192
1373
  data: data,
1193
1374
  config: {
@@ -1196,15 +1377,15 @@ var DivaApiHandler = /*#__PURE__*/function () {
1196
1377
  method: 'POST'
1197
1378
  });
1198
1379
  case 5:
1199
- res = _context9.sent;
1200
- return _context9.abrupt("return", res);
1380
+ res = _context13.sent;
1381
+ return _context13.abrupt("return", res);
1201
1382
  case 7:
1202
1383
  case "end":
1203
- return _context9.stop();
1384
+ return _context13.stop();
1204
1385
  }
1205
- }, _callee9, this);
1386
+ }, _callee13, this);
1206
1387
  }));
1207
- function postHQRenderScript(_x24) {
1388
+ function postHQRenderScript(_x29) {
1208
1389
  return _postHQRenderScript.apply(this, arguments);
1209
1390
  }
1210
1391
  return postHQRenderScript;
@@ -1212,10 +1393,10 @@ var DivaApiHandler = /*#__PURE__*/function () {
1212
1393
  }, {
1213
1394
  key: "postPlanningInfo",
1214
1395
  value: function () {
1215
- var _postPlanningInfo = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(planningInfo, divaNr, imgUrl, price, name, userId, firstName, lastName, organizationId) {
1396
+ var _postPlanningInfo = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee14(planningInfo, divaNr, imgUrl, price, name, userId, firstName, lastName, organizationId) {
1216
1397
  var data, url, headers;
1217
- return _regeneratorRuntime.wrap(function _callee10$(_context10) {
1218
- while (1) switch (_context10.prev = _context10.next) {
1398
+ return _regeneratorRuntime.wrap(function _callee14$(_context14) {
1399
+ while (1) switch (_context14.prev = _context14.next) {
1219
1400
  case 0:
1220
1401
  data = {
1221
1402
  info: JSON.stringify(planningInfo),
@@ -1234,8 +1415,8 @@ var DivaApiHandler = /*#__PURE__*/function () {
1234
1415
  };else if (this.apiKey) headers = {
1235
1416
  'X-API-KEY': this.apiKey
1236
1417
  };
1237
- _context10.prev = 4;
1238
- _context10.next = 7;
1418
+ _context14.prev = 4;
1419
+ _context14.next = 7;
1239
1420
  return this.fetchData(url, {
1240
1421
  data: data,
1241
1422
  config: {
@@ -1244,21 +1425,21 @@ var DivaApiHandler = /*#__PURE__*/function () {
1244
1425
  method: 'POST'
1245
1426
  });
1246
1427
  case 7:
1247
- _context10.next = 12;
1428
+ _context14.next = 12;
1248
1429
  break;
1249
1430
  case 9:
1250
- _context10.prev = 9;
1251
- _context10.t0 = _context10["catch"](4);
1431
+ _context14.prev = 9;
1432
+ _context14.t0 = _context14["catch"](4);
1252
1433
  LOG$p.error(new DivaError('Error Connecting to Support-Service-LivePlanner', {
1253
- cause: _context10.t0
1434
+ cause: _context14.t0
1254
1435
  }));
1255
1436
  case 12:
1256
1437
  case "end":
1257
- return _context10.stop();
1438
+ return _context14.stop();
1258
1439
  }
1259
- }, _callee10, this, [[4, 9]]);
1440
+ }, _callee14, this, [[4, 9]]);
1260
1441
  }));
1261
- function postPlanningInfo(_x25, _x26, _x27, _x28, _x29, _x30, _x31, _x32, _x33) {
1442
+ function postPlanningInfo(_x30, _x31, _x32, _x33, _x34, _x35, _x36, _x37, _x38) {
1262
1443
  return _postPlanningInfo.apply(this, arguments);
1263
1444
  }
1264
1445
  return postPlanningInfo;
@@ -1266,21 +1447,21 @@ var DivaApiHandler = /*#__PURE__*/function () {
1266
1447
  }, {
1267
1448
  key: "getDimensionbyId",
1268
1449
  value: function () {
1269
- var _getDimensionbyId = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee11(id, iln, catalogCodex, plannedOptions) {
1270
- var _this$apiConfig27;
1450
+ var _getDimensionbyId = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee15(id, iln, catalogCodex, plannedOptions) {
1451
+ var _this$apiConfig28;
1271
1452
  var fullUrl, res, headers;
1272
- return _regeneratorRuntime.wrap(function _callee11$(_context11) {
1273
- while (1) switch (_context11.prev = _context11.next) {
1453
+ return _regeneratorRuntime.wrap(function _callee15$(_context15) {
1454
+ while (1) switch (_context15.prev = _context15.next) {
1274
1455
  case 0:
1275
- fullUrl = this.getConstructorServiceUrl() + '/dimension/' + id + '?iln=' + iln + '&catalogCodex=' + catalogCodex + '&debug=' + ((_this$apiConfig27 = this.apiConfig) === null || _this$apiConfig27 === void 0 ? void 0 : _this$apiConfig27.useDebugUrl);
1456
+ fullUrl = this.getConstructorServiceUrl() + '/dimension/' + id + '?iln=' + iln + '&catalogCodex=' + catalogCodex + '&debug=' + ((_this$apiConfig28 = this.apiConfig) === null || _this$apiConfig28 === void 0 ? void 0 : _this$apiConfig28.useDebugUrl);
1276
1457
  headers = {};
1277
1458
  if (this.jwt) headers = {
1278
1459
  Authorization: 'Bearer ' + this.jwt
1279
1460
  };else if (this.apiKey) headers = {
1280
1461
  'X-API-KEY': this.apiKey
1281
1462
  };
1282
- _context11.prev = 3;
1283
- _context11.next = 6;
1463
+ _context15.prev = 3;
1464
+ _context15.next = 6;
1284
1465
  return this.fetchData(fullUrl, {
1285
1466
  method: 'POST',
1286
1467
  data: {
@@ -1291,23 +1472,23 @@ var DivaApiHandler = /*#__PURE__*/function () {
1291
1472
  }
1292
1473
  });
1293
1474
  case 6:
1294
- res = _context11.sent;
1295
- return _context11.abrupt("return", res);
1475
+ res = _context15.sent;
1476
+ return _context15.abrupt("return", res);
1296
1477
  case 10:
1297
- _context11.prev = 10;
1298
- _context11.t0 = _context11["catch"](3);
1478
+ _context15.prev = 10;
1479
+ _context15.t0 = _context15["catch"](3);
1299
1480
  LOG$p.error({
1300
1481
  message: 'Could not fetch dimension',
1301
1482
  name: 'get dimension error'
1302
1483
  });
1303
- return _context11.abrupt("return", undefined);
1484
+ return _context15.abrupt("return", undefined);
1304
1485
  case 14:
1305
1486
  case "end":
1306
- return _context11.stop();
1487
+ return _context15.stop();
1307
1488
  }
1308
- }, _callee11, this, [[3, 10]]);
1489
+ }, _callee15, this, [[3, 10]]);
1309
1490
  }));
1310
- function getDimensionbyId(_x34, _x35, _x36, _x37) {
1491
+ function getDimensionbyId(_x39, _x40, _x41, _x42) {
1311
1492
  return _getDimensionbyId.apply(this, arguments);
1312
1493
  }
1313
1494
  return getDimensionbyId;
@@ -1315,7 +1496,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
1315
1496
  }, {
1316
1497
  key: "createBasketReport",
1317
1498
  value: function () {
1318
- var _createBasketReport = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee12(basket, _ref2) {
1499
+ var _createBasketReport = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee16(basket, _ref2) {
1319
1500
  var type,
1320
1501
  printOptions,
1321
1502
  savePdf,
@@ -1324,12 +1505,12 @@ var DivaApiHandler = /*#__PURE__*/function () {
1324
1505
  headers,
1325
1506
  result,
1326
1507
  val,
1327
- _args12 = arguments;
1328
- return _regeneratorRuntime.wrap(function _callee12$(_context12) {
1329
- while (1) switch (_context12.prev = _context12.next) {
1508
+ _args16 = arguments;
1509
+ return _regeneratorRuntime.wrap(function _callee16$(_context16) {
1510
+ while (1) switch (_context16.prev = _context16.next) {
1330
1511
  case 0:
1331
1512
  type = _ref2.type, printOptions = _objectWithoutProperties(_ref2, _excluded);
1332
- savePdf = _args12.length > 2 && _args12[2] !== undefined ? _args12[2] : false;
1513
+ savePdf = _args16.length > 2 && _args16[2] !== undefined ? _args16[2] : false;
1333
1514
  data = {
1334
1515
  type: type,
1335
1516
  printOptions: printOptions,
@@ -1342,8 +1523,8 @@ var DivaApiHandler = /*#__PURE__*/function () {
1342
1523
  };else if (this.apiKey) headers = {
1343
1524
  'X-API-KEY': this.apiKey
1344
1525
  };
1345
- _context12.prev = 6;
1346
- _context12.next = 9;
1526
+ _context16.prev = 6;
1527
+ _context16.next = 9;
1347
1528
  return this.fetchData(url, {
1348
1529
  data: data,
1349
1530
  config: {
@@ -1352,7 +1533,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
1352
1533
  method: 'POST'
1353
1534
  });
1354
1535
  case 9:
1355
- result = _context12.sent;
1536
+ result = _context16.sent;
1356
1537
  if (savePdf) {
1357
1538
  val = {};
1358
1539
  val[type] = result.url;
@@ -1371,20 +1552,20 @@ var DivaApiHandler = /*#__PURE__*/function () {
1371
1552
  }
1372
1553
  });
1373
1554
  }
1374
- return _context12.abrupt("return", result.url);
1555
+ return _context16.abrupt("return", result.url);
1375
1556
  case 14:
1376
- _context12.prev = 14;
1377
- _context12.t0 = _context12["catch"](6);
1557
+ _context16.prev = 14;
1558
+ _context16.t0 = _context16["catch"](6);
1378
1559
  LOG$p.error(new DivaError('Error Connecting to Report Service', {
1379
- cause: _context12.t0
1560
+ cause: _context16.t0
1380
1561
  }));
1381
1562
  case 17:
1382
1563
  case "end":
1383
- return _context12.stop();
1564
+ return _context16.stop();
1384
1565
  }
1385
- }, _callee12, this, [[6, 14]]);
1566
+ }, _callee16, this, [[6, 14]]);
1386
1567
  }));
1387
- function createBasketReport(_x38, _x39) {
1568
+ function createBasketReport(_x43, _x44) {
1388
1569
  return _createBasketReport.apply(this, arguments);
1389
1570
  }
1390
1571
  return createBasketReport;
@@ -28507,7 +28688,7 @@ var DivaArticle = /*#__PURE__*/function () {
28507
28688
  break;
28508
28689
  }
28509
28690
  _context.next = 4;
28510
- return import('./ShelfPlanner-82a898e8.js');
28691
+ return import('./ShelfPlanner-d4025911.js');
28511
28692
  case 4:
28512
28693
  _yield$import = _context.sent;
28513
28694
  ShelfPlanner = _yield$import["default"];
@@ -31773,6 +31954,7 @@ var DivaSet = /*#__PURE__*/function () {
31773
31954
  _defineProperty(this, "favoritesChanged", false);
31774
31955
  _defineProperty(this, "setState", void 0);
31775
31956
  _defineProperty(this, "modifiedJ3D", []);
31957
+ _defineProperty(this, "aiImageForBasket", void 0);
31776
31958
  /**
31777
31959
  * This function is called when the docking of two Elements is changed
31778
31960
  */
@@ -32045,6 +32227,24 @@ var DivaSet = /*#__PURE__*/function () {
32045
32227
  };
32046
32228
  }
32047
32229
  return _createClass(DivaSet, [{
32230
+ key: "getAiImageAsJpg",
32231
+ value: function getAiImageAsJpg() {
32232
+ return this.aiImageForBasket;
32233
+ }
32234
+ }, {
32235
+ key: "setAiImageAsJpg",
32236
+ value: function setAiImageAsJpg(promptId, aiImageAsJPGBase64) {
32237
+ this.aiImageForBasket = {
32238
+ base64: aiImageAsJPGBase64,
32239
+ promptId: promptId
32240
+ };
32241
+ }
32242
+ }, {
32243
+ key: "clearAiImageAsJpg",
32244
+ value: function clearAiImageAsJpg() {
32245
+ this.aiImageForBasket = undefined;
32246
+ }
32247
+ }, {
32048
32248
  key: "addRelationsToArticles",
32049
32249
  value: function addRelationsToArticles(article1, article2) {
32050
32250
  if (article2.checkArtCodexIsAccessoire(article1.articleCodex)) {
@@ -33040,7 +33240,7 @@ var DivaSet = /*#__PURE__*/function () {
33040
33240
  break;
33041
33241
  }
33042
33242
  _context5.next = 3;
33043
- return import('./DoorPlanner-ac18a82d.js');
33243
+ return import('./DoorPlanner-1856ede2.js');
33044
33244
  case 3:
33045
33245
  _yield$import = _context5.sent;
33046
33246
  DoorPlanner = _yield$import["default"];
@@ -38694,8 +38894,8 @@ var DivaSetHandler = /*#__PURE__*/function () {
38694
38894
  key: "getOrderSet",
38695
38895
  value: function () {
38696
38896
  var _getOrderSet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee30(set, catalogData, divaNr, repairOnly, returnTo) {
38697
- var _Object$values$, _set$getDivaArticles, _hqRenderScript, _set$basketConfigVari2, _set$basketConfigVari3;
38698
- var dontGenerateImages, orderSet, GroupType, plannerData, setImage, urlToPlanning2D, alternateSetImages, hqRenderScript, dimensions, promise3D, promise2D, promise3DAlternate, _yield$Promise$all, _yield$Promise$all2, _yield$Promise$all2$, plannerWarnings, bruttoPrice;
38897
+ var _Object$values$, _set$getDivaArticles, _hqRenderScript, _alternateSetImages, _set$basketConfigVari2, _set$basketConfigVari3;
38898
+ var dontGenerateImages, orderSet, GroupType, plannerData, setImage, urlToPlanning2D, urlToAiImage, alternateSetImages, hqRenderScript, dimensions, promise3D, promise2D, promiseAiImage, promise3DAlternate, _yield$Promise$all, _yield$Promise$all2, _yield$Promise$all2$, plannerWarnings, bruttoPrice;
38699
38899
  return _regeneratorRuntime.wrap(function _callee30$(_context32) {
38700
38900
  while (1) switch (_context32.prev = _context32.next) {
38701
38901
  case 0:
@@ -38705,30 +38905,35 @@ var DivaSetHandler = /*#__PURE__*/function () {
38705
38905
  plannerData = set.plannerHandler.savePlanner(set.getSetId());
38706
38906
  setImage = undefined;
38707
38907
  urlToPlanning2D = undefined;
38908
+ urlToAiImage = undefined;
38708
38909
  alternateSetImages = undefined;
38709
38910
  hqRenderScript = undefined;
38710
38911
  dimensions = {};
38711
38912
  if (dontGenerateImages) {
38712
- _context32.next = 23;
38913
+ _context32.next = 26;
38713
38914
  break;
38714
38915
  }
38715
38916
  promise3D = this.getSetImage(set, typeof window === 'undefined');
38716
38917
  promise2D = this.get2DSetImage(set);
38918
+ if (set.getAiImageAsJpg()) {
38919
+ promiseAiImage = this.getAiImage(set);
38920
+ }
38717
38921
  if (!catalogData.dontSaveAlternativeRenderings && set.CatalogData.alternateRenderingsForSummary.length) {
38718
38922
  promise3DAlternate = this.getAlternateSetImages(set);
38719
38923
  }
38720
- _context32.next = 15;
38721
- return Promise.all([promise3D, promise2D, promise3DAlternate, this.getHQRenderScript(set, divaNr)]);
38722
- case 15:
38924
+ _context32.next = 17;
38925
+ return Promise.all([promise3D, promise2D, promiseAiImage, promise3DAlternate, this.getHQRenderScript(set, divaNr)]);
38926
+ case 17:
38723
38927
  _yield$Promise$all = _context32.sent;
38724
- _yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 4);
38928
+ _yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 5);
38725
38929
  _yield$Promise$all2$ = _yield$Promise$all2[0];
38726
38930
  setImage = _yield$Promise$all2$.url;
38727
38931
  dimensions = _yield$Promise$all2$.dimensions;
38728
38932
  urlToPlanning2D = _yield$Promise$all2[1];
38729
- alternateSetImages = _yield$Promise$all2[2];
38730
- hqRenderScript = _yield$Promise$all2[3];
38731
- case 23:
38933
+ urlToAiImage = _yield$Promise$all2[2];
38934
+ alternateSetImages = _yield$Promise$all2[3];
38935
+ hqRenderScript = _yield$Promise$all2[4];
38936
+ case 26:
38732
38937
  plannerWarnings = [];
38733
38938
  if (!this.getPlanningIsComplete(set)) plannerWarnings.push('INCOMPLETE');
38734
38939
  DivaUtils.endSpanOfApm('GetSet3D und 2D Image');
@@ -38765,7 +38970,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
38765
38970
  Set2DImage: urlToPlanning2D,
38766
38971
  VariantDescription: DivaUtils.stripTags(set.getVariantsDescription()),
38767
38972
  VariantDescription_locales: DivaUtils.stripTagsFromDict(set.getVariantsDescription_locales()),
38768
- SetImages: alternateSetImages,
38973
+ SetImages: [].concat(_toConsumableArray(urlToAiImage ? [urlToAiImage] : []), _toConsumableArray((_alternateSetImages = alternateSetImages) !== null && _alternateSetImages !== void 0 ? _alternateSetImages : [])),
38769
38974
  SetHash: set.setHash,
38770
38975
  SetPlanData: plannerData != undefined ? DivaUtils.encodeBase64(JSON.stringify(plannerData)) : '',
38771
38976
  SetID: set.getSetId(),
@@ -38792,7 +38997,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
38792
38997
  MetaData_locales: !((_set$basketConfigVari3 = set.basketConfigVariants) !== null && _set$basketConfigVari3 !== void 0 && _set$basketConfigVari3.length) ? set.MetaData_locales : undefined
38793
38998
  });
38794
38999
  return _context32.abrupt("return", orderSet);
38795
- case 29:
39000
+ case 32:
38796
39001
  case "end":
38797
39002
  return _context32.stop();
38798
39003
  }
@@ -38944,18 +39149,18 @@ var DivaSetHandler = /*#__PURE__*/function () {
38944
39149
  key: "get2DSetImage",
38945
39150
  value: function () {
38946
39151
  var _get2DSetImage = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee34(set) {
38947
- var urlToPlanning2D, catalogData, planning2DAsJPGBase64;
39152
+ var urlToPlanning2D, planning2DAsJPGBase64;
38948
39153
  return _regeneratorRuntime.wrap(function _callee34$(_context36) {
38949
39154
  while (1) switch (_context36.prev = _context36.next) {
38950
39155
  case 0:
38951
- urlToPlanning2D = undefined, catalogData = set.CatalogData;
39156
+ urlToPlanning2D = undefined;
38952
39157
  planning2DAsJPGBase64 = set.getPlanning2DAsJpg();
38953
39158
  if (!(planning2DAsJPGBase64 != undefined && planning2DAsJPGBase64 != '' && planning2DAsJPGBase64 != 'data:,')) {
38954
39159
  _context36.next = 6;
38955
39160
  break;
38956
39161
  }
38957
39162
  _context36.next = 5;
38958
- return set.plannerHandler.saveSet2DImage(set.getSetId(), catalogData.catalogCodex, catalogData.catalogGuid, planning2DAsJPGBase64);
39163
+ return set.plannerHandler.saveSet2DImage(set.CatalogData.catalogCodex, set.CatalogData.catalogGuid, planning2DAsJPGBase64);
38959
39164
  case 5:
38960
39165
  urlToPlanning2D = _context36.sent;
38961
39166
  case 6:
@@ -38971,6 +39176,31 @@ var DivaSetHandler = /*#__PURE__*/function () {
38971
39176
  }
38972
39177
  return get2DSetImage;
38973
39178
  }()
39179
+ }, {
39180
+ key: "getAiImage",
39181
+ value: function () {
39182
+ var _getAiImage = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee35(set) {
39183
+ var catalogData, _ref3, promptId, base64;
39184
+ return _regeneratorRuntime.wrap(function _callee35$(_context37) {
39185
+ while (1) switch (_context37.prev = _context37.next) {
39186
+ case 0:
39187
+ catalogData = set.CatalogData;
39188
+ _ref3 = set.getAiImageAsJpg(), promptId = _ref3.promptId, base64 = _ref3.base64;
39189
+ _context37.next = 4;
39190
+ return set.plannerHandler.saveAiImage(promptId, catalogData.catalogCodex, catalogData.catalogGuid, base64);
39191
+ case 4:
39192
+ return _context37.abrupt("return", _context37.sent);
39193
+ case 5:
39194
+ case "end":
39195
+ return _context37.stop();
39196
+ }
39197
+ }, _callee35);
39198
+ }));
39199
+ function getAiImage(_x128) {
39200
+ return _getAiImage.apply(this, arguments);
39201
+ }
39202
+ return getAiImage;
39203
+ }()
38974
39204
  }, {
38975
39205
  key: "getBBoxObject",
38976
39206
  value: function getBBoxObject(set, dimensions) {
@@ -39006,25 +39236,25 @@ var DivaSetHandler = /*#__PURE__*/function () {
39006
39236
  }, {
39007
39237
  key: "addOrderSetArticlesToExistingSet",
39008
39238
  value: function () {
39009
- var _addOrderSetArticlesToExistingSet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee35(set, orderSet, lastSetToInitialize) {
39010
- return _regeneratorRuntime.wrap(function _callee35$(_context37) {
39011
- while (1) switch (_context37.prev = _context37.next) {
39239
+ var _addOrderSetArticlesToExistingSet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee36(set, orderSet, lastSetToInitialize) {
39240
+ return _regeneratorRuntime.wrap(function _callee36$(_context38) {
39241
+ while (1) switch (_context38.prev = _context38.next) {
39012
39242
  case 0:
39013
39243
  //TODO: GLOBAL STUFF
39014
39244
  //this.updateActSet(set);
39015
39245
  orderSet.changeBasketIds();
39016
- _context37.next = 3;
39246
+ _context38.next = 3;
39017
39247
  return this.initOrderLineArticles(set, orderSet);
39018
39248
  case 3:
39019
- _context37.next = 5;
39249
+ _context38.next = 5;
39020
39250
  return set.plannerHandler.extendSet(set, orderSet.SetPlanData, lastSetToInitialize);
39021
39251
  case 5:
39022
39252
  case "end":
39023
- return _context37.stop();
39253
+ return _context38.stop();
39024
39254
  }
39025
- }, _callee35, this);
39255
+ }, _callee36, this);
39026
39256
  }));
39027
- function addOrderSetArticlesToExistingSet(_x128, _x129, _x130) {
39257
+ function addOrderSetArticlesToExistingSet(_x129, _x130, _x131) {
39028
39258
  return _addOrderSetArticlesToExistingSet.apply(this, arguments);
39029
39259
  }
39030
39260
  return addOrderSetArticlesToExistingSet;
@@ -40096,7 +40326,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
40096
40326
  break;
40097
40327
  case 3:
40098
40328
  _context12.next = 5;
40099
- return import('./PfisterWWSHandler-7f788dde.js');
40329
+ return import('./PfisterWWSHandler-1c4b02d4.js');
40100
40330
  case 5:
40101
40331
  _yield$import = _context12.sent;
40102
40332
  PfisterWWSHandler = _yield$import["default"];
@@ -40104,7 +40334,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
40104
40334
  return _context12.abrupt("break", 27);
40105
40335
  case 9:
40106
40336
  _context12.next = 11;
40107
- return import('./LiviqueWWSHandler-4dfa4c29.js');
40337
+ return import('./LiviqueWWSHandler-d6dc0f40.js');
40108
40338
  case 11:
40109
40339
  _yield$import2 = _context12.sent;
40110
40340
  LiviqueWWSHandler = _yield$import2["default"];
@@ -40112,7 +40342,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
40112
40342
  return _context12.abrupt("break", 27);
40113
40343
  case 15:
40114
40344
  _context12.next = 17;
40115
- return import('./SeriousBasketHandler-b1914906.js');
40345
+ return import('./SeriousBasketHandler-1cbe7a5b.js');
40116
40346
  case 17:
40117
40347
  _yield$import3 = _context12.sent;
40118
40348
  SeriousWWSHandler = _yield$import3["default"];
@@ -40120,7 +40350,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
40120
40350
  return _context12.abrupt("break", 27);
40121
40351
  case 21:
40122
40352
  _context12.next = 23;
40123
- return import('./StandardWWSHandler-6d40ee75.js');
40353
+ return import('./StandardWWSHandler-b109a3d8.js');
40124
40354
  case 23:
40125
40355
  _yield$import4 = _context12.sent;
40126
40356
  StandardWWSHandler = _yield$import4["default"];
@@ -40717,12 +40947,7 @@ var Rendering = /*#__PURE__*/function () {
40717
40947
  _defineProperty(this, "uiInfo", void 0);
40718
40948
  _defineProperty(this, "urlToSavedRendering", void 0);
40719
40949
  // viewPoint: string;
40720
- // private posInfo: any;
40721
- //private doStream: boolean; Streaming over 3D Host is deprected
40722
- //private byteChunkArr: any;
40723
- //private byteChunkLayerMaskArr: any;
40724
40950
  _defineProperty(this, "hasLayerMask", void 0);
40725
- //private imgBytes: any;
40726
40951
  _defineProperty(this, "imgForSrc", void 0);
40727
40952
  _defineProperty(this, "layerMaskAsBase64", void 0);
40728
40953
  _defineProperty(this, "layerMaskThreeTexture", void 0);
@@ -41549,7 +41774,7 @@ var PlannerHandler3D = /*#__PURE__*/function () {
41549
41774
  while (1) switch (_context3.prev = _context3.next) {
41550
41775
  case 0:
41551
41776
  _context3.next = 2;
41552
- return import('./Host3DSignalR-2cbcb371.js');
41777
+ return import('./Host3DSignalR-06c1d471.js');
41553
41778
  case 2:
41554
41779
  _yield$import = _context3.sent;
41555
41780
  Host3DSignalR = _yield$import["default"];
@@ -41705,6 +41930,10 @@ var PlannerHandler3D = /*#__PURE__*/function () {
41705
41930
 
41706
41931
  if (this.checkRenderingReady(params.hash, waitedRendering) && waitedRendering.MediaServiceSaveMode == 'STREAM') {
41707
41932
  this.updatePlannerRendering(waitedRendering);
41933
+ } else {
41934
+ if (waitedRendering.MediaServiceSaveMode == 'PERMANENT') {
41935
+ this.updatePlannerRenderingInView(waitedRendering, true);
41936
+ }
41708
41937
  }
41709
41938
  return;
41710
41939
  }
@@ -42483,17 +42712,22 @@ var DivaMediaServiceHandler = /*#__PURE__*/function () {
42483
42712
  key: "base64ToBlob",
42484
42713
  value: function base64ToBlob(base64String, hash) {
42485
42714
  DivaUtils.startSpanOfApm('MediaServiceHandler base64ToBlob');
42715
+ var type = 'image/jpeg';
42486
42716
  if (base64String.startsWith('data:image/jpeg;base64,')) {
42487
42717
  base64String = base64String.replace('data:image/jpeg;base64,', '');
42488
42718
  }
42719
+ if (base64String.startsWith('data:image/png;base64,')) {
42720
+ base64String = base64String.replace('data:image/png;base64,', '');
42721
+ type = 'image/png';
42722
+ }
42489
42723
  var binary_string = window.atob(base64String);
42490
42724
  var len = binary_string.length;
42491
42725
  var bytes = new Uint8Array(len);
42492
42726
  for (var i = 0; i < len; i++) {
42493
42727
  bytes[i] = binary_string.charCodeAt(i);
42494
42728
  }
42495
- var blob = new File([bytes.buffer], hash + '.jpg', {
42496
- type: 'image/jpeg'
42729
+ var blob = new File([bytes.buffer], hash + (type === 'image/jpeg' ? '.jpg' : '.png'), {
42730
+ type: type
42497
42731
  });
42498
42732
  DivaUtils.endSpanOfApm('MediaServiceHandler base64ToBlob');
42499
42733
  return blob;
@@ -42563,6 +42797,90 @@ var DivaMediaServiceHandler = /*#__PURE__*/function () {
42563
42797
  }
42564
42798
  return savePlanning2DPermanent;
42565
42799
  }()
42800
+ /**
42801
+ * Save AI-generated base64 image to media service
42802
+ * @param hash Unique identifier for the image
42803
+ * @param base64Image Base64 encoded image data
42804
+ * @param promptId Optional prompt ID for reference
42805
+ * @param userId Optional user ID for tracking
42806
+ * @param organizationId Optional organization ID (defaults to instance organizationId)
42807
+ * @returns Promise<string> URL of the saved image or empty string on error
42808
+ */
42809
+ }, {
42810
+ key: "saveAiImagePermanent",
42811
+ value: (function () {
42812
+ var _saveAiImagePermanent = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(hash, base64Image, catalogCodex, catalogGUID, organizationId) {
42813
+ var imageBlob, url, data, mediaItem, mediaItemRef, response, _res$variants$big, _res$variants, res;
42814
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
42815
+ while (1) switch (_context2.prev = _context2.next) {
42816
+ case 0:
42817
+ DivaUtils.startSpanOfApm('MediaServiceHandler saveAiImagePermanent');
42818
+ imageBlob = this.base64ToBlob(base64Image, hash);
42819
+ url = this.mediaServiceUrl + this.POST_mediaItem;
42820
+ data = new FormData();
42821
+ data.append('file', imageBlob);
42822
+ mediaItem = {
42823
+ organizationId: organizationId || this.organizationId,
42824
+ mediaType: 'PCT',
42825
+ fileName: hash + '.png'
42826
+ };
42827
+ data.append('mediaItem', JSON.stringify(mediaItem));
42828
+ mediaItemRef = {
42829
+ functionType: 'ART',
42830
+ aiImageHash: hash,
42831
+ catalogCodex: catalogCodex,
42832
+ catalogGuid: catalogGUID
42833
+ };
42834
+ data.append('mediaItemRef', JSON.stringify(mediaItemRef));
42835
+ _context2.prev = 9;
42836
+ _context2.next = 12;
42837
+ return fetch(url, {
42838
+ method: 'POST',
42839
+ body: data,
42840
+ headers: {
42841
+ Authorization: 'Bearer ' + this.jwt
42842
+ }
42843
+ });
42844
+ case 12:
42845
+ response = _context2.sent;
42846
+ if (!response.ok) {
42847
+ _context2.next = 22;
42848
+ break;
42849
+ }
42850
+ _context2.next = 16;
42851
+ return response.json();
42852
+ case 16:
42853
+ res = _context2.sent;
42854
+ LOG$3.debug('Successfully saved AI image in media Service. URL: ' + res.url);
42855
+ DivaUtils.endSpanOfApm('MediaServiceHandler saveAiImagePermanent');
42856
+ return _context2.abrupt("return", (_res$variants$big = (_res$variants = res.variants) === null || _res$variants === void 0 ? void 0 : _res$variants.big) !== null && _res$variants$big !== void 0 ? _res$variants$big : res.url);
42857
+ case 22:
42858
+ LOG$3.error(new DivaError('Error when saving the AI image on mediaService. Hash: ' + hash + ' response: ' + response, {
42859
+ code: 'AI_001'
42860
+ }));
42861
+ case 23:
42862
+ _context2.next = 28;
42863
+ break;
42864
+ case 25:
42865
+ _context2.prev = 25;
42866
+ _context2.t0 = _context2["catch"](9);
42867
+ LOG$3.error(new DivaError('Exception when saving AI image. Hash: ' + hash + ' error: ' + _context2.t0, {
42868
+ code: 'AI_002'
42869
+ }));
42870
+ case 28:
42871
+ DivaUtils.endSpanOfApm('MediaServiceHandler saveAiImagePermanent');
42872
+ return _context2.abrupt("return", '');
42873
+ case 30:
42874
+ case "end":
42875
+ return _context2.stop();
42876
+ }
42877
+ }, _callee2, this, [[9, 25]]);
42878
+ }));
42879
+ function saveAiImagePermanent(_x5, _x6, _x7, _x8, _x9) {
42880
+ return _saveAiImagePermanent.apply(this, arguments);
42881
+ }
42882
+ return saveAiImagePermanent;
42883
+ }())
42566
42884
  }]);
42567
42885
  }();
42568
42886
  var mediaServiceHandler = new DivaMediaServiceHandler();
@@ -43107,7 +43425,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
43107
43425
  break;
43108
43426
  case 8:
43109
43427
  _context4.next = 10;
43110
- return import('./DivaStandardPlanner-a1ed202f.js');
43428
+ return import('./DivaStandardPlanner-8659772b.js');
43111
43429
  case 10:
43112
43430
  _yield$import = _context4.sent;
43113
43431
  DivaStandardPlanner = _yield$import["default"];
@@ -43118,7 +43436,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
43118
43436
  return _context4.abrupt("break", 21);
43119
43437
  case 15:
43120
43438
  _context4.next = 17;
43121
- return import('./DivaBoxPlanner-5b83551f.js');
43439
+ return import('./DivaBoxPlanner-07aaffc1.js');
43122
43440
  case 17:
43123
43441
  _yield$import2 = _context4.sent;
43124
43442
  DivaBoxPlanner = _yield$import2["default"];
@@ -43574,7 +43892,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
43574
43892
  }, {
43575
43893
  key: "saveSet2DImage",
43576
43894
  value: function () {
43577
- var _saveSet2DImage = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee12(setId, catCodex, catGUID, planning2DAsJPGBase64) {
43895
+ var _saveSet2DImage = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee12(catCodex, catGUID, planning2DAsJPGBase64) {
43578
43896
  var curPlanningHash, urlToPlanning2D;
43579
43897
  return _regeneratorRuntime.wrap(function _callee12$(_context12) {
43580
43898
  while (1) switch (_context12.prev = _context12.next) {
@@ -43594,11 +43912,46 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
43594
43912
  }
43595
43913
  }, _callee12, this);
43596
43914
  }));
43597
- function saveSet2DImage(_x19, _x20, _x21, _x22) {
43915
+ function saveSet2DImage(_x19, _x20, _x21) {
43598
43916
  return _saveSet2DImage.apply(this, arguments);
43599
43917
  }
43600
43918
  return saveSet2DImage;
43601
43919
  }()
43920
+ }, {
43921
+ key: "saveAiImage",
43922
+ value: function () {
43923
+ var _saveAiImage = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee13(promptId, catCodex, catGUID, aiImageAsJPGBase64) {
43924
+ var curPlanningHash, urlToAiImage;
43925
+ return _regeneratorRuntime.wrap(function _callee13$(_context13) {
43926
+ while (1) switch (_context13.prev = _context13.next) {
43927
+ case 0:
43928
+ //Get current hash.
43929
+ DivaUtils.startSpanOfApm('DivaPlannerHandler saveAiImage');
43930
+ curPlanningHash = this.createPlanningHash();
43931
+ _context13.next = 4;
43932
+ return mediaServiceHandler.saveAiImagePermanent(promptId + '_' + curPlanningHash, aiImageAsJPGBase64, catCodex, catGUID);
43933
+ case 4:
43934
+ urlToAiImage = _context13.sent;
43935
+ DivaUtils.endSpanOfApm('DivaPlannerHandler saveAiImage');
43936
+ return _context13.abrupt("return", {
43937
+ RenderWidth: 1024,
43938
+ RenderHeight: 1024,
43939
+ Description: 'AI Image',
43940
+ Filename: promptId + '_' + curPlanningHash + '.png',
43941
+ Id: promptId + '_' + curPlanningHash,
43942
+ URL: urlToAiImage
43943
+ });
43944
+ case 7:
43945
+ case "end":
43946
+ return _context13.stop();
43947
+ }
43948
+ }, _callee13, this);
43949
+ }));
43950
+ function saveAiImage(_x22, _x23, _x24, _x25) {
43951
+ return _saveAiImage.apply(this, arguments);
43952
+ }
43953
+ return saveAiImage;
43954
+ }()
43602
43955
  /**
43603
43956
  * This function is called in order to destroy a planner. All elements are cleared all saved resources are cleared.
43604
43957
  * @param setId The setID the planner belongs to
@@ -43649,35 +44002,35 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
43649
44002
  }, {
43650
44003
  key: "addPlannerElement",
43651
44004
  value: function () {
43652
- var _addPlannerElement = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee13(setId, basketId, initParams) {
44005
+ var _addPlannerElement = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee14(setId, basketId, initParams) {
43653
44006
  var _this$plannerList$get;
43654
- return _regeneratorRuntime.wrap(function _callee13$(_context13) {
43655
- while (1) switch (_context13.prev = _context13.next) {
44007
+ return _regeneratorRuntime.wrap(function _callee14$(_context14) {
44008
+ while (1) switch (_context14.prev = _context14.next) {
43656
44009
  case 0:
43657
44010
  DivaUtils.startSpanOfApm('DivaPlannerHandler addPlannerElement');
43658
44011
  if (this.plannerList.has(setId)) {
43659
- _context13.next = 4;
44012
+ _context14.next = 4;
43660
44013
  break;
43661
44014
  }
43662
44015
  DivaUtils.endSpanOfApm('DivaPlannerHandler addPlannerElement');
43663
- return _context13.abrupt("return");
44016
+ return _context14.abrupt("return");
43664
44017
  case 4:
43665
- _context13.next = 6;
44018
+ _context14.next = 6;
43666
44019
  return this.plannerList.get(setId).addPlannerElement(basketId, initParams);
43667
44020
  case 6:
43668
44021
  this.setPlannerHandler.updateSetPosNr(this.plannerList);
43669
44022
  this.setPlannerHandler.calcGlobalBoundingBox(this.plannerList);
43670
44023
  DivaUtils.endSpanOfApm('DivaPlannerHandler addPlannerElement');
43671
- return _context13.abrupt("return", (_this$plannerList$get = this.plannerList.get(setId)) === null || _this$plannerList$get === void 0 ? void 0 : _this$plannerList$get.getAllViewPlannerElements().find(function (item) {
44024
+ return _context14.abrupt("return", (_this$plannerList$get = this.plannerList.get(setId)) === null || _this$plannerList$get === void 0 ? void 0 : _this$plannerList$get.getAllViewPlannerElements().find(function (item) {
43672
44025
  return item.getBasketId() == basketId;
43673
44026
  }));
43674
44027
  case 10:
43675
44028
  case "end":
43676
- return _context13.stop();
44029
+ return _context14.stop();
43677
44030
  }
43678
- }, _callee13, this);
44031
+ }, _callee14, this);
43679
44032
  }));
43680
- function addPlannerElement(_x23, _x24, _x25) {
44033
+ function addPlannerElement(_x26, _x27, _x28) {
43681
44034
  return _addPlannerElement.apply(this, arguments);
43682
44035
  }
43683
44036
  return addPlannerElement;
@@ -43685,36 +44038,36 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
43685
44038
  }, {
43686
44039
  key: "deletePlannerElement",
43687
44040
  value: function () {
43688
- var _deletePlannerElement = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee14(setId, elementId, autoCorrectAVL_AVR, deletionType) {
44041
+ var _deletePlannerElement = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee15(setId, elementId, autoCorrectAVL_AVR, deletionType) {
43689
44042
  var response;
43690
- return _regeneratorRuntime.wrap(function _callee14$(_context14) {
43691
- while (1) switch (_context14.prev = _context14.next) {
44043
+ return _regeneratorRuntime.wrap(function _callee15$(_context15) {
44044
+ while (1) switch (_context15.prev = _context15.next) {
43692
44045
  case 0:
43693
44046
  DivaUtils.startSpanOfApm('DivaPlannerHandler deletePlannerElement');
43694
44047
  if (this.plannerList.has(setId)) {
43695
- _context14.next = 4;
44048
+ _context15.next = 4;
43696
44049
  break;
43697
44050
  }
43698
44051
  DivaUtils.endSpanOfApm('DivaPlannerHandler deletePlannerElement');
43699
- return _context14.abrupt("return", {
44052
+ return _context15.abrupt("return", {
43700
44053
  newElementToSelect: -1
43701
44054
  });
43702
44055
  case 4:
43703
- _context14.next = 6;
44056
+ _context15.next = 6;
43704
44057
  return this.plannerList.get(setId).deletePlannerElement(elementId, autoCorrectAVL_AVR, deletionType);
43705
44058
  case 6:
43706
- response = _context14.sent;
44059
+ response = _context15.sent;
43707
44060
  this.setPlannerHandler.updateSetPosNr(this.plannerList);
43708
44061
  this.setPlannerHandler.calcGlobalBoundingBox(this.plannerList);
43709
44062
  DivaUtils.endSpanOfApm('DivaPlannerHandler deletePlannerElement');
43710
- return _context14.abrupt("return", response);
44063
+ return _context15.abrupt("return", response);
43711
44064
  case 11:
43712
44065
  case "end":
43713
- return _context14.stop();
44066
+ return _context15.stop();
43714
44067
  }
43715
- }, _callee14, this);
44068
+ }, _callee15, this);
43716
44069
  }));
43717
- function deletePlannerElement(_x26, _x27, _x28, _x29) {
44070
+ function deletePlannerElement(_x29, _x30, _x31, _x32) {
43718
44071
  return _deletePlannerElement.apply(this, arguments);
43719
44072
  }
43720
44073
  return deletePlannerElement;
@@ -43757,31 +44110,31 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
43757
44110
  }, {
43758
44111
  key: "copyPlannerElements",
43759
44112
  value: (function () {
43760
- var _copyPlannerElements = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee15(setId, articleCopyRelation, copyInfo) {
44113
+ var _copyPlannerElements = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee16(setId, articleCopyRelation, copyInfo) {
43761
44114
  var response;
43762
- return _regeneratorRuntime.wrap(function _callee15$(_context15) {
43763
- while (1) switch (_context15.prev = _context15.next) {
44115
+ return _regeneratorRuntime.wrap(function _callee16$(_context16) {
44116
+ while (1) switch (_context16.prev = _context16.next) {
43764
44117
  case 0:
43765
44118
  if (!(!this.plannerList.has(setId) || !copyInfo)) {
43766
- _context15.next = 2;
44119
+ _context16.next = 2;
43767
44120
  break;
43768
44121
  }
43769
- return _context15.abrupt("return");
44122
+ return _context16.abrupt("return");
43770
44123
  case 2:
43771
- _context15.next = 4;
44124
+ _context16.next = 4;
43772
44125
  return this.plannerList.get(setId).copyPlannerElement(articleCopyRelation, copyInfo);
43773
44126
  case 4:
43774
- response = _context15.sent;
44127
+ response = _context16.sent;
43775
44128
  this.setPlannerHandler.updateSetPosNr(this.plannerList);
43776
44129
  this.setPlannerHandler.calcGlobalBoundingBox(this.plannerList);
43777
- return _context15.abrupt("return", response);
44130
+ return _context16.abrupt("return", response);
43778
44131
  case 8:
43779
44132
  case "end":
43780
- return _context15.stop();
44133
+ return _context16.stop();
43781
44134
  }
43782
- }, _callee15, this);
44135
+ }, _callee16, this);
43783
44136
  }));
43784
- function copyPlannerElements(_x30, _x31, _x32) {
44137
+ function copyPlannerElements(_x33, _x34, _x35) {
43785
44138
  return _copyPlannerElements.apply(this, arguments);
43786
44139
  }
43787
44140
  return copyPlannerElements;
@@ -43917,29 +44270,29 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
43917
44270
  }, {
43918
44271
  key: "request3D",
43919
44272
  value: function () {
43920
- var _request3D = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee16(doRequestRendering, doRequestHqRenderScript, alternateRenderingsExist, alternateRenderInfo, forceReloadPlanning, renderRequestInfos, hybrid3DInfo, useLatestHybridInfo) {
44273
+ var _request3D = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee17(doRequestRendering, doRequestHqRenderScript, alternateRenderingsExist, alternateRenderInfo, forceReloadPlanning, renderRequestInfos, hybrid3DInfo, useLatestHybridInfo) {
43921
44274
  var _this3 = this;
43922
44275
  var plannerData, loadedCatData, plannerExists, savedSetId;
43923
- return _regeneratorRuntime.wrap(function _callee16$(_context16) {
43924
- while (1) switch (_context16.prev = _context16.next) {
44276
+ return _regeneratorRuntime.wrap(function _callee17$(_context17) {
44277
+ while (1) switch (_context17.prev = _context17.next) {
43925
44278
  case 0:
43926
44279
  if (!doRequestRendering) {
43927
- _context16.next = 9;
44280
+ _context17.next = 9;
43928
44281
  break;
43929
44282
  }
43930
44283
  if (renderRequestInfos) {
43931
- _context16.next = 6;
44284
+ _context17.next = 6;
43932
44285
  break;
43933
44286
  }
43934
44287
  LOG$2.error(new DivaError('Error requesting 3D rendering. No renderRequestInfo is set'));
43935
- return _context16.abrupt("return");
44288
+ return _context17.abrupt("return");
43936
44289
  case 6:
43937
44290
  if (!(renderRequestInfos.width <= 0 || isNaN(renderRequestInfos.width) || renderRequestInfos.height <= 0 || isNaN(renderRequestInfos.height))) {
43938
- _context16.next = 9;
44291
+ _context17.next = 9;
43939
44292
  break;
43940
44293
  }
43941
44294
  LOG$2.error(new DivaError('Error requesting rendering. Not valid width or height request width: ' + renderRequestInfos.width + ' height: ' + renderRequestInfos.height));
43942
- return _context16.abrupt("return");
44295
+ return _context17.abrupt("return");
43943
44296
  case 9:
43944
44297
  plannerData = this.handler3D.initPlannerData(this.plannerHandlerFunctions.doAllowSetPlanner());
43945
44298
  loadedCatData = [];
@@ -43969,7 +44322,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
43969
44322
  });
43970
44323
  });
43971
44324
  if (!plannerExists) {
43972
- _context16.next = 19;
44325
+ _context17.next = 19;
43973
44326
  break;
43974
44327
  }
43975
44328
  // if not in set planner mode overwrite s1 with correct setId
@@ -43977,7 +44330,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
43977
44330
  plannerData.SCE.ROO[0].SET[0].ID = savedSetId;
43978
44331
  plannerData.SCE.ROO[0].SelectSet = savedSetId;
43979
44332
  }
43980
- _context16.next = 18;
44333
+ _context17.next = 18;
43981
44334
  return this.handler3D.request3D({
43982
44335
  doRequestRendering: doRequestRendering,
43983
44336
  doRequestHqRenderScript: doRequestHqRenderScript,
@@ -43992,16 +44345,16 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
43992
44345
  useLatestHybridInfo: useLatestHybridInfo
43993
44346
  });
43994
44347
  case 18:
43995
- return _context16.abrupt("return", _context16.sent);
44348
+ return _context17.abrupt("return", _context17.sent);
43996
44349
  case 19:
43997
- return _context16.abrupt("return");
44350
+ return _context17.abrupt("return");
43998
44351
  case 20:
43999
44352
  case "end":
44000
- return _context16.stop();
44353
+ return _context17.stop();
44001
44354
  }
44002
- }, _callee16, this);
44355
+ }, _callee17, this);
44003
44356
  }));
44004
- function request3D(_x33, _x34, _x35, _x36, _x37, _x38, _x39, _x40) {
44357
+ function request3D(_x36, _x37, _x38, _x39, _x40, _x41, _x42, _x43) {
44005
44358
  return _request3D.apply(this, arguments);
44006
44359
  }
44007
44360
  return request3D;
@@ -44224,15 +44577,16 @@ var DivaWebPlanner = /*#__PURE__*/function () {
44224
44577
  */
44225
44578
  _defineProperty(this, "updatePlannerRendering", function (rendering) {
44226
44579
  var _this$state;
44580
+ var onlyUpdateState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
44227
44581
  if (rendering.getIsFullscreenRendering()) {
44228
44582
  _this.updateFullscreenRendering(rendering);
44229
44583
  } else {
44230
- var _this$actSet;
44231
- _this.updatePlanner3DImage(rendering, ((_this$actSet = _this.actSet()) === null || _this$actSet === void 0 ? void 0 : _this$actSet.getAlternateRenderInfo().length) > 0);
44584
+ var _this$updatePlanner3D;
44585
+ (_this$updatePlanner3D = _this.updatePlanner3DImage) === null || _this$updatePlanner3D === void 0 || _this$updatePlanner3D.call(_this, rendering, onlyUpdateState);
44232
44586
  }
44233
44587
  if (_this.actions && (_this$state = _this.state) !== null && _this$state !== void 0 && _this$state.enableSupport) {
44234
- var _this$actSet2, _this$state$user, _this$state$user2, _this$state$user3;
44235
- _this.api.postPlanningInfo((_this$actSet2 = _this.actSet()) === null || _this$actSet2 === void 0 ? void 0 : _this$actSet2.getVariantBasketData(), _this.divaNr, rendering.getImageForSrc(), _this.getCurSetPrice() + setHandlerInstance.getActSetPriceFormat(_this.actSet()), _this.getCurCatalogName(), (_this$state$user = _this.state.user) === null || _this$state$user === void 0 ? void 0 : _this$state$user._id, (_this$state$user2 = _this.state.user) === null || _this$state$user2 === void 0 ? void 0 : _this$state$user2.name, (_this$state$user3 = _this.state.user) === null || _this$state$user3 === void 0 ? void 0 : _this$state$user3.familyName, _this.state.organization._id);
44588
+ var _this$actSet, _this$state$user, _this$state$user2, _this$state$user3;
44589
+ _this.api.postPlanningInfo((_this$actSet = _this.actSet()) === null || _this$actSet === void 0 ? void 0 : _this$actSet.getVariantBasketData(), _this.divaNr, rendering.getImageForSrc(), _this.getCurSetPrice() + setHandlerInstance.getActSetPriceFormat(_this.actSet()), _this.getCurCatalogName(), (_this$state$user = _this.state.user) === null || _this$state$user === void 0 ? void 0 : _this$state$user._id, (_this$state$user2 = _this.state.user) === null || _this$state$user2 === void 0 ? void 0 : _this$state$user2.name, (_this$state$user3 = _this.state.user) === null || _this$state$user3 === void 0 ? void 0 : _this$state$user3.familyName, _this.state.organization._id);
44236
44590
  }
44237
44591
  });
44238
44592
  /**
@@ -45183,16 +45537,16 @@ var DivaWebPlanner = /*#__PURE__*/function () {
45183
45537
  }, {
45184
45538
  key: "getDivaArticles",
45185
45539
  value: function getDivaArticles(visiblePartlistArticlesAlso, allPartlistArticlesAlso) {
45186
- var _this$actSet3;
45187
- return (_this$actSet3 = this.actSet()) === null || _this$actSet3 === void 0 ? void 0 : _this$actSet3.getDivaArticles(visiblePartlistArticlesAlso, allPartlistArticlesAlso);
45540
+ var _this$actSet2;
45541
+ return (_this$actSet2 = this.actSet()) === null || _this$actSet2 === void 0 ? void 0 : _this$actSet2.getDivaArticles(visiblePartlistArticlesAlso, allPartlistArticlesAlso);
45188
45542
  }
45189
45543
 
45190
45544
  //for debugging
45191
45545
  }, {
45192
45546
  key: "getFirstDivaArticles",
45193
45547
  value: function getFirstDivaArticles() {
45194
- var _this$actSet$getDivaA, _this$actSet4;
45195
- return Object.values((_this$actSet$getDivaA = (_this$actSet4 = this.actSet()) === null || _this$actSet4 === void 0 ? void 0 : _this$actSet4.getDivaArticles()) !== null && _this$actSet$getDivaA !== void 0 ? _this$actSet$getDivaA : {})[0];
45548
+ var _this$actSet$getDivaA, _this$actSet3;
45549
+ return Object.values((_this$actSet$getDivaA = (_this$actSet3 = this.actSet()) === null || _this$actSet3 === void 0 ? void 0 : _this$actSet3.getDivaArticles()) !== null && _this$actSet$getDivaA !== void 0 ? _this$actSet$getDivaA : {})[0];
45196
45550
  }
45197
45551
  }, {
45198
45552
  key: "getHiddenOptions",
@@ -45260,8 +45614,8 @@ var DivaWebPlanner = /*#__PURE__*/function () {
45260
45614
  }, {
45261
45615
  key: "updateWebConfiguratorTitle",
45262
45616
  value: function updateWebConfiguratorTitle() {
45263
- var _this$setWebConifgura, _this$actSet5;
45264
- (_this$setWebConifgura = this.setWebConifguratorTitle) === null || _this$setWebConifgura === void 0 || _this$setWebConifgura.call(this, (_this$actSet5 = this.actSet()) === null || _this$actSet5 === void 0 ? void 0 : _this$actSet5.getSetTitle());
45617
+ var _this$setWebConifgura, _this$actSet4;
45618
+ (_this$setWebConifgura = this.setWebConifguratorTitle) === null || _this$setWebConifgura === void 0 || _this$setWebConifgura.call(this, (_this$actSet4 = this.actSet()) === null || _this$actSet4 === void 0 ? void 0 : _this$actSet4.getSetTitle());
45265
45619
  }
45266
45620
  }, {
45267
45621
  key: "updateConfigStructure",
@@ -45273,7 +45627,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
45273
45627
  value: function () {
45274
45628
  var _runInitMode = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee17(plannerMode) {
45275
45629
  var _this$plannerConfig$i, _this$state5;
45276
- var doDefault, _this$navigateToTabGr2, _this$saveToBasketWra, configStepKey, _this$navigateToConfi, _this$actSet6, _this$navigateToTabGr3, _this$navigateToTabGr4, _this$navigateToTabGr5;
45630
+ var doDefault, _this$navigateToTabGr2, _this$saveToBasketWra, configStepKey, _this$navigateToConfi, _this$actSet5, _this$navigateToTabGr3, _this$navigateToTabGr4, _this$navigateToTabGr5;
45277
45631
  return _regeneratorRuntime.wrap(function _callee17$(_context17) {
45278
45632
  while (1) switch (_context17.prev = _context17.next) {
45279
45633
  case 0:
@@ -45305,7 +45659,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
45305
45659
  if (doDefault) {
45306
45660
  if (plannerMode == 'ProductList') {
45307
45661
  (_this$navigateToTabGr3 = this.navigateToTabGroup) === null || _this$navigateToTabGr3 === void 0 || _this$navigateToTabGr3.call(this, 'PRODUCTS');
45308
- } else if ((_this$actSet6 = this.actSet()) !== null && _this$actSet6 !== void 0 && _this$actSet6.hasStaticRoomList) {
45662
+ } else if ((_this$actSet5 = this.actSet()) !== null && _this$actSet5 !== void 0 && _this$actSet5.hasStaticRoomList) {
45309
45663
  (_this$navigateToTabGr4 = this.navigateToTabGroup) === null || _this$navigateToTabGr4 === void 0 || _this$navigateToTabGr4.call(this, 'ROOMLIST', true);
45310
45664
  } else {
45311
45665
  (_this$navigateToTabGr5 = this.navigateToTabGroup) === null || _this$navigateToTabGr5 === void 0 || _this$navigateToTabGr5.call(this, this.getCurPlannerType(true), true);
@@ -45566,8 +45920,8 @@ var DivaWebPlanner = /*#__PURE__*/function () {
45566
45920
  }, {
45567
45921
  key: "getAlternateRenderingsForSummary",
45568
45922
  value: function getAlternateRenderingsForSummary() {
45569
- var _this$actSet7;
45570
- return (_this$actSet7 = this.actSet()) === null || _this$actSet7 === void 0 || (_this$actSet7 = _this$actSet7.CatalogData) === null || _this$actSet7 === void 0 ? void 0 : _this$actSet7.alternateRenderingsForSummary;
45923
+ var _this$actSet6;
45924
+ return (_this$actSet6 = this.actSet()) === null || _this$actSet6 === void 0 || (_this$actSet6 = _this$actSet6.CatalogData) === null || _this$actSet6 === void 0 ? void 0 : _this$actSet6.alternateRenderingsForSummary;
45571
45925
  }
45572
45926
  }, {
45573
45927
  key: "destroyWebPlanner",
@@ -45853,8 +46207,8 @@ var DivaWebPlanner = /*#__PURE__*/function () {
45853
46207
  }, {
45854
46208
  key: "setDifferentOptions",
45855
46209
  value: function setDifferentOptions(options) {
45856
- var _this$actSet8;
45857
- (_this$actSet8 = this.actSet()) === null || _this$actSet8 === void 0 || _this$actSet8.setDifferentOptions(options);
46210
+ var _this$actSet7;
46211
+ (_this$actSet7 = this.actSet()) === null || _this$actSet7 === void 0 || _this$actSet7.setDifferentOptions(options);
45858
46212
  }
45859
46213
  }, {
45860
46214
  key: "checkMatchingProducts",
@@ -45901,8 +46255,8 @@ var DivaWebPlanner = /*#__PURE__*/function () {
45901
46255
  }, {
45902
46256
  key: "updatePriceInView",
45903
46257
  value: function updatePriceInView() {
45904
- var _this$updatePrice, _this$actSet9;
45905
- (_this$updatePrice = this.updatePrice) === null || _this$updatePrice === void 0 || _this$updatePrice.call(this, setHandlerInstance.getTotalViewPrice(this.sets), this.actSet().getViewSetPrice(), setHandlerInstance.getTotalViewBruttoPrice(this.sets), undefined, (_this$actSet9 = this.actSet()) === null || _this$actSet9 === void 0 ? void 0 : _this$actSet9.getCustomDimensionsOfActSet());
46258
+ var _this$updatePrice, _this$actSet8, _this$actSet9;
46259
+ (_this$updatePrice = this.updatePrice) === null || _this$updatePrice === void 0 || _this$updatePrice.call(this, setHandlerInstance.getTotalViewPrice(this.sets), this.actSet().getViewSetPrice(), setHandlerInstance.getTotalViewBruttoPrice(this.sets), undefined, (_this$actSet8 = this.actSet()) === null || _this$actSet8 === void 0 ? void 0 : _this$actSet8.getCustomDimensionsOfActSet(), (_this$actSet9 = this.actSet()) === null || _this$actSet9 === void 0 ? void 0 : _this$actSet9.setHash);
45906
46260
  }
45907
46261
 
45908
46262
  /**
@@ -46194,6 +46548,127 @@ var DivaWebPlanner = /*#__PURE__*/function () {
46194
46548
  if (!set) return;
46195
46549
  return setHandlerInstance.checkNotificationRules(set, targetArticles, visitedOptions, event);
46196
46550
  }
46551
+ }, {
46552
+ key: "generateAiImageWithReferenceImages",
46553
+ value: function () {
46554
+ var _generateAiImageWithReferenceImages = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee28(data, leadKey) {
46555
+ var _this$state6;
46556
+ return _regeneratorRuntime.wrap(function _callee28$(_context28) {
46557
+ while (1) switch (_context28.prev = _context28.next) {
46558
+ case 0:
46559
+ _context28.next = 2;
46560
+ return this.api.generateAiImageWithReferenceImages(_objectSpread$6(_objectSpread$6({}, data), {}, {
46561
+ userId: (_this$state6 = this.state) === null || _this$state6 === void 0 || (_this$state6 = _this$state6.user) === null || _this$state6 === void 0 ? void 0 : _this$state6._id
46562
+ }), leadKey);
46563
+ case 2:
46564
+ return _context28.abrupt("return", _context28.sent);
46565
+ case 3:
46566
+ case "end":
46567
+ return _context28.stop();
46568
+ }
46569
+ }, _callee28, this);
46570
+ }));
46571
+ function generateAiImageWithReferenceImages(_x80, _x81) {
46572
+ return _generateAiImageWithReferenceImages.apply(this, arguments);
46573
+ }
46574
+ return generateAiImageWithReferenceImages;
46575
+ }()
46576
+ }, {
46577
+ key: "getUsageLimits",
46578
+ value: function () {
46579
+ var _getUsageLimits = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee29() {
46580
+ var _this$state7, _this$state8;
46581
+ var organizationId, userId;
46582
+ return _regeneratorRuntime.wrap(function _callee29$(_context29) {
46583
+ while (1) switch (_context29.prev = _context29.next) {
46584
+ case 0:
46585
+ organizationId = (_this$state7 = this.state) === null || _this$state7 === void 0 ? void 0 : _this$state7.organization._id;
46586
+ userId = (_this$state8 = this.state) === null || _this$state8 === void 0 || (_this$state8 = _this$state8.user) === null || _this$state8 === void 0 ? void 0 : _this$state8._id;
46587
+ if (!(!organizationId || !userId)) {
46588
+ _context29.next = 4;
46589
+ break;
46590
+ }
46591
+ throw new Error('Organization ID or User ID is not set');
46592
+ case 4:
46593
+ _context29.next = 6;
46594
+ return this.api.getUsageLimits({
46595
+ organizationId: organizationId,
46596
+ userId: userId
46597
+ });
46598
+ case 6:
46599
+ return _context29.abrupt("return", _context29.sent);
46600
+ case 7:
46601
+ case "end":
46602
+ return _context29.stop();
46603
+ }
46604
+ }, _callee29, this);
46605
+ }));
46606
+ function getUsageLimits() {
46607
+ return _getUsageLimits.apply(this, arguments);
46608
+ }
46609
+ return getUsageLimits;
46610
+ }()
46611
+ }, {
46612
+ key: "getAiRoomRenderings",
46613
+ value: function () {
46614
+ var _getAiRoomRenderings = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee30() {
46615
+ var _this$state9;
46616
+ var organizationId;
46617
+ return _regeneratorRuntime.wrap(function _callee30$(_context30) {
46618
+ while (1) switch (_context30.prev = _context30.next) {
46619
+ case 0:
46620
+ organizationId = (_this$state9 = this.state) === null || _this$state9 === void 0 ? void 0 : _this$state9.organization._id;
46621
+ _context30.next = 3;
46622
+ return this.api.getAiRoomRenderings(organizationId);
46623
+ case 3:
46624
+ return _context30.abrupt("return", _context30.sent);
46625
+ case 4:
46626
+ case "end":
46627
+ return _context30.stop();
46628
+ }
46629
+ }, _callee30, this);
46630
+ }));
46631
+ function getAiRoomRenderings() {
46632
+ return _getAiRoomRenderings.apply(this, arguments);
46633
+ }
46634
+ return getAiRoomRenderings;
46635
+ }()
46636
+ }, {
46637
+ key: "createLeadKey",
46638
+ value: function () {
46639
+ var _createLeadKey = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee31(email) {
46640
+ return _regeneratorRuntime.wrap(function _callee31$(_context31) {
46641
+ while (1) switch (_context31.prev = _context31.next) {
46642
+ case 0:
46643
+ _context31.next = 2;
46644
+ return this.api.createLeadKey(email);
46645
+ case 2:
46646
+ return _context31.abrupt("return", _context31.sent);
46647
+ case 3:
46648
+ case "end":
46649
+ return _context31.stop();
46650
+ }
46651
+ }, _callee31, this);
46652
+ }));
46653
+ function createLeadKey(_x82) {
46654
+ return _createLeadKey.apply(this, arguments);
46655
+ }
46656
+ return createLeadKey;
46657
+ }()
46658
+ }, {
46659
+ key: "clearAiImageAsJpg",
46660
+ value: function clearAiImageAsJpg() {
46661
+ var set = this.actSet();
46662
+ if (!set) return;
46663
+ set.clearAiImageAsJpg();
46664
+ }
46665
+ }, {
46666
+ key: "setAiImageAsJpg",
46667
+ value: function setAiImageAsJpg(promptId, base64) {
46668
+ var set = this.actSet();
46669
+ if (!set) return;
46670
+ set.setAiImageAsJpg(promptId, base64);
46671
+ }
46197
46672
  }, {
46198
46673
  key: "checkBannerRules",
46199
46674
  value: function checkBannerRules(visitedOptions, event) {
@@ -46231,8 +46706,8 @@ var DivaWebPlanner = /*#__PURE__*/function () {
46231
46706
  }
46232
46707
  }
46233
46708
  if (plannerType == 'JUMP_OVER_PLANNER_ONLY_MOBILE') {
46234
- var _this$state6;
46235
- if ((_this$state6 = this.state) !== null && _this$state6 !== void 0 && _this$state6.dimensions.isMobile) {
46709
+ var _this$state10;
46710
+ if ((_this$state10 = this.state) !== null && _this$state10 !== void 0 && _this$state10.dimensions.isMobile) {
46236
46711
  plannerType = 'JUMP_OVER_PLANNER';
46237
46712
  } else {
46238
46713
  plannerType = 'PLANNER';
@@ -46387,11 +46862,11 @@ var DivaWebPlanner = /*#__PURE__*/function () {
46387
46862
  }, {
46388
46863
  key: "getAllowRTV",
46389
46864
  value: function getAllowRTV() {
46390
- var _this$state7, _this$actSet26, _this$state8, _this$actSet27;
46865
+ var _this$state11, _this$actSet26, _this$state12, _this$actSet27;
46391
46866
  if (this.getEnableUnityRtvKombi()) return false;
46392
- if ((_this$state7 = this.state) !== null && _this$state7 !== void 0 && _this$state7.organization.settings.forceRTV) return true;
46867
+ if ((_this$state11 = this.state) !== null && _this$state11 !== void 0 && _this$state11.organization.settings.forceRTV) return true;
46393
46868
  if ((_this$actSet26 = this.actSet()) !== null && _this$actSet26 !== void 0 && _this$actSet26.CatalogData.divaForceRTV) return true;
46394
- if ((_this$state8 = this.state) !== null && _this$state8 !== void 0 && _this$state8.organization.settings.enableRTV && (_this$actSet27 = this.actSet()) !== null && _this$actSet27 !== void 0 && _this$actSet27.CatalogData.divaArReady) return true;
46869
+ if ((_this$state12 = this.state) !== null && _this$state12 !== void 0 && _this$state12.organization.settings.enableRTV && (_this$actSet27 = this.actSet()) !== null && _this$actSet27 !== void 0 && _this$actSet27.CatalogData.divaArReady) return true;
46395
46870
  return false;
46396
46871
  }
46397
46872
  }, {
@@ -46445,23 +46920,23 @@ var DivaWebPlanner = /*#__PURE__*/function () {
46445
46920
  }, {
46446
46921
  key: "getBasketDataWithEkText",
46447
46922
  value: function () {
46448
- var _getBasketDataWithEkText = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee28() {
46449
- return _regeneratorRuntime.wrap(function _callee28$(_context28) {
46450
- while (1) switch (_context28.prev = _context28.next) {
46923
+ var _getBasketDataWithEkText = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee32() {
46924
+ return _regeneratorRuntime.wrap(function _callee32$(_context32) {
46925
+ while (1) switch (_context32.prev = _context32.next) {
46451
46926
  case 0:
46452
- _context28.t0 = this.divaBasketHandler;
46453
- _context28.t1 = this.divaBasketHandler.actDivaNr;
46454
- _context28.next = 4;
46927
+ _context32.t0 = this.divaBasketHandler;
46928
+ _context32.t1 = this.divaBasketHandler.actDivaNr;
46929
+ _context32.next = 4;
46455
46930
  return setHandlerInstance.fillOrderLinesAndOrderSets(this.sets, this.divaBasketHandler, true, this.doAllowSetPlanner(), this.ReturnTo);
46456
46931
  case 4:
46457
- _context28.t2 = _context28.sent;
46458
- _context28.t0.setBasketData.call(_context28.t0, _context28.t1, _context28.t2);
46459
- return _context28.abrupt("return", this.divaBasketHandler.actBasket);
46932
+ _context32.t2 = _context32.sent;
46933
+ _context32.t0.setBasketData.call(_context32.t0, _context32.t1, _context32.t2);
46934
+ return _context32.abrupt("return", this.divaBasketHandler.actBasket);
46460
46935
  case 7:
46461
46936
  case "end":
46462
- return _context28.stop();
46937
+ return _context32.stop();
46463
46938
  }
46464
- }, _callee28, this);
46939
+ }, _callee32, this);
46465
46940
  }));
46466
46941
  function getBasketDataWithEkText() {
46467
46942
  return _getBasketDataWithEkText.apply(this, arguments);
@@ -46487,7 +46962,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
46487
46962
  }, {
46488
46963
  key: "addToBasket",
46489
46964
  value: function () {
46490
- var _addToBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee29(actBasket) {
46965
+ var _addToBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee33(actBasket) {
46491
46966
  var _this$actions36,
46492
46967
  _this$actions37,
46493
46968
  _this$actions38,
@@ -46506,44 +46981,44 @@ var DivaWebPlanner = /*#__PURE__*/function () {
46506
46981
  to,
46507
46982
  variants,
46508
46983
  products,
46509
- _args29 = arguments;
46510
- return _regeneratorRuntime.wrap(function _callee29$(_context29) {
46511
- while (1) switch (_context29.prev = _context29.next) {
46984
+ _args33 = arguments;
46985
+ return _regeneratorRuntime.wrap(function _callee33$(_context33) {
46986
+ while (1) switch (_context33.prev = _context33.next) {
46512
46987
  case 0:
46513
- event = _args29.length > 1 && _args29[1] !== undefined ? _args29[1] : 'onAddToBasket';
46514
- _context29.t0 = event;
46515
- _context29.next = _context29.t0 === 'onWebPlanerPrint' ? 4 : _context29.t0 === 'onWebPlanerSave' ? 6 : _context29.t0 === 'onWebPlanerShare' ? 8 : _context29.t0 === 'onRequestConsulation' ? 10 : _context29.t0 === 'onSave' ? 12 : _context29.t0 === 'onSendEmail' ? 14 : _context29.t0 === 'onSaveProduct' ? 19 : _context29.t0 === 'dontSaveBasket' ? 26 : _context29.t0 === 'onAddToBasket' ? 26 : 28;
46988
+ event = _args33.length > 1 && _args33[1] !== undefined ? _args33[1] : 'onAddToBasket';
46989
+ _context33.t0 = event;
46990
+ _context33.next = _context33.t0 === 'onWebPlanerPrint' ? 4 : _context33.t0 === 'onWebPlanerSave' ? 6 : _context33.t0 === 'onWebPlanerShare' ? 8 : _context33.t0 === 'onRequestConsulation' ? 10 : _context33.t0 === 'onSave' ? 12 : _context33.t0 === 'onSendEmail' ? 14 : _context33.t0 === 'onSaveProduct' ? 19 : _context33.t0 === 'dontSaveBasket' ? 26 : _context33.t0 === 'onAddToBasket' ? 26 : 28;
46516
46991
  break;
46517
46992
  case 4:
46518
46993
  (_this$actions36 = this.actions) === null || _this$actions36 === void 0 || _this$actions36.onEvent({
46519
46994
  type: 'onWebPlanerPrint',
46520
46995
  data: actBasket.getAsJson()
46521
46996
  });
46522
- return _context29.abrupt("break", 30);
46997
+ return _context33.abrupt("break", 30);
46523
46998
  case 6:
46524
46999
  (_this$actions37 = this.actions) === null || _this$actions37 === void 0 || _this$actions37.onEvent({
46525
47000
  type: 'onWebPlanerSave',
46526
47001
  data: actBasket.getAsJson()
46527
47002
  });
46528
- return _context29.abrupt("break", 30);
47003
+ return _context33.abrupt("break", 30);
46529
47004
  case 8:
46530
47005
  (_this$actions38 = this.actions) === null || _this$actions38 === void 0 || _this$actions38.onEvent({
46531
47006
  type: 'onWebPlanerShare',
46532
47007
  data: actBasket.getAsJson()
46533
47008
  });
46534
- return _context29.abrupt("break", 30);
47009
+ return _context33.abrupt("break", 30);
46535
47010
  case 10:
46536
47011
  (_this$actions39 = this.actions) === null || _this$actions39 === void 0 || _this$actions39.onEvent({
46537
47012
  type: 'onRequestConsulation',
46538
47013
  data: actBasket.getAsJson()
46539
47014
  });
46540
- return _context29.abrupt("break", 30);
47015
+ return _context33.abrupt("break", 30);
46541
47016
  case 12:
46542
47017
  (_this$actions40 = this.actions) === null || _this$actions40 === void 0 || _this$actions40.onEvent({
46543
47018
  type: 'onSave',
46544
47019
  data: actBasket.getAsJson()
46545
47020
  });
46546
- return _context29.abrupt("break", 30);
47021
+ return _context33.abrupt("break", 30);
46547
47022
  case 14:
46548
47023
  emailConfig = (_this$divaBasketHandl4 = this.divaBasketHandler.emailConfig) !== null && _this$divaBasketHandl4 !== void 0 ? _this$divaBasketHandl4 : this.getEmailConfig(); //reset the emailConfig
46549
47024
  this.divaBasketHandler.emailConfig = undefined;
@@ -46578,43 +47053,43 @@ var DivaWebPlanner = /*#__PURE__*/function () {
46578
47053
  type: 'onAddToBasket',
46579
47054
  data: actBasket.getAsJson()
46580
47055
  });
46581
- return _context29.abrupt("break", 30);
47056
+ return _context33.abrupt("break", 30);
46582
47057
  case 19:
46583
47058
  this.actSet().CatalogData;
46584
- _context29.next = 22;
47059
+ _context33.next = 22;
46585
47060
  return this.api.saveAsProduct(this.sets, actBasket);
46586
47061
  case 22:
46587
- products = _context29.sent;
47062
+ products = _context33.sent;
46588
47063
  (_this$actions42 = this.actions) === null || _this$actions42 === void 0 || _this$actions42.onEvent({
46589
47064
  type: 'onAddToBasket',
46590
47065
  data: actBasket.getAsJson()
46591
47066
  });
46592
47067
  if (!products) {
46593
- _context29.next = 26;
47068
+ _context33.next = 26;
46594
47069
  break;
46595
47070
  }
46596
- return _context29.abrupt("return", products[0]);
47071
+ return _context33.abrupt("return", products[0]);
46597
47072
  case 26:
46598
47073
  (_this$actions43 = this.actions) === null || _this$actions43 === void 0 || _this$actions43.onEvent({
46599
47074
  type: 'onAddToBasket',
46600
47075
  data: actBasket.getAsJson()
46601
47076
  });
46602
- return _context29.abrupt("break", 30);
47077
+ return _context33.abrupt("break", 30);
46603
47078
  case 28:
46604
47079
  (_this$actions44 = this.actions) === null || _this$actions44 === void 0 || _this$actions44.onEvent({
46605
47080
  type: event,
46606
47081
  data: actBasket.getAsJson()
46607
47082
  });
46608
- return _context29.abrupt("break", 30);
47083
+ return _context33.abrupt("break", 30);
46609
47084
  case 30:
46610
- return _context29.abrupt("return");
47085
+ return _context33.abrupt("return");
46611
47086
  case 31:
46612
47087
  case "end":
46613
- return _context29.stop();
47088
+ return _context33.stop();
46614
47089
  }
46615
- }, _callee29, this);
47090
+ }, _callee33, this);
46616
47091
  }));
46617
- function addToBasket(_x80) {
47092
+ function addToBasket(_x83) {
46618
47093
  return _addToBasket.apply(this, arguments);
46619
47094
  }
46620
47095
  return addToBasket;
@@ -46669,28 +47144,28 @@ var DivaWebPlanner = /*#__PURE__*/function () {
46669
47144
  }, {
46670
47145
  key: "getCurrentBasket",
46671
47146
  value: function () {
46672
- var _getCurrentBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee30(event, force, returnTo, dontGoToSummary, hideLoading) {
47147
+ var _getCurrentBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee34(event, force, returnTo, dontGoToSummary, hideLoading) {
46673
47148
  var _this$actSet35, _this$divaBasketHandl5, _this$onClickAddToBas3;
46674
- return _regeneratorRuntime.wrap(function _callee30$(_context30) {
46675
- while (1) switch (_context30.prev = _context30.next) {
47149
+ return _regeneratorRuntime.wrap(function _callee34$(_context34) {
47150
+ while (1) switch (_context34.prev = _context34.next) {
46676
47151
  case 0:
46677
47152
  if (!(this.divaBasketHandler.basketWasSavedWithCurrentDocVersion && ((_this$actSet35 = this.actSet()) === null || _this$actSet35 === void 0 ? void 0 : _this$actSet35.setHash) === ((_this$divaBasketHandl5 = this.divaBasketHandler.actBasket) === null || _this$divaBasketHandl5 === void 0 || (_this$divaBasketHandl5 = _this$divaBasketHandl5.OrderSets) === null || _this$divaBasketHandl5 === void 0 ? void 0 : _this$divaBasketHandl5[0].SetHash) && !(returnTo !== null && returnTo !== void 0 && returnTo.includes('OPEN')))) {
46678
- _context30.next = 2;
47153
+ _context34.next = 2;
46679
47154
  break;
46680
47155
  }
46681
- return _context30.abrupt("return", 'BASKET_ALREADY_SAVED');
47156
+ return _context34.abrupt("return", 'BASKET_ALREADY_SAVED');
46682
47157
  case 2:
46683
- _context30.next = 4;
47158
+ _context34.next = 4;
46684
47159
  return (_this$onClickAddToBas3 = this.onClickAddToBasket) === null || _this$onClickAddToBas3 === void 0 ? void 0 : _this$onClickAddToBas3.call(this, undefined, event, force, returnTo, dontGoToSummary, hideLoading);
46685
47160
  case 4:
46686
- return _context30.abrupt("return", !!_context30.sent);
47161
+ return _context34.abrupt("return", !!_context34.sent);
46687
47162
  case 5:
46688
47163
  case "end":
46689
- return _context30.stop();
47164
+ return _context34.stop();
46690
47165
  }
46691
- }, _callee30, this);
47166
+ }, _callee34, this);
46692
47167
  }));
46693
- function getCurrentBasket(_x81, _x82, _x83, _x84, _x85) {
47168
+ function getCurrentBasket(_x84, _x85, _x86, _x87, _x88) {
46694
47169
  return _getCurrentBasket.apply(this, arguments);
46695
47170
  }
46696
47171
  return getCurrentBasket;
@@ -46912,9 +47387,9 @@ var DivaWebPlanner = /*#__PURE__*/function () {
46912
47387
  key: "initApiForLogicOnly",
46913
47388
  value: //just for testing purposes
46914
47389
  function () {
46915
- var _initApiForLogicOnly = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee31(organization, lang, getSessionGuid, handler, applicationEnvironment, apiKey, jwt) {
46916
- return _regeneratorRuntime.wrap(function _callee31$(_context31) {
46917
- while (1) switch (_context31.prev = _context31.next) {
47390
+ var _initApiForLogicOnly = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee35(organization, lang, getSessionGuid, handler, applicationEnvironment, apiKey, jwt) {
47391
+ return _regeneratorRuntime.wrap(function _callee35$(_context35) {
47392
+ while (1) switch (_context35.prev = _context35.next) {
46918
47393
  case 0:
46919
47394
  //empty services
46920
47395
  this.api = new DivaApiHandler(_objectSpread$6(_objectSpread$6({}, this.plannerConfig), {}, {
@@ -46927,17 +47402,17 @@ var DivaWebPlanner = /*#__PURE__*/function () {
46927
47402
  jwt: jwt,
46928
47403
  apiKey: apiKey
46929
47404
  }), handler);
46930
- _context31.next = 3;
47405
+ _context35.next = 3;
46931
47406
  return this.divaBasketHandler.initWWSClient(this.api.getWWSClient());
46932
47407
  case 3:
46933
47408
  this.plannerHandler = new DivaPlannerHandler(true);
46934
47409
  case 4:
46935
47410
  case "end":
46936
- return _context31.stop();
47411
+ return _context35.stop();
46937
47412
  }
46938
- }, _callee31, this);
47413
+ }, _callee35, this);
46939
47414
  }));
46940
- function initApiForLogicOnly(_x86, _x87, _x88, _x89, _x90, _x91, _x92) {
47415
+ function initApiForLogicOnly(_x89, _x90, _x91, _x92, _x93, _x94, _x95) {
46941
47416
  return _initApiForLogicOnly.apply(this, arguments);
46942
47417
  }
46943
47418
  return initApiForLogicOnly;
@@ -46950,16 +47425,16 @@ var DivaWebPlanner = /*#__PURE__*/function () {
46950
47425
  }, {
46951
47426
  key: "loadBasket",
46952
47427
  value: function () {
46953
- var _loadBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee32() {
46954
- return _regeneratorRuntime.wrap(function _callee32$(_context32) {
46955
- while (1) switch (_context32.prev = _context32.next) {
47428
+ var _loadBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee36() {
47429
+ return _regeneratorRuntime.wrap(function _callee36$(_context36) {
47430
+ while (1) switch (_context36.prev = _context36.next) {
46956
47431
  case 0:
46957
- return _context32.abrupt("return", this.divaBasketHandler.initializeBasket(this.api));
47432
+ return _context36.abrupt("return", this.divaBasketHandler.initializeBasket(this.api));
46958
47433
  case 1:
46959
47434
  case "end":
46960
- return _context32.stop();
47435
+ return _context36.stop();
46961
47436
  }
46962
- }, _callee32, this);
47437
+ }, _callee36, this);
46963
47438
  }));
46964
47439
  function loadBasket() {
46965
47440
  return _loadBasket.apply(this, arguments);
@@ -46974,39 +47449,39 @@ var DivaWebPlanner = /*#__PURE__*/function () {
46974
47449
  }, {
46975
47450
  key: "initBasket",
46976
47451
  value: function () {
46977
- var _initBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee33(init3D, ignoreFavorites) {
47452
+ var _initBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee37(init3D, ignoreFavorites) {
46978
47453
  var initSetState, set, basket;
46979
- return _regeneratorRuntime.wrap(function _callee33$(_context33) {
46980
- while (1) switch (_context33.prev = _context33.next) {
47454
+ return _regeneratorRuntime.wrap(function _callee37$(_context37) {
47455
+ while (1) switch (_context37.prev = _context37.next) {
46981
47456
  case 0:
46982
47457
  this.divaNr = this.divaBasketHandler.actDivaNr;
46983
47458
  initSetState = this.getInitStateForSet(!init3D);
46984
47459
  this.plannerHandler.initPlanner(initSetState, this.getPlannerHandlerFunctions());
46985
- _context33.next = 5;
47460
+ _context37.next = 5;
46986
47461
  return setHandlerInstance.initSetsByOrderSet(this.divaBasketHandler.getOrderSetsByDivaNr(this.divaNr), initSetState);
46987
47462
  case 5:
46988
47463
  //TODO check if when basket gets repaired the product match gets called
46989
47464
  set = this.actSet();
46990
47465
  setHandlerInstance.loadConfigStructureOfActSet(set, this.getCurPlannerType());
46991
47466
  if (!(favoritesHandlerInstance.FavoritesDefined(set) && !ignoreFavorites)) {
46992
- _context33.next = 10;
47467
+ _context37.next = 10;
46993
47468
  break;
46994
47469
  }
46995
- _context33.next = 10;
47470
+ _context37.next = 10;
46996
47471
  return this.handleFavorites(init3D ? 'CALC' : 'REPAIR');
46997
47472
  case 10:
46998
- _context33.next = 12;
47473
+ _context37.next = 12;
46999
47474
  return setHandlerInstance.fillOrderLinesAndOrderSets(this.sets, this.divaBasketHandler, !init3D, this.doAllowSetPlanner(), this.ReturnTo);
47000
47475
  case 12:
47001
- basket = _context33.sent;
47002
- return _context33.abrupt("return", basket);
47476
+ basket = _context37.sent;
47477
+ return _context37.abrupt("return", basket);
47003
47478
  case 14:
47004
47479
  case "end":
47005
- return _context33.stop();
47480
+ return _context37.stop();
47006
47481
  }
47007
- }, _callee33, this);
47482
+ }, _callee37, this);
47008
47483
  }));
47009
- function initBasket(_x93, _x94) {
47484
+ function initBasket(_x96, _x97) {
47010
47485
  return _initBasket.apply(this, arguments);
47011
47486
  }
47012
47487
  return initBasket;
@@ -47020,21 +47495,21 @@ var DivaWebPlanner = /*#__PURE__*/function () {
47020
47495
  }, {
47021
47496
  key: "getValidVariantsLength",
47022
47497
  value: function () {
47023
- var _getValidVariantsLength = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee34() {
47498
+ var _getValidVariantsLength = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee38() {
47024
47499
  var set;
47025
- return _regeneratorRuntime.wrap(function _callee34$(_context34) {
47026
- while (1) switch (_context34.prev = _context34.next) {
47500
+ return _regeneratorRuntime.wrap(function _callee38$(_context38) {
47501
+ while (1) switch (_context38.prev = _context38.next) {
47027
47502
  case 0:
47028
47503
  set = this.actSet();
47029
- _context34.next = 3;
47504
+ _context38.next = 3;
47030
47505
  return favoritesHandlerInstance.getValidVariants(set, true);
47031
47506
  case 3:
47032
- return _context34.abrupt("return", _context34.sent.length);
47507
+ return _context38.abrupt("return", _context38.sent.length);
47033
47508
  case 4:
47034
47509
  case "end":
47035
- return _context34.stop();
47510
+ return _context38.stop();
47036
47511
  }
47037
- }, _callee34, this);
47512
+ }, _callee38, this);
47038
47513
  }));
47039
47514
  function getValidVariantsLength() {
47040
47515
  return _getValidVariantsLength.apply(this, arguments);
@@ -47044,46 +47519,46 @@ var DivaWebPlanner = /*#__PURE__*/function () {
47044
47519
  }, {
47045
47520
  key: "handleFavorites",
47046
47521
  value: function () {
47047
- var _handleFavorites = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee35(mode) {
47522
+ var _handleFavorites = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee39(mode) {
47048
47523
  var _this5 = this;
47049
47524
  var set, i;
47050
- return _regeneratorRuntime.wrap(function _callee35$(_context35) {
47051
- while (1) switch (_context35.prev = _context35.next) {
47525
+ return _regeneratorRuntime.wrap(function _callee39$(_context39) {
47526
+ while (1) switch (_context39.prev = _context39.next) {
47052
47527
  case 0:
47053
47528
  set = this.actSet();
47054
47529
  i = 0;
47055
47530
  case 2:
47056
47531
  if (!favoritesHandlerInstance.IsCalcForSummary) {
47057
- _context35.next = 11;
47532
+ _context39.next = 11;
47058
47533
  break;
47059
47534
  }
47060
- _context35.next = 5;
47535
+ _context39.next = 5;
47061
47536
  return DivaUtils.Sleep(200);
47062
47537
  case 5:
47063
47538
  i++;
47064
47539
  if (!(i > 1000)) {
47065
- _context35.next = 9;
47540
+ _context39.next = 9;
47066
47541
  break;
47067
47542
  }
47068
47543
  LOG$1.error(new DivaError('error on generating Variants of Summary'));
47069
- return _context35.abrupt("break", 11);
47544
+ return _context39.abrupt("break", 11);
47070
47545
  case 9:
47071
- _context35.next = 2;
47546
+ _context39.next = 2;
47072
47547
  break;
47073
47548
  case 11:
47074
- _context35.next = 13;
47549
+ _context39.next = 13;
47075
47550
  return favoritesHandlerInstance.handleFavorites(set, mode, this.divaBasketHandler.actBasket, this.saveToBasketWrapper.bind(this), this.doConfigure.bind(this), function () {
47076
47551
  return _this5.update2DGrid(set);
47077
47552
  }, this.actions);
47078
47553
  case 13:
47079
- return _context35.abrupt("return", _context35.sent);
47554
+ return _context39.abrupt("return", _context39.sent);
47080
47555
  case 14:
47081
47556
  case "end":
47082
- return _context35.stop();
47557
+ return _context39.stop();
47083
47558
  }
47084
- }, _callee35, this);
47559
+ }, _callee39, this);
47085
47560
  }));
47086
- function handleFavorites(_x95) {
47561
+ function handleFavorites(_x98) {
47087
47562
  return _handleFavorites.apply(this, arguments);
47088
47563
  }
47089
47564
  return handleFavorites;
@@ -47096,48 +47571,48 @@ var DivaWebPlanner = /*#__PURE__*/function () {
47096
47571
  }, {
47097
47572
  key: "initSapOrderLinesFromBasket",
47098
47573
  value: function () {
47099
- var _initSapOrderLinesFromBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee36(divaNr, init3D, onlyLoadOldBakset) {
47574
+ var _initSapOrderLinesFromBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee40(divaNr, init3D, onlyLoadOldBakset) {
47100
47575
  var result, oldBasket, basket;
47101
- return _regeneratorRuntime.wrap(function _callee36$(_context36) {
47102
- while (1) switch (_context36.prev = _context36.next) {
47576
+ return _regeneratorRuntime.wrap(function _callee40$(_context40) {
47577
+ while (1) switch (_context40.prev = _context40.next) {
47103
47578
  case 0:
47104
47579
  if (divaNr) this.divaBasketHandler.updateDivaNrInBasket(divaNr);
47105
- _context36.next = 3;
47580
+ _context40.next = 3;
47106
47581
  return this.loadBasket();
47107
47582
  case 3:
47108
- result = _context36.sent;
47583
+ result = _context40.sent;
47109
47584
  if (!onlyLoadOldBakset) {
47110
- _context36.next = 6;
47585
+ _context40.next = 6;
47111
47586
  break;
47112
47587
  }
47113
- return _context36.abrupt("return", {
47588
+ return _context40.abrupt("return", {
47114
47589
  oldBasket: new BasketData(JSON.parse(JSON.stringify(this.divaBasketHandler.actBasket))),
47115
47590
  cache: {}
47116
47591
  });
47117
47592
  case 6:
47118
47593
  if (!(result === false)) {
47119
- _context36.next = 8;
47594
+ _context40.next = 8;
47120
47595
  break;
47121
47596
  }
47122
47597
  throw new Error('Could not load basket! ' + divaNr);
47123
47598
  case 8:
47124
47599
  oldBasket = new BasketData(JSON.parse(JSON.stringify(this.divaBasketHandler.actBasket)));
47125
- _context36.next = 11;
47600
+ _context40.next = 11;
47126
47601
  return this.initBasket(init3D);
47127
47602
  case 11:
47128
- basket = _context36.sent;
47129
- return _context36.abrupt("return", {
47603
+ basket = _context40.sent;
47604
+ return _context40.abrupt("return", {
47130
47605
  basket: basket,
47131
47606
  oldBasket: oldBasket,
47132
47607
  cache: this.api.getJsonDataCache()
47133
47608
  });
47134
47609
  case 13:
47135
47610
  case "end":
47136
- return _context36.stop();
47611
+ return _context40.stop();
47137
47612
  }
47138
- }, _callee36, this);
47613
+ }, _callee40, this);
47139
47614
  }));
47140
- function initSapOrderLinesFromBasket(_x96, _x97, _x98) {
47615
+ function initSapOrderLinesFromBasket(_x99, _x100, _x101) {
47141
47616
  return _initSapOrderLinesFromBasket.apply(this, arguments);
47142
47617
  }
47143
47618
  return initSapOrderLinesFromBasket;
@@ -65390,6 +65865,7 @@ var a$3 = {
65390
65865
  idmService: 'https://api-test.diva-portal.com/idm',
65391
65866
  constructorService: 'https://api-test.diva-portal.com/constructor',
65392
65867
  mediaService: 'https://api-test.diva-portal.com/media',
65868
+ aiService: 'https://api-test.diva-portal.com/ai',
65393
65869
  baseUrl: 'https://api-test.diva-portal.com',
65394
65870
  baseCdnUrl: 'https://cdn-test.diva-portal.com',
65395
65871
  api2: {
@@ -65457,6 +65933,7 @@ var a$2 = {
65457
65933
  reportService: 'https://diva-api.pfister.ch/report',
65458
65934
  enricherService: 'https://diva-api.pfister.ch/enricher',
65459
65935
  idmService: 'https://diva-api.pfister.ch/idm',
65936
+ aiService: 'https://diva-api.pfister.ch/ai',
65460
65937
  mediaService: 'https://diva-api.pfister.ch/media',
65461
65938
  //'http://localhost:3000',
65462
65939
  clientArticleService: 'https://diva-api.pfister.ch/pfister-article',
@@ -65515,6 +65992,7 @@ var a$1 = {
65515
65992
  mediaService: 'https://q-diva-api.pfister.ch/media',
65516
65993
  // 'http://localhost:3000',
65517
65994
  enricherService: 'https://q-diva-api.pfister.ch/enricher',
65995
+ aiService: 'https://q-diva-api.pfister.ch/ai',
65518
65996
  idmService: 'https://q-diva-api.pfister.ch/idm',
65519
65997
  clientArticleService: 'https://q-diva-api.pfister.ch/pfister-article',
65520
65998
  baseUrl: 'https://q-diva-api.pfister.ch',