@crystaldesign/web-planner-logic 24.12.0-beta.9 → 24.13.0-beta.1

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 (88) hide show
  1. package/build/cjs/{DivaBoxPlanner-7b508f32.js → DivaBoxPlanner-d7da16a8.js} +2 -2
  2. package/build/cjs/{DivaStandardPlanner-c73e6e57.js → DivaStandardPlanner-d498cfee.js} +9 -8
  3. package/build/cjs/{DoorPlanner-ffa7af62.js → DoorPlanner-e764c8fb.js} +3 -3
  4. package/build/cjs/{Host3DSignalR-d3830717.js → Host3DSignalR-600ce869.js} +20 -38
  5. package/build/cjs/{LiviqueWWSHandler-85a1dc89.js → LiviqueWWSHandler-3c5f38b8.js} +2 -2
  6. package/build/cjs/{PfisterWWSHandler-b47dba23.js → PfisterWWSHandler-f0420b6e.js} +2 -2
  7. package/build/cjs/{PlannerHandler2D-9d9d1af9.js → PlannerHandler2D-a6c5bc70.js} +37 -32
  8. package/build/cjs/{SeriousBasketHandler-28f031fa.js → SeriousBasketHandler-3e286b68.js} +2 -2
  9. package/build/cjs/{ShelfPlanner-4b697826.js → ShelfPlanner-22e3e6a5.js} +1 -1
  10. package/build/cjs/{StandardWWSHandler-ab0c107b.js → StandardWWSHandler-c2ac4b39.js} +2 -2
  11. package/build/cjs/{index-bceec53b.js → index-96d8f124.js} +774 -1450
  12. package/build/cjs/index.js +1 -2
  13. package/build/esm/{DivaBoxPlanner-81bbe89c.js → DivaBoxPlanner-4ee51455.js} +2 -2
  14. package/build/esm/{DivaStandardPlanner-c3f7e518.js → DivaStandardPlanner-ca3c5ef2.js} +9 -8
  15. package/build/esm/{DoorPlanner-f4b338c4.js → DoorPlanner-a283b46f.js} +3 -3
  16. package/build/esm/{Host3DSignalR-45bb9e24.js → Host3DSignalR-bb7dd950.js} +20 -19
  17. package/build/esm/{LiviqueWWSHandler-d401b8c4.js → LiviqueWWSHandler-d83dd6af.js} +2 -2
  18. package/build/esm/{PfisterWWSHandler-ebfad71d.js → PfisterWWSHandler-48eecaae.js} +2 -2
  19. package/build/esm/{PlannerHandler2D-fb755d99.js → PlannerHandler2D-c2477409.js} +37 -32
  20. package/build/esm/{SeriousBasketHandler-53ff90b8.js → SeriousBasketHandler-13fcc1aa.js} +2 -2
  21. package/build/esm/{ShelfPlanner-569fe7f0.js → ShelfPlanner-31b3a870.js} +1 -1
  22. package/build/esm/{StandardWWSHandler-b903e37c.js → StandardWWSHandler-f96ca8c7.js} +2 -2
  23. package/build/esm/{index-3bbc6483.js → index-e2c00fcd.js} +776 -1450
  24. package/build/esm/index.js +1 -1
  25. package/build/types/web-planner-logic/src/index.d.ts +1 -2
  26. package/build/types/web-planner-logic/src/index.d.ts.map +1 -1
  27. package/build/types/web-planner-logic/src/interface/Articles/ArticleDataType.d.ts +1 -2
  28. package/build/types/web-planner-logic/src/interface/Articles/ArticleDataType.d.ts.map +1 -1
  29. package/build/types/web-planner-logic/src/interface/Articles/ArticleInfoType.d.ts +1 -2
  30. package/build/types/web-planner-logic/src/interface/Articles/ArticleInfoType.d.ts.map +1 -1
  31. package/build/types/web-planner-logic/src/interface/Articles/InitArticleType.d.ts +2 -2
  32. package/build/types/web-planner-logic/src/interface/Articles/InitArticleType.d.ts.map +1 -1
  33. package/build/types/web-planner-logic/src/interface/Basket/IDivaWWSHandler.d.ts +1 -3
  34. package/build/types/web-planner-logic/src/interface/Basket/IDivaWWSHandler.d.ts.map +1 -1
  35. package/build/types/web-planner-logic/src/interface/Configuration.d.ts +0 -1
  36. package/build/types/web-planner-logic/src/interface/Configuration.d.ts.map +1 -1
  37. package/build/types/web-planner-logic/src/interface/CoreTypes/index.d.ts +2 -0
  38. package/build/types/web-planner-logic/src/interface/CoreTypes/index.d.ts.map +1 -1
  39. package/build/types/web-planner-logic/src/interface/DivaCatalogDataType.d.ts +1 -0
  40. package/build/types/web-planner-logic/src/interface/DivaCatalogDataType.d.ts.map +1 -1
  41. package/build/types/web-planner-logic/src/interface/Products/index.d.ts +6 -1
  42. package/build/types/web-planner-logic/src/interface/Products/index.d.ts.map +1 -1
  43. package/build/types/web-planner-logic/src/interface/ShelfPlanner/plannerData.d.ts +1 -1
  44. package/build/types/web-planner-logic/src/logic/Article/DivaArticle.d.ts +6 -6
  45. package/build/types/web-planner-logic/src/logic/Article/DivaArticle.d.ts.map +1 -1
  46. package/build/types/web-planner-logic/src/logic/Basket/DivaBasketHandler.d.ts +50 -57
  47. package/build/types/web-planner-logic/src/logic/Basket/DivaBasketHandler.d.ts.map +1 -1
  48. package/build/types/web-planner-logic/src/logic/Basket/LiviqueWWSHandler.d.ts +1 -3
  49. package/build/types/web-planner-logic/src/logic/Basket/LiviqueWWSHandler.d.ts.map +1 -1
  50. package/build/types/web-planner-logic/src/logic/Basket/PfisterWWSHandler.d.ts +1 -3
  51. package/build/types/web-planner-logic/src/logic/Basket/PfisterWWSHandler.d.ts.map +1 -1
  52. package/build/types/web-planner-logic/src/logic/Basket/SeriousBasketHandler.d.ts +1 -3
  53. package/build/types/web-planner-logic/src/logic/Basket/SeriousBasketHandler.d.ts.map +1 -1
  54. package/build/types/web-planner-logic/src/logic/Basket/StandardWWSHandler.d.ts +1 -3
  55. package/build/types/web-planner-logic/src/logic/Basket/StandardWWSHandler.d.ts.map +1 -1
  56. package/build/types/web-planner-logic/src/logic/ConfigTree/Shelfplanner/ShelfPlanner.d.ts +2 -2
  57. package/build/types/web-planner-logic/src/logic/ConfigTree/SummaryHandler.d.ts +1 -2
  58. package/build/types/web-planner-logic/src/logic/ConfigTree/SummaryHandler.d.ts.map +1 -1
  59. package/build/types/web-planner-logic/src/logic/DivaApiHandler.d.ts +3 -4
  60. package/build/types/web-planner-logic/src/logic/DivaApiHandler.d.ts.map +1 -1
  61. package/build/types/web-planner-logic/src/logic/DivaWebPlanner.d.ts +56 -61
  62. package/build/types/web-planner-logic/src/logic/DivaWebPlanner.d.ts.map +1 -1
  63. package/build/types/web-planner-logic/src/logic/Planner/DivaStandardPlanner.d.ts +0 -2
  64. package/build/types/web-planner-logic/src/logic/Planner/DivaStandardPlanner.d.ts.map +1 -1
  65. package/build/types/web-planner-logic/src/logic/Planner/Rendering/Rendering.d.ts +12 -13
  66. package/build/types/web-planner-logic/src/logic/Planner/Rendering/Rendering.d.ts.map +1 -1
  67. package/build/types/web-planner-logic/src/logic/Product/DivaProductHandler.d.ts +3 -44
  68. package/build/types/web-planner-logic/src/logic/Product/DivaProductHandler.d.ts.map +1 -1
  69. package/build/types/web-planner-logic/src/logic/Set/DivaSet.d.ts +5 -5
  70. package/build/types/web-planner-logic/src/logic/Set/DivaSet.d.ts.map +1 -1
  71. package/build/types/web-planner-logic/src/logic/Set/DivaSetHandler.d.ts +3 -6
  72. package/build/types/web-planner-logic/src/logic/Set/DivaSetHandler.d.ts.map +1 -1
  73. package/build/types/web-planner-logic/src/logic/Set/FavoritesHandler.d.ts.map +1 -1
  74. package/build/types/web-planner-logic/src/model/Articles/CatalogArticleData.d.ts.map +1 -1
  75. package/build/types/web-planner-logic/src/model/DivaCatalogData.d.ts +3 -2
  76. package/build/types/web-planner-logic/src/model/DivaCatalogData.d.ts.map +1 -1
  77. package/build/types/web-planner-logic/src/model/Options/CatalogOptionValueData.d.ts.map +1 -1
  78. package/build/types/web-planner-logic/src/test/mocFunctions/index.d.ts.map +1 -1
  79. package/build/types/web-planner-logic/src/test/scripts/create_renderorder.d.ts.map +1 -1
  80. package/build/types/web-planner-logic/src/test/scripts/getOrigProductId.d.ts.map +1 -1
  81. package/build/types/web-planner-logic/src/test/scripts/productHandlerMoc.d.ts.map +1 -1
  82. package/package.json +16 -17
  83. package/build/cjs/ProductBasketHandler-22cb7ee4.js +0 -62
  84. package/build/esm/ProductBasketHandler-68443648.js +0 -55
  85. package/build/types/web-planner-logic/src/logic/Basket/ProductBasketHandler.d.ts +0 -14
  86. package/build/types/web-planner-logic/src/logic/Basket/ProductBasketHandler.d.ts.map +0 -1
  87. package/build/types/web-planner-logic/src/logic/Product/Product.d.ts +0 -71
  88. package/build/types/web-planner-logic/src/logic/Product/Product.d.ts.map +0 -1
@@ -431,7 +431,6 @@ var DivaApiHandler = /*#__PURE__*/function () {
431
431
  mediaServiceApiKey: data.divaMediaServiceApiKey,
432
432
  language: lang !== null && lang !== void 0 ? lang : this.getLanguage(),
433
433
  abTestCases: data.abTestCases !== undefined ? data.abTestCases : [],
434
- checkForProductsInStock: data.checkForProductsInStock,
435
434
  checkForProductsPrice: data.checkForProductsPrice,
436
435
  doDisablePlanner2D: data.doDisablePlanner2D,
437
436
  diva3dStaticBGImage: data.diva3dStaticBGImage != undefined ? data.diva3dStaticBGImage : false,
@@ -503,29 +502,23 @@ var DivaApiHandler = /*#__PURE__*/function () {
503
502
  var _this$apiConfig$host, _this$apiConfig10;
504
503
  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 : '';
505
504
  }
506
- }, {
507
- key: "doCheckForProductsInStock",
508
- value: function doCheckForProductsInStock() {
509
- var _this$divaWebConfigDa4;
510
- return (_this$divaWebConfigDa4 = this.divaWebConfigData) === null || _this$divaWebConfigDa4 === void 0 ? void 0 : _this$divaWebConfigDa4.checkForProductsInStock;
511
- }
512
505
  }, {
513
506
  key: "doCheckForProductsPrice",
514
507
  value: function doCheckForProductsPrice() {
515
- var _this$divaWebConfigDa5;
516
- return this.doCheckForProductsInStock() || ((_this$divaWebConfigDa5 = this.divaWebConfigData) === null || _this$divaWebConfigDa5 === void 0 ? void 0 : _this$divaWebConfigDa5.checkForProductsPrice);
508
+ var _this$divaWebConfigDa4;
509
+ return (_this$divaWebConfigDa4 = this.divaWebConfigData) === null || _this$divaWebConfigDa4 === void 0 ? void 0 : _this$divaWebConfigDa4.checkForProductsPrice;
517
510
  }
518
511
  }, {
519
512
  key: "getReportConfigIdentifier",
520
513
  value: function getReportConfigIdentifier() {
521
- var _this$divaWebConfigDa6;
522
- return (_this$divaWebConfigDa6 = this.divaWebConfigData) === null || _this$divaWebConfigDa6 === void 0 ? void 0 : _this$divaWebConfigDa6.reportConfigIdentifier;
514
+ var _this$divaWebConfigDa5;
515
+ return (_this$divaWebConfigDa5 = this.divaWebConfigData) === null || _this$divaWebConfigDa5 === void 0 ? void 0 : _this$divaWebConfigDa5.reportConfigIdentifier;
523
516
  }
524
517
  }, {
525
518
  key: "getPrintOptions",
526
519
  value: function getPrintOptions() {
527
- var _this$divaWebConfigDa7;
528
- var reportConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : (_this$divaWebConfigDa7 = this.divaWebConfigData) === null || _this$divaWebConfigDa7 === void 0 ? void 0 : _this$divaWebConfigDa7.reportConfig;
520
+ var _this$divaWebConfigDa6;
521
+ var reportConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : (_this$divaWebConfigDa6 = this.divaWebConfigData) === null || _this$divaWebConfigDa6 === void 0 ? void 0 : _this$divaWebConfigDa6.reportConfig;
529
522
  return {
530
523
  Gdpr: !!(reportConfig !== null && reportConfig !== void 0 && reportConfig.printWithGDPR),
531
524
  PlanningSketch: !!(reportConfig !== null && reportConfig !== void 0 && reportConfig.printWithPlanningSketch),
@@ -545,8 +538,8 @@ var DivaApiHandler = /*#__PURE__*/function () {
545
538
  }, {
546
539
  key: "get3DRenderGroup",
547
540
  value: function get3DRenderGroup() {
548
- var _this$divaWebConfigDa8, _this$divaWebConfigDa9;
549
- return (_this$divaWebConfigDa8 = (_this$divaWebConfigDa9 = this.divaWebConfigData) === null || _this$divaWebConfigDa9 === void 0 ? void 0 : _this$divaWebConfigDa9.diva3dRenderGroup) !== null && _this$divaWebConfigDa8 !== void 0 ? _this$divaWebConfigDa8 : '';
541
+ var _this$divaWebConfigDa7, _this$divaWebConfigDa8;
542
+ return (_this$divaWebConfigDa7 = (_this$divaWebConfigDa8 = this.divaWebConfigData) === null || _this$divaWebConfigDa8 === void 0 ? void 0 : _this$divaWebConfigDa8.diva3dRenderGroup) !== null && _this$divaWebConfigDa7 !== void 0 ? _this$divaWebConfigDa7 : '';
550
543
  }
551
544
  }, {
552
545
  key: "getServerId",
@@ -583,86 +576,86 @@ var DivaApiHandler = /*#__PURE__*/function () {
583
576
  }, {
584
577
  key: "getDiva3dStaticBGImage",
585
578
  value: function getDiva3dStaticBGImage() {
586
- var _this$divaWebConfigDa10;
587
- return (_this$divaWebConfigDa10 = this.divaWebConfigData) === null || _this$divaWebConfigDa10 === void 0 ? void 0 : _this$divaWebConfigDa10.diva3dStaticBGImage;
579
+ var _this$divaWebConfigDa9;
580
+ return (_this$divaWebConfigDa9 = this.divaWebConfigData) === null || _this$divaWebConfigDa9 === void 0 ? void 0 : _this$divaWebConfigDa9.diva3dStaticBGImage;
588
581
  }
589
582
  }, {
590
583
  key: "getDiva3dStaticBGImage_DefaultRoomList",
591
584
  value: function getDiva3dStaticBGImage_DefaultRoomList() {
592
- var _this$divaWebConfigDa11, _this$divaWebConfigDa12;
593
- return ((_this$divaWebConfigDa11 = this.divaWebConfigData) === null || _this$divaWebConfigDa11 === void 0 ? void 0 : _this$divaWebConfigDa11.diva3dStaticBGImage_DefaultRoomList) == '' ? '3D_STATBG_ROOMLIST' : (_this$divaWebConfigDa12 = this.divaWebConfigData) === null || _this$divaWebConfigDa12 === void 0 ? void 0 : _this$divaWebConfigDa12.diva3dStaticBGImage_DefaultRoomList;
585
+ var _this$divaWebConfigDa10, _this$divaWebConfigDa11;
586
+ return ((_this$divaWebConfigDa10 = this.divaWebConfigData) === null || _this$divaWebConfigDa10 === void 0 ? void 0 : _this$divaWebConfigDa10.diva3dStaticBGImage_DefaultRoomList) == '' ? '3D_STATBG_ROOMLIST' : (_this$divaWebConfigDa11 = this.divaWebConfigData) === null || _this$divaWebConfigDa11 === void 0 ? void 0 : _this$divaWebConfigDa11.diva3dStaticBGImage_DefaultRoomList;
594
587
  }
595
588
  }, {
596
589
  key: "getDiva3DAllowDefaultCatRoomList",
597
590
  value: function getDiva3DAllowDefaultCatRoomList() {
598
- var _this$divaWebConfigDa13;
599
- return (_this$divaWebConfigDa13 = this.divaWebConfigData) === null || _this$divaWebConfigDa13 === void 0 ? void 0 : _this$divaWebConfigDa13.diva3DAllowDefaultCatRoomList;
591
+ var _this$divaWebConfigDa12;
592
+ return (_this$divaWebConfigDa12 = this.divaWebConfigData) === null || _this$divaWebConfigDa12 === void 0 ? void 0 : _this$divaWebConfigDa12.diva3DAllowDefaultCatRoomList;
600
593
  }
601
594
  }, {
602
595
  key: "doAllowSetPlanner",
603
596
  value: function doAllowSetPlanner() {
604
- var _this$divaWebConfigDa14;
605
- return (_this$divaWebConfigDa14 = this.divaWebConfigData) === null || _this$divaWebConfigDa14 === void 0 ? void 0 : _this$divaWebConfigDa14.doAllowSetPlanner;
597
+ var _this$divaWebConfigDa13;
598
+ return (_this$divaWebConfigDa13 = this.divaWebConfigData) === null || _this$divaWebConfigDa13 === void 0 ? void 0 : _this$divaWebConfigDa13.doAllowSetPlanner;
606
599
  }
607
600
  }, {
608
601
  key: "getHidePlanner",
609
602
  value: function getHidePlanner() {
610
- var _this$divaWebConfigDa15;
611
- return !!((_this$divaWebConfigDa15 = this.divaWebConfigData) !== null && _this$divaWebConfigDa15 !== void 0 && (_this$divaWebConfigDa15 = _this$divaWebConfigDa15.viewConfig) !== null && _this$divaWebConfigDa15 !== void 0 && _this$divaWebConfigDa15.hidePlanner);
603
+ var _this$divaWebConfigDa14;
604
+ return !!((_this$divaWebConfigDa14 = this.divaWebConfigData) !== null && _this$divaWebConfigDa14 !== void 0 && (_this$divaWebConfigDa14 = _this$divaWebConfigDa14.viewConfig) !== null && _this$divaWebConfigDa14 !== void 0 && _this$divaWebConfigDa14.hidePlanner);
612
605
  }
613
606
  }, {
614
607
  key: "getDoShowAR",
615
608
  value: function getDoShowAR() {
616
- var _this$divaWebConfigDa16;
617
- return (_this$divaWebConfigDa16 = this.divaWebConfigData) === null || _this$divaWebConfigDa16 === void 0 || (_this$divaWebConfigDa16 = _this$divaWebConfigDa16.viewConfig) === null || _this$divaWebConfigDa16 === void 0 ? void 0 : _this$divaWebConfigDa16.enableAR;
609
+ var _this$divaWebConfigDa15;
610
+ return (_this$divaWebConfigDa15 = this.divaWebConfigData) === null || _this$divaWebConfigDa15 === void 0 || (_this$divaWebConfigDa15 = _this$divaWebConfigDa15.viewConfig) === null || _this$divaWebConfigDa15 === void 0 ? void 0 : _this$divaWebConfigDa15.enableAR;
618
611
  }
619
612
  }, {
620
613
  key: "forceShowRTV",
621
614
  value: function forceShowRTV() {
622
- var _this$divaWebConfigDa17;
623
- return (_this$divaWebConfigDa17 = this.divaWebConfigData) === null || _this$divaWebConfigDa17 === void 0 || (_this$divaWebConfigDa17 = _this$divaWebConfigDa17.viewConfig) === null || _this$divaWebConfigDa17 === void 0 ? void 0 : _this$divaWebConfigDa17.forceRTV;
615
+ var _this$divaWebConfigDa16;
616
+ return (_this$divaWebConfigDa16 = this.divaWebConfigData) === null || _this$divaWebConfigDa16 === void 0 || (_this$divaWebConfigDa16 = _this$divaWebConfigDa16.viewConfig) === null || _this$divaWebConfigDa16 === void 0 ? void 0 : _this$divaWebConfigDa16.forceRTV;
624
617
  }
625
618
  }, {
626
619
  key: "getDoShowRTV",
627
620
  value: function getDoShowRTV() {
628
- var _this$divaWebConfigDa18;
629
- return (_this$divaWebConfigDa18 = this.divaWebConfigData) === null || _this$divaWebConfigDa18 === void 0 || (_this$divaWebConfigDa18 = _this$divaWebConfigDa18.viewConfig) === null || _this$divaWebConfigDa18 === void 0 ? void 0 : _this$divaWebConfigDa18.enableRTV;
621
+ var _this$divaWebConfigDa17;
622
+ return (_this$divaWebConfigDa17 = this.divaWebConfigData) === null || _this$divaWebConfigDa17 === void 0 || (_this$divaWebConfigDa17 = _this$divaWebConfigDa17.viewConfig) === null || _this$divaWebConfigDa17 === void 0 ? void 0 : _this$divaWebConfigDa17.enableRTV;
630
623
  }
631
624
  }, {
632
625
  key: "getEnableRTVUnityKombi",
633
626
  value: function getEnableRTVUnityKombi() {
634
- var _this$divaWebConfigDa19;
635
- return !!((_this$divaWebConfigDa19 = this.divaWebConfigData) !== null && _this$divaWebConfigDa19 !== void 0 && _this$divaWebConfigDa19.viewConfig.enableRtvUnityKombi);
627
+ var _this$divaWebConfigDa18;
628
+ return !!((_this$divaWebConfigDa18 = this.divaWebConfigData) !== null && _this$divaWebConfigDa18 !== void 0 && _this$divaWebConfigDa18.viewConfig.enableRtvUnityKombi);
636
629
  }
637
630
  }, {
638
631
  key: "getDoDisablePlanner2D",
639
632
  value: function getDoDisablePlanner2D() {
640
- var _this$divaWebConfigDa20;
641
- return !!((_this$divaWebConfigDa20 = this.divaWebConfigData) !== null && _this$divaWebConfigDa20 !== void 0 && _this$divaWebConfigDa20.doDisablePlanner2D);
633
+ var _this$divaWebConfigDa19;
634
+ return !!((_this$divaWebConfigDa19 = this.divaWebConfigData) !== null && _this$divaWebConfigDa19 !== void 0 && _this$divaWebConfigDa19.doDisablePlanner2D);
642
635
  }
643
636
  }, {
644
637
  key: "getRoomListInProduct",
645
638
  value: function getRoomListInProduct() {
646
- var _this$divaWebConfigDa21;
647
- return !!((_this$divaWebConfigDa21 = this.divaWebConfigData) !== null && _this$divaWebConfigDa21 !== void 0 && (_this$divaWebConfigDa21 = _this$divaWebConfigDa21.viewConfig) !== null && _this$divaWebConfigDa21 !== void 0 && _this$divaWebConfigDa21.roomListInProduct);
639
+ var _this$divaWebConfigDa20;
640
+ return !!((_this$divaWebConfigDa20 = this.divaWebConfigData) !== null && _this$divaWebConfigDa20 !== void 0 && (_this$divaWebConfigDa20 = _this$divaWebConfigDa20.viewConfig) !== null && _this$divaWebConfigDa20 !== void 0 && _this$divaWebConfigDa20.roomListInProduct);
648
641
  }
649
642
  }, {
650
643
  key: "getPlannerType",
651
644
  value: function getPlannerType() {
652
- var _this$divaWebConfigDa22;
653
- return (_this$divaWebConfigDa22 = this.divaWebConfigData) === null || _this$divaWebConfigDa22 === void 0 || (_this$divaWebConfigDa22 = _this$divaWebConfigDa22.viewConfig) === null || _this$divaWebConfigDa22 === void 0 ? void 0 : _this$divaWebConfigDa22.plannerType;
645
+ var _this$divaWebConfigDa21;
646
+ return (_this$divaWebConfigDa21 = this.divaWebConfigData) === null || _this$divaWebConfigDa21 === void 0 || (_this$divaWebConfigDa21 = _this$divaWebConfigDa21.viewConfig) === null || _this$divaWebConfigDa21 === void 0 ? void 0 : _this$divaWebConfigDa21.plannerType;
654
647
  }
655
648
  }, {
656
649
  key: "getLoadSupplierColors",
657
650
  value: function getLoadSupplierColors() {
658
- var _this$divaWebConfigDa23;
659
- return !!((_this$divaWebConfigDa23 = this.divaWebConfigData) !== null && _this$divaWebConfigDa23 !== void 0 && _this$divaWebConfigDa23.loadSupplierColors);
651
+ var _this$divaWebConfigDa22;
652
+ return !!((_this$divaWebConfigDa22 = this.divaWebConfigData) !== null && _this$divaWebConfigDa22 !== void 0 && _this$divaWebConfigDa22.loadSupplierColors);
660
653
  }
661
654
  }, {
662
655
  key: "showSelectionModeZero",
663
656
  value: function showSelectionModeZero() {
664
- var _this$divaWebConfigDa24;
665
- return !!((_this$divaWebConfigDa24 = this.divaWebConfigData) !== null && _this$divaWebConfigDa24 !== void 0 && _this$divaWebConfigDa24.showSelectionModeZero);
657
+ var _this$divaWebConfigDa23;
658
+ return !!((_this$divaWebConfigDa23 = this.divaWebConfigData) !== null && _this$divaWebConfigDa23 !== void 0 && _this$divaWebConfigDa23.showSelectionModeZero);
666
659
  }
667
660
  }, {
668
661
  key: "ruleDescSeperator",
@@ -682,8 +675,8 @@ var DivaApiHandler = /*#__PURE__*/function () {
682
675
  }, {
683
676
  key: "getDoCheckVariantData",
684
677
  value: function getDoCheckVariantData() {
685
- var _this$divaWebConfigDa25;
686
- return (_this$divaWebConfigDa25 = this.divaWebConfigData) === null || _this$divaWebConfigDa25 === void 0 ? void 0 : _this$divaWebConfigDa25.doCheckVariantData;
678
+ var _this$divaWebConfigDa24;
679
+ return (_this$divaWebConfigDa24 = this.divaWebConfigData) === null || _this$divaWebConfigDa24 === void 0 ? void 0 : _this$divaWebConfigDa24.doCheckVariantData;
687
680
  }
688
681
  }, {
689
682
  key: "setI18n",
@@ -763,7 +756,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
763
756
  }, {
764
757
  key: "getBasketDataUrlCacheKey",
765
758
  value: function getBasketDataUrlCacheKey(divaNr) {
766
- //if divaNr is a variant of a divaNr (saves with favorites) divaNr looks like: "Diva-123456_0001". Here we got do build the querystring differently
759
+ //this is only used for testing logic to stiff match the query hash so moched calls are used
767
760
  var qs;
768
761
  if (divaNr.includes('_') && divaNr.substring(divaNr.indexOf('_') + 1).length == 4) {
769
762
  var splittedDivaNr = divaNr.split('_');
@@ -776,50 +769,50 @@ var DivaApiHandler = /*#__PURE__*/function () {
776
769
  }, {
777
770
  key: "getViewConfig",
778
771
  value: function getViewConfig() {
779
- var _this$divaWebConfigDa26;
780
- return (_this$divaWebConfigDa26 = this.divaWebConfigData) === null || _this$divaWebConfigDa26 === void 0 ? void 0 : _this$divaWebConfigDa26.viewConfig;
772
+ var _this$divaWebConfigDa25;
773
+ return (_this$divaWebConfigDa25 = this.divaWebConfigData) === null || _this$divaWebConfigDa25 === void 0 ? void 0 : _this$divaWebConfigDa25.viewConfig;
781
774
  }
782
775
  }, {
783
776
  key: "getEmailConfig",
784
777
  value: function getEmailConfig() {
785
- var _this$divaWebConfigDa27;
786
- return (_this$divaWebConfigDa27 = this.divaWebConfigData) === null || _this$divaWebConfigDa27 === void 0 ? void 0 : _this$divaWebConfigDa27.emailConfig;
778
+ var _this$divaWebConfigDa26;
779
+ return (_this$divaWebConfigDa26 = this.divaWebConfigData) === null || _this$divaWebConfigDa26 === void 0 ? void 0 : _this$divaWebConfigDa26.emailConfig;
787
780
  }
788
781
  }, {
789
782
  key: "getABTestCases",
790
783
  value: function getABTestCases() {
791
- var _this$divaWebConfigDa28, _this$divaWebConfigDa29;
792
- return (_this$divaWebConfigDa28 = (_this$divaWebConfigDa29 = this.divaWebConfigData) === null || _this$divaWebConfigDa29 === void 0 ? void 0 : _this$divaWebConfigDa29.abTestCases) !== null && _this$divaWebConfigDa28 !== void 0 ? _this$divaWebConfigDa28 : [];
784
+ var _this$divaWebConfigDa27, _this$divaWebConfigDa28;
785
+ return (_this$divaWebConfigDa27 = (_this$divaWebConfigDa28 = this.divaWebConfigData) === null || _this$divaWebConfigDa28 === void 0 ? void 0 : _this$divaWebConfigDa28.abTestCases) !== null && _this$divaWebConfigDa27 !== void 0 ? _this$divaWebConfigDa27 : [];
793
786
  }
794
787
  }, {
795
788
  key: "getBarrierConfig",
796
789
  value: function getBarrierConfig() {
797
- var _this$divaWebConfigDa30;
798
- return (_this$divaWebConfigDa30 = this.divaWebConfigData) === null || _this$divaWebConfigDa30 === void 0 ? void 0 : _this$divaWebConfigDa30.barrierConfig;
790
+ var _this$divaWebConfigDa29;
791
+ return (_this$divaWebConfigDa29 = this.divaWebConfigData) === null || _this$divaWebConfigDa29 === void 0 ? void 0 : _this$divaWebConfigDa29.barrierConfig;
799
792
  }
800
793
  }, {
801
794
  key: "getTemplateConfig",
802
795
  value: function getTemplateConfig() {
803
- var _this$divaWebConfigDa31;
804
- return (_this$divaWebConfigDa31 = this.divaWebConfigData) === null || _this$divaWebConfigDa31 === void 0 ? void 0 : _this$divaWebConfigDa31.templateConfig;
796
+ var _this$divaWebConfigDa30;
797
+ return (_this$divaWebConfigDa30 = this.divaWebConfigData) === null || _this$divaWebConfigDa30 === void 0 ? void 0 : _this$divaWebConfigDa30.templateConfig;
805
798
  }
806
799
  }, {
807
800
  key: "showDivaNr",
808
801
  value: function showDivaNr() {
809
- var _this$divaWebConfigDa32;
810
- return (_this$divaWebConfigDa32 = this.divaWebConfigData) === null || _this$divaWebConfigDa32 === void 0 ? void 0 : _this$divaWebConfigDa32.showDivaNr;
802
+ var _this$divaWebConfigDa31;
803
+ return (_this$divaWebConfigDa31 = this.divaWebConfigData) === null || _this$divaWebConfigDa31 === void 0 ? void 0 : _this$divaWebConfigDa31.showDivaNr;
811
804
  }
812
805
  }, {
813
806
  key: "onErrorHandling",
814
807
  value: function onErrorHandling() {
815
- var _this$divaWebConfigDa33;
816
- return (_this$divaWebConfigDa33 = this.divaWebConfigData) === null || _this$divaWebConfigDa33 === void 0 ? void 0 : _this$divaWebConfigDa33.onErrorHandling;
808
+ var _this$divaWebConfigDa32;
809
+ return (_this$divaWebConfigDa32 = this.divaWebConfigData) === null || _this$divaWebConfigDa32 === void 0 ? void 0 : _this$divaWebConfigDa32.onErrorHandling;
817
810
  }
818
811
  }, {
819
812
  key: "diva3DRenderingDefault",
820
813
  value: function diva3DRenderingDefault() {
821
- var _this$divaWebConfigDa34;
822
- return (_this$divaWebConfigDa34 = this.divaWebConfigData) === null || _this$divaWebConfigDa34 === void 0 ? void 0 : _this$divaWebConfigDa34.diva3DRenderingDefault;
814
+ var _this$divaWebConfigDa33;
815
+ return (_this$divaWebConfigDa33 = this.divaWebConfigData) === null || _this$divaWebConfigDa33 === void 0 ? void 0 : _this$divaWebConfigDa33.diva3DRenderingDefault;
823
816
  }
824
817
  }, {
825
818
  key: "getJwt",
@@ -834,8 +827,8 @@ var DivaApiHandler = /*#__PURE__*/function () {
834
827
  }, {
835
828
  key: "getUseMask",
836
829
  value: function getUseMask() {
837
- var _this$divaWebConfigDa35;
838
- return (_this$divaWebConfigDa35 = this.divaWebConfigData) === null || _this$divaWebConfigDa35 === void 0 ? void 0 : _this$divaWebConfigDa35.useMask;
830
+ var _this$divaWebConfigDa34;
831
+ return (_this$divaWebConfigDa34 = this.divaWebConfigData) === null || _this$divaWebConfigDa34 === void 0 ? void 0 : _this$divaWebConfigDa34.useMask;
839
832
  }
840
833
  }, {
841
834
  key: "apiUrl",
@@ -895,22 +888,10 @@ var DivaApiHandler = /*#__PURE__*/function () {
895
888
  }, {
896
889
  key: "getBasketDataUrl",
897
890
  value: function getBasketDataUrl(divaNr) {
898
- //if divaNr is a variant of a divaNr (saves with favorites) divaNr looks like: "Diva-123456_0001". Here we got do build the querystring differently
899
- if (divaNr.includes('_') && divaNr.substring(divaNr.indexOf('_') + 1).length == 4) {
900
- var _divaNr$split = divaNr.split('_'),
901
- _divaNr$split2 = _slicedToArray__default["default"](_divaNr$split, 2),
902
- DivaNrAndDoc = _divaNr$split2[0],
903
- variantId = _divaNr$split2[1];
904
- var _DivaNrAndDoc$split = DivaNrAndDoc.split('-'),
905
- _DivaNrAndDoc$split2 = _slicedToArray__default["default"](_DivaNrAndDoc$split, 3),
906
- _onlyDivaNr = _DivaNrAndDoc$split2[1],
907
- _version = _DivaNrAndDoc$split2[2];
908
- return '/baskets/configuration?divaNr=' + 'DIVA-' + _onlyDivaNr + (_version ? '&version=' + _version : '') + '&variantId=' + Number(variantId) + '&dontRepairBasket=true';
909
- }
910
- var _divaNr$split3 = divaNr.split('-'),
911
- _divaNr$split4 = _slicedToArray__default["default"](_divaNr$split3, 3),
912
- onlyDivaNr = _divaNr$split4[1],
913
- version = _divaNr$split4[2];
891
+ var _divaNr$split = divaNr.split('-'),
892
+ _divaNr$split2 = _slicedToArray__default["default"](_divaNr$split, 3),
893
+ onlyDivaNr = _divaNr$split2[1],
894
+ version = _divaNr$split2[2];
914
895
  return '/baskets/configuration?divaNr=' + 'DIVA-' + onlyDivaNr + (version ? '&version=' + version : '') + '&dontRepairBasket=true';
915
896
  }
916
897
  }, {
@@ -1040,9 +1021,9 @@ var DivaApiHandler = /*#__PURE__*/function () {
1040
1021
  return '/baskets/uniqueDivaNr';
1041
1022
  }
1042
1023
  }, {
1043
- key: "fillBasketEkText",
1044
- value: function fillBasketEkText() {
1045
- return '/baskets/fillektext';
1024
+ key: "checkMatchingProducts",
1025
+ value: function checkMatchingProducts() {
1026
+ return '/v1/products/matching';
1046
1027
  }
1047
1028
  }, {
1048
1029
  key: "getAccountList",
@@ -1367,14 +1348,14 @@ var DivaApiHandler = /*#__PURE__*/function () {
1367
1348
  }, {
1368
1349
  key: "dontLoadAdditionalModelInfos",
1369
1350
  get: function get() {
1370
- var _this$divaWebConfigDa36;
1371
- return (_this$divaWebConfigDa36 = this.divaWebConfigData) === null || _this$divaWebConfigDa36 === void 0 ? void 0 : _this$divaWebConfigDa36.dontLoadAdditionalModelInfos;
1351
+ var _this$divaWebConfigDa35;
1352
+ return (_this$divaWebConfigDa35 = this.divaWebConfigData) === null || _this$divaWebConfigDa35 === void 0 ? void 0 : _this$divaWebConfigDa35.dontLoadAdditionalModelInfos;
1372
1353
  }
1373
1354
  }, {
1374
1355
  key: "dontLoadCatalogEditorLiteMask",
1375
1356
  get: function get() {
1376
- var _this$divaWebConfigDa37;
1377
- return (_this$divaWebConfigDa37 = this.divaWebConfigData) === null || _this$divaWebConfigDa37 === void 0 ? void 0 : _this$divaWebConfigDa37.dontLoadCatalogEditorLiteMask;
1357
+ var _this$divaWebConfigDa36;
1358
+ return (_this$divaWebConfigDa36 = this.divaWebConfigData) === null || _this$divaWebConfigDa36 === void 0 ? void 0 : _this$divaWebConfigDa36.dontLoadCatalogEditorLiteMask;
1378
1359
  }
1379
1360
  }, {
1380
1361
  key: "OrganizationId",
@@ -18527,6 +18508,8 @@ var DivaCatalogData = /*#__PURE__*/function () {
18527
18508
  //Warnings
18528
18509
  else if (item.Codex == 'HIDECONSTRUCTIONWARNING') {
18529
18510
  _this.catalogData.doCheckConstructionWarnings = item.Value == '0';
18511
+ } else if (item.Codex == 'FORCECONSTRUCTIONWARNINGARTICLES') {
18512
+ _this.catalogData.forceConstructionWarningForArticles = item.Value.split(';');
18530
18513
  } else if (item.Codex == 'HIDECOMPLETENESSWARNING') {
18531
18514
  _this.catalogData.hideCompletenessWarning = item.Value == '1';
18532
18515
  }
@@ -19347,6 +19330,11 @@ var DivaCatalogData = /*#__PURE__*/function () {
19347
19330
  get: function get() {
19348
19331
  return this.catalogData.doCheckConstructionWarnings;
19349
19332
  }
19333
+ }, {
19334
+ key: "forceConstructionWarningForArticles",
19335
+ get: function get() {
19336
+ return this.catalogData.forceConstructionWarningForArticles;
19337
+ }
19350
19338
  }, {
19351
19339
  key: "doHideCompletenessWarning",
19352
19340
  get: function get() {
@@ -20491,7 +20479,7 @@ var DivaArticle = /*#__PURE__*/function () {
20491
20479
  ruleDesc_locales: initParams.RuleDesc_locales,
20492
20480
  toDeleteAfterInit: false,
20493
20481
  doUpdatePlannerSize: false,
20494
- shelfPlanData: initParams.ShelfPlanData ? DivaUtils__default["default"].DecodeBasketJson(initParams.ShelfPlanData) : undefined,
20482
+ shelfPlanData: initParams.ShelfPlandata ? DivaUtils__default["default"].DecodeBasketJson(initParams.ShelfPlandata) : undefined,
20495
20483
  typeNr: articleData.typeNr,
20496
20484
  initDecisions: initParams.initDecisions,
20497
20485
  previousPartlistArticles: initParams.PreviousPartlistArticles,
@@ -21808,6 +21796,18 @@ var DivaArticle = /*#__PURE__*/function () {
21808
21796
  get: function get() {
21809
21797
  return DivaUtils.md5(this.CatalogData.catalogGuid + '_' + this.articleCodex + '_' + JSON.stringify(this.VariantValuesWithoutOPTandOPV).replace(/"/g, '@'));
21810
21798
  }
21799
+ }, {
21800
+ key: "articleProductHash",
21801
+ get: function get() {
21802
+ var hash = this.catalogCodex + '_' + this.articleCodex + '_' + this.quantity + '_';
21803
+ for (var key in this.articleOptionStates) {
21804
+ var myArtOption = this.articleOptionStates[key];
21805
+ if (myArtOption.isDoShow && (!(myArtOption.idmVariantenArt == 95 || myArtOption.idmVariantenArt == 96 || myArtOption.idmVariantenArt == 97) || myArtOption.isVisibleFreeText) && myArtOption.val && myArtOption.visibleCount > 0 && !myArtOption.isDescribingState) {
21806
+ hash = hash + myArtOption.optionCodex.substring(3) + '_' + myArtOption.val.codex.substring(3) + (myArtOption.measureUnit && myArtOption.freeText !== undefined ? '_' + myArtOption.freeText : '') + (!myArtOption.measureUnit && myArtOption.isFreeText ? '_' + myArtOption.isFreeText : '');
21807
+ }
21808
+ }
21809
+ return DivaUtils.md5(hash);
21810
+ }
21811
21811
  }, {
21812
21812
  key: "VariantValuesWithoutOPTandOPV",
21813
21813
  get: function get() {
@@ -22880,6 +22880,8 @@ var DivaArticle = /*#__PURE__*/function () {
22880
22880
  optionImgForPrint: optionImgForPrint,
22881
22881
  optionsForPrint: optionsForPrint
22882
22882
  });
22883
+ } else {
22884
+ LOG$c.debug('not loading partlistarticle: ' + articleCodex + ' cause quantity is zero');
22883
22885
  }
22884
22886
  }
22885
22887
  return partlistArticlesToLoad;
@@ -23576,7 +23578,7 @@ var DivaArticle = /*#__PURE__*/function () {
23576
23578
  break;
23577
23579
  }
23578
23580
  _context.next = 4;
23579
- return Promise.resolve().then(function () { return require('./ShelfPlanner-4b697826.js'); });
23581
+ return Promise.resolve().then(function () { return require('./ShelfPlanner-22e3e6a5.js'); });
23580
23582
  case 4:
23581
23583
  _yield$import = _context.sent;
23582
23584
  ShelfPlanner = _yield$import["default"];
@@ -24348,12 +24350,12 @@ var DivaArticle = /*#__PURE__*/function () {
24348
24350
  }
24349
24351
  var myOptItem = {
24350
24352
  BasketID: this.basketId,
24351
- OPTCodex: OP.substring(3),
24353
+ OPT: OP.substring(3),
24352
24354
  OPTName: myArtOption.optionOrigName,
24353
24355
  OPTName_locales: myArtOption.optionName_locales,
24354
24356
  OptionOCD: myArtOption.optionOcd,
24355
24357
  OCD: myArtOption.ocd,
24356
- OPVCodex: myArtOption.val.codex.substring(3),
24358
+ OPV: myArtOption.val.codex.substring(3),
24357
24359
  vOPV: !this.CatalogData.dontUseVCodexInBasket ? myArtOption.vCodex : undefined,
24358
24360
  OPVName: DivaUtils__default["default"].stripTags(myArtOption.name),
24359
24361
  OPVName_locales: DivaUtils__default["default"].stripTagsFromDict((_myArtOption$valName_ = myArtOption.valName_locales) !== null && _myArtOption$valName_ !== void 0 ? _myArtOption$valName_ : {}),
@@ -24389,7 +24391,7 @@ var DivaArticle = /*#__PURE__*/function () {
24389
24391
  }
24390
24392
  }, {
24391
24393
  key: "getConfigPriceData",
24392
- value: function getConfigPriceData(VariantBasketData) {
24394
+ value: function getConfigPriceData(VariantBasketDatas) {
24393
24395
  var myPriceData = new basketModel.JsonConfigPriceData();
24394
24396
  myPriceData.BasePrices = [];
24395
24397
  if (this.price != 0) {
@@ -24415,12 +24417,12 @@ var DivaArticle = /*#__PURE__*/function () {
24415
24417
  } else {
24416
24418
  if (checkPrice.IsPercentage) {
24417
24419
  //Check if variantBasketdata is set as addPercentage
24418
- //TODO klären mit Franz - ist das schon der richtige Ort? In dem Fall wird VariantBasketData nicht als AddPercentage gekennzeichnet und im Checkout 1 wird CHF stattt % angezeigt.
24419
- for (var _i10 = 0; _i10 < VariantBasketData.length; _i10++) {
24420
+ //TODO klären mit Franz - ist das schon der richtige Ort? In dem Fall wird VariantBasketDatas nicht als AddPercentage gekennzeichnet und im Checkout 1 wird CHF stattt % angezeigt.
24421
+ for (var _i10 = 0; _i10 < VariantBasketDatas.length; _i10++) {
24420
24422
  var priceOPT = checkPrice.OPT.startsWith('OPT') ? checkPrice.OPT.substring(3) : checkPrice;
24421
- if (VariantBasketData[_i10].OPT == priceOPT) {
24423
+ if (VariantBasketDatas[_i10].OPT == priceOPT) {
24422
24424
  if (!isNaN(checkPrice.Price)) {
24423
- VariantBasketData[_i10].AddPercentage = checkPrice.Price * 100;
24425
+ VariantBasketDatas[_i10].AddPercentage = checkPrice.Price * 100;
24424
24426
  }
24425
24427
  }
24426
24428
  }
@@ -24436,18 +24438,18 @@ var DivaArticle = /*#__PURE__*/function () {
24436
24438
  var maxPrice = 0,
24437
24439
  maxPriceOPT = '';
24438
24440
  if (!myPriceData.BasePrice && !this.CatalogData.ignoreMaxPriceAsBP) {
24439
- for (var _i11 = 0; _i11 < VariantBasketData.length; _i11++) {
24440
- var variant = VariantBasketData[_i11];
24441
+ for (var _i11 = 0; _i11 < VariantBasketDatas.length; _i11++) {
24442
+ var variant = VariantBasketDatas[_i11];
24441
24443
  if (variant.AddPrice && (!variant.AddPrice || variant.AddPrice > maxPrice)) {
24442
24444
  maxPrice = variant.AddPrice;
24443
24445
  maxPriceOPT = variant.OPT;
24444
24446
  }
24445
24447
  }
24446
24448
  }
24447
- for (var _i12 = 0; _i12 < VariantBasketData.length; _i12++) {
24449
+ for (var _i12 = 0; _i12 < VariantBasketDatas.length; _i12++) {
24448
24450
  //WCTODO Prio 2 bei Maßauswahl
24449
24451
  var CalcPrice = void 0,
24450
- _variant = VariantBasketData[_i12],
24452
+ _variant = VariantBasketDatas[_i12],
24451
24453
  isPercentage = false;
24452
24454
  if (_variant.AddPercentage) {
24453
24455
  isPercentage = true;
@@ -25062,7 +25064,7 @@ var DivaArticleHandler = /*#__PURE__*/function () {
25062
25064
  }
25063
25065
  }
25064
25066
  }
25065
- if (value == undefined) {
25067
+ if (value == undefined && myArtOPS.isFreeText && !variantValues[_key + '_val']) {
25066
25068
  val = myArtOPS.option.freetextDefaultValue;
25067
25069
  if (val) {
25068
25070
  value = val;
@@ -26937,7 +26939,9 @@ var DivaSet = /*#__PURE__*/function () {
26937
26939
  _defineProperty__default["default"](this, "_supplierColors", void 0);
26938
26940
  /**Favorits state */
26939
26941
  _defineProperty__default["default"](this, "_handlelingCurrentFavorites", false);
26940
- _defineProperty__default["default"](this, "_favorites", void 0);
26942
+ _defineProperty__default["default"](this, "_favorites", {
26943
+ VariantValues: {}
26944
+ });
26941
26945
  //disabledVariants holds the state for explicitly variants that the user did not like so they got unselected in der summary
26942
26946
  _defineProperty__default["default"](this, "_disabledVariants", []);
26943
26947
  //for viewSummarylist to not always calc all the different valid variants we cache them and reset them when favoritesselection is changes
@@ -28106,7 +28110,7 @@ var DivaSet = /*#__PURE__*/function () {
28106
28110
  break;
28107
28111
  }
28108
28112
  _context4.next = 3;
28109
- return Promise.resolve().then(function () { return require('./DoorPlanner-ffa7af62.js'); });
28113
+ return Promise.resolve().then(function () { return require('./DoorPlanner-e764c8fb.js'); });
28110
28114
  case 3:
28111
28115
  _yield$import = _context4.sent;
28112
28116
  DoorPlanner = _yield$import["default"];
@@ -28150,8 +28154,6 @@ var DivaSet = /*#__PURE__*/function () {
28150
28154
  set: function set(favorites) {
28151
28155
  this._favorites = favorites;
28152
28156
  }
28153
-
28154
- //private disabledVariants: number[] = [];
28155
28157
  }, {
28156
28158
  key: "disabledVariants",
28157
28159
  get: function get() {
@@ -28160,7 +28162,6 @@ var DivaSet = /*#__PURE__*/function () {
28160
28162
  set: function set(val) {
28161
28163
  this._disabledVariants = val;
28162
28164
  }
28163
- //private allVariantsCache FavoritesVariants[]
28164
28165
  }, {
28165
28166
  key: "allVariantsCache",
28166
28167
  get: function get() {
@@ -28283,558 +28284,6 @@ var DivaSet = /*#__PURE__*/function () {
28283
28284
  }]);
28284
28285
  }();
28285
28286
 
28286
- //Diese Klasse verwaltet Productlogiken
28287
- var Product = /*#__PURE__*/function () {
28288
- function Product(id, divaNr, articles, price, image, shortDescription, childProducts, dockingPointInfos, affiliate, retailerArticleNr, minQuantity, increments) {
28289
- _classCallCheck__default["default"](this, Product);
28290
- _defineProperty__default["default"](this, "id", void 0);
28291
- _defineProperty__default["default"](this, "productPrice", void 0);
28292
- _defineProperty__default["default"](this, "_divaNr", void 0);
28293
- _defineProperty__default["default"](this, "shortDescriptionData", void 0);
28294
- _defineProperty__default["default"](this, "imageData", void 0);
28295
- _defineProperty__default["default"](this, "articles", void 0);
28296
- _defineProperty__default["default"](this, "families", []);
28297
- _defineProperty__default["default"](this, "childProductsData", void 0);
28298
- _defineProperty__default["default"](this, "childProductsGroupedData", void 0);
28299
- _defineProperty__default["default"](this, "dockingPointInfos", void 0);
28300
- _defineProperty__default["default"](this, "_affiliate", void 0);
28301
- _defineProperty__default["default"](this, "_retailerArticleNr", void 0);
28302
- _defineProperty__default["default"](this, "_minQuantity", void 0);
28303
- _defineProperty__default["default"](this, "_increments", void 0);
28304
- _defineProperty__default["default"](this, "_curTargetArticles", void 0);
28305
- this.id = id;
28306
- this._divaNr = divaNr;
28307
- this.articles = articles;
28308
- this.productPrice = price;
28309
- this.childProductsData = childProducts;
28310
- this.shortDescriptionData = shortDescription;
28311
- this.imageData = image;
28312
- this.dockingPointInfos = dockingPointInfos;
28313
- this._affiliate = affiliate;
28314
- this._retailerArticleNr = retailerArticleNr;
28315
- this._minQuantity = minQuantity === 1 ? undefined : minQuantity;
28316
- this._increments = increments === 1 ? undefined : increments;
28317
- this._curTargetArticles = [];
28318
- if (this.childProductsData) {
28319
- this.childProductsGroupedData = {};
28320
- for (var i = 0; i < this.childProductsData.length; i++) {
28321
- if (!this.childProductsGroupedData[this.childProductsData[i]]) this.childProductsGroupedData[this.childProductsData[i]] = 0;
28322
- this.childProductsGroupedData[this.childProductsData[i]]++;
28323
- }
28324
- }
28325
- }
28326
- return _createClass__default["default"](Product, [{
28327
- key: "initFamilies",
28328
- value: function initFamilies(families) {
28329
- for (var i = 0; i < families.length; i++) {
28330
- var _families$i$childProd;
28331
- if ((_families$i$childProd = families[i].childProducts) !== null && _families$i$childProd !== void 0 && _families$i$childProd.includes(this.id)) this.families.push();
28332
- }
28333
- this.families = families;
28334
- }
28335
- }, {
28336
- key: "price",
28337
- get: function get() {
28338
- return this.productPrice;
28339
- }
28340
- }, {
28341
- key: "productId",
28342
- get: function get() {
28343
- return this.id;
28344
- }
28345
- }, {
28346
- key: "divaNr",
28347
- get: function get() {
28348
- return this._divaNr;
28349
- }
28350
- }, {
28351
- key: "isFamily",
28352
- get: function get() {
28353
- return this.childProducts !== undefined;
28354
- }
28355
- }, {
28356
- key: "variantValues",
28357
- get: function get() {
28358
- return this.articles[0].variantValues;
28359
- }
28360
- }, {
28361
- key: "childProducts",
28362
- get: function get() {
28363
- return this.childProductsData;
28364
- }
28365
- }, {
28366
- key: "childProductsGrouped",
28367
- get: function get() {
28368
- return this.childProductsGroupedData;
28369
- }
28370
- }, {
28371
- key: "shortDescription",
28372
- get: function get() {
28373
- return this.shortDescriptionData;
28374
- }
28375
- }, {
28376
- key: "image",
28377
- get: function get() {
28378
- return this.imageData;
28379
- }
28380
- }, {
28381
- key: "affiliate",
28382
- get: function get() {
28383
- return this._affiliate;
28384
- }
28385
- }, {
28386
- key: "retailerArticleNr",
28387
- get: function get() {
28388
- return this._retailerArticleNr;
28389
- }
28390
- }, {
28391
- key: "increments",
28392
- get: function get() {
28393
- // return 2;
28394
- return this._increments;
28395
- }
28396
- }, {
28397
- key: "minQuantity",
28398
- get: function get() {
28399
- // return 3;
28400
- return this._minQuantity;
28401
- }
28402
- }, {
28403
- key: "curTargetArticles",
28404
- get: function get() {
28405
- return this._curTargetArticles;
28406
- },
28407
- set: function set(targentArticles) {
28408
- this._curTargetArticles = targentArticles;
28409
- }
28410
- }, {
28411
- key: "DockingPointInfos",
28412
- get: function get() {
28413
- return this.dockingPointInfos;
28414
- }
28415
- }, {
28416
- key: "CatalogCodexes",
28417
- get: function get() {
28418
- var catalogCodexes = [];
28419
- for (var i = 0; i < this.articles.length; i++) {
28420
- catalogCodexes.push(this.articles[i].catalogCodex);
28421
- }
28422
- return catalogCodexes;
28423
- }
28424
- }, {
28425
- key: "findOPVCodexInVariantValues",
28426
- value: function findOPVCodexInVariantValues(opt, opv) {
28427
- return this.articles.find(function (article) {
28428
- return article.variantValues.find(function (variant) {
28429
- return variant.OPT === opt && variant.OPV === opv;
28430
- });
28431
- });
28432
- }
28433
- }]);
28434
- }();
28435
-
28436
- var DivaProductHandler = /*#__PURE__*/function () {
28437
- function DivaProductHandler() {
28438
- _classCallCheck__default["default"](this, DivaProductHandler);
28439
- _defineProperty__default["default"](this, "singleProducts", {});
28440
- _defineProperty__default["default"](this, "familyProducts", {});
28441
- _defineProperty__default["default"](this, "singleProductsGrouped", {});
28442
- // key is CatalogCodex and ArticleCodex
28443
- //the number is the qunaitity of the current loaded product
28444
- _defineProperty__default["default"](this, "currentFamilies", {});
28445
- _defineProperty__default["default"](this, "currentSingleProducts", {});
28446
- }
28447
- return _createClass__default["default"](DivaProductHandler, [{
28448
- key: "addProducts",
28449
- value: function addProducts(variants, families) {
28450
- var newProducts = [];
28451
- var newFamilies = [];
28452
- for (var i = 0; i < variants.length; i++) {
28453
- var _variant$discountedPr;
28454
- var article = variants[i].articles[0];
28455
- var variant = variants[i];
28456
- var codex = article.catalogCodex + '_' + article.articleCodex;
28457
- if (!this.singleProductsGrouped[codex]) this.singleProductsGrouped[codex] = {};
28458
- this.singleProductsGrouped[codex][variants[i]._id] = new Product(variant._id, variant.divaNr, variant.articles, (_variant$discountedPr = variant.discountedPrice) !== null && _variant$discountedPr !== void 0 ? _variant$discountedPr : variant.addedPrice, variant.image, variant.shortDescription, undefined, variant.dockingPointInfos, variant.affiliate, variant.retailerArticleNr, variant.minQuantity, variant.increments);
28459
- this.singleProducts[variant._id] = this.singleProductsGrouped[codex][variant._id];
28460
- newProducts.push(this.singleProductsGrouped[codex][variant._id]);
28461
- }
28462
- if (families !== null && families !== void 0 && families.length) for (var _i = 0; _i < families.length; _i++) {
28463
- var _family$discountedPri;
28464
- var family = families[_i];
28465
- this.familyProducts[family._id] = new Product(family._id, family.divaNr, family.articles, (_family$discountedPri = family.discountedPrice) !== null && _family$discountedPri !== void 0 ? _family$discountedPri : family.addedPrice, family.image, family.shortDescription, family.childProducts, family.dockingPointInfos, family.affiliate, family.retailerArticleNr, family.minQuantity, family.increments);
28466
- newFamilies.push(this.familyProducts[family._id]);
28467
- }
28468
- for (var _i2 = 0; _i2 < newProducts.length; _i2++) {
28469
- newProducts[_i2].initFamilies(newFamilies);
28470
- }
28471
- }
28472
- }, {
28473
- key: "loadProductsOfSets",
28474
- value: function () {
28475
- var _loadProductsOfSets = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(orderSets, involvedSetIds) {
28476
- return _regeneratorRuntime__default["default"].wrap(function _callee$(_context) {
28477
- while (1) switch (_context.prev = _context.next) {
28478
- case 0:
28479
- case "end":
28480
- return _context.stop();
28481
- }
28482
- }, _callee);
28483
- }));
28484
- function loadProductsOfSets(_x, _x2) {
28485
- return _loadProductsOfSets.apply(this, arguments);
28486
- }
28487
- return loadProductsOfSets;
28488
- }()
28489
- }, {
28490
- key: "updateProducts",
28491
- value: function () {
28492
- var _updateProducts = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee2(set, from, productId) {
28493
- return _regeneratorRuntime__default["default"].wrap(function _callee2$(_context2) {
28494
- while (1) switch (_context2.prev = _context2.next) {
28495
- case 0:
28496
- case "end":
28497
- return _context2.stop();
28498
- }
28499
- }, _callee2);
28500
- }));
28501
- function updateProducts(_x3, _x4, _x5) {
28502
- return _updateProducts.apply(this, arguments);
28503
- }
28504
- return updateProducts;
28505
- }()
28506
- }, {
28507
- key: "updateArticleProducts",
28508
- value: function updateArticleProducts(set) {
28509
- var articles = set.getDivaArticles();
28510
- var targetArticles = Object.keys(articles);
28511
- for (var i = 0; i < targetArticles.length; i++) {
28512
- var article = articles[targetArticles[i]];
28513
- var productVariants = this.singleProductsGrouped[article.catalogCodex + '_' + article.articleCodex];
28514
- for (var key in productVariants) {
28515
- var product = productVariants[key];
28516
- product.curTargetArticles = [];
28517
- }
28518
- }
28519
- for (var _i3 = 0; _i3 < targetArticles.length; _i3++) {
28520
- var _article = articles[targetArticles[_i3]];
28521
- if (!_article) continue;
28522
- var _productVariants = this.singleProductsGrouped[_article.catalogCodex + '_' + _article.articleCodex];
28523
- var newProduct = undefined;
28524
- var _loop = function _loop() {
28525
- var product = _productVariants[_key];
28526
- var productVariantValues = _article.VariantValuesWithoutOPTandOPVInObject;
28527
- var notFound = false;
28528
- var _loop2 = function _loop2(j) {
28529
- if (!productVariantValues.find(function (item) {
28530
- return item.OPT == product.variantValues[j].OPT && item.OPV == product.variantValues[j].OPV;
28531
- })) {
28532
- //only notFound set to true when the opt in general does exist in the productVariants only the value of it is different
28533
- if (productVariantValues.find(function (item) {
28534
- return item.OPT == product.variantValues[j].OPT;
28535
- })) {
28536
- notFound = true;
28537
- return 1; // break
28538
- }
28539
- }
28540
- };
28541
- for (var j = 0; j < product.variantValues.length; j++) {
28542
- if (_loop2(j)) break;
28543
- }
28544
- if (!notFound) {
28545
- newProduct = product;
28546
- newProduct.curTargetArticles.push(_article.basketId);
28547
- return 1; // break
28548
- }
28549
- };
28550
- for (var _key in _productVariants) {
28551
- if (_loop()) break;
28552
- }
28553
- _article.curProduct = newProduct;
28554
- }
28555
- }
28556
- }, {
28557
- key: "updateFamilyProducts",
28558
- value: function updateFamilyProducts() {
28559
- this.currentFamilies = {};
28560
- var familiesToCheck = this.getFamiliesToCheck();
28561
- var biggestFamily;
28562
- do {
28563
- biggestFamily = this.findBiggestFamily(familiesToCheck);
28564
- if (biggestFamily) {
28565
- if (!this.currentFamilies[biggestFamily.productId]) this.currentFamilies[biggestFamily.productId] = 0;
28566
- this.currentFamilies[biggestFamily.productId]++;
28567
- }
28568
- } while (biggestFamily);
28569
- }
28570
- }, {
28571
- key: "getFamiliesToCheck",
28572
- value: function getFamiliesToCheck() {
28573
- var familiesToCheck = {};
28574
- for (var key in this.familyProducts) {
28575
- var familiy = this.familyProducts[key];
28576
- if (!familiy.childProducts) continue;
28577
- for (var i = 0; i < familiy.childProducts.length; i++) {
28578
- if (this.currentSingleProducts[familiy.childProducts[i]]) {
28579
- familiesToCheck[familiy.productId] = familiy;
28580
- break;
28581
- }
28582
- }
28583
- }
28584
- return familiesToCheck;
28585
- }
28586
- }, {
28587
- key: "findBiggestFamily",
28588
- value: function findBiggestFamily(familiesToCheck) {
28589
- var matchingFamilies = [];
28590
- var biggestFamily = false;
28591
- for (var iKey in familiesToCheck) {
28592
- var family = familiesToCheck[iKey];
28593
- var notFit = false;
28594
- for (var jKey in family.childProductsGrouped) {
28595
- //if product does not currently exist or the quantity is to small
28596
- if (!this.currentSingleProducts[jKey] || this.currentSingleProducts[jKey] < family.childProductsGrouped[jKey]) {
28597
- notFit = true;
28598
- break;
28599
- }
28600
- }
28601
- if (!notFit) matchingFamilies.push(family);
28602
- }
28603
-
28604
- //from all the matching families find the bigges one
28605
- for (var i = 0; i < matchingFamilies.length; i++) {
28606
- if (!biggestFamily || biggestFamily.childProducts.length > matchingFamilies[i].childProducts.length) {
28607
- biggestFamily = matchingFamilies[i];
28608
- }
28609
- }
28610
- if (biggestFamily) {
28611
- //we found a final bigges familiy. Now subtract the familiy products quantity in the dictionary products for the next run
28612
- for (var key in biggestFamily.childProductsGrouped) {
28613
- biggestFamily.childProductsGrouped;
28614
- this.currentSingleProducts[key] = this.currentSingleProducts[key] - biggestFamily.childProductsGrouped[key];
28615
- }
28616
- }
28617
- return biggestFamily;
28618
- }
28619
- }, {
28620
- key: "checkQuantitySteps",
28621
- value: function () {
28622
- var _checkQuantitySteps = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee3(set, from, productId) {
28623
- var articles, somethingChanged, key, product, currentQuantity, deltaQuantity, whatToDo, article;
28624
- return _regeneratorRuntime__default["default"].wrap(function _callee3$(_context3) {
28625
- while (1) switch (_context3.prev = _context3.next) {
28626
- case 0:
28627
- articles = set.getDivaArticles();
28628
- somethingChanged = false;
28629
- _context3.t0 = _regeneratorRuntime__default["default"].keys(this.currentSingleProducts);
28630
- case 3:
28631
- if ((_context3.t1 = _context3.t0()).done) {
28632
- _context3.next = 38;
28633
- break;
28634
- }
28635
- key = _context3.t1.value;
28636
- product = this.singleProducts[key];
28637
- currentQuantity = this.currentSingleProducts[key];
28638
- deltaQuantity = 0;
28639
- whatToDo = undefined;
28640
- if (product.minQuantity !== undefined) {
28641
- if (product.minQuantity > currentQuantity || product.increments !== undefined && product.increments > currentQuantity) {
28642
- if (from == 'onDelete') {
28643
- whatToDo = 'deleteArticle';
28644
- deltaQuantity = currentQuantity;
28645
- } else {
28646
- whatToDo = 'increaseQunatity';
28647
- deltaQuantity = product.minQuantity - currentQuantity;
28648
- }
28649
- somethingChanged = 'byMinQuantity';
28650
- }
28651
- }
28652
- if (!(product.increments && whatToDo !== 'deleteArticle')) {
28653
- _context3.next = 22;
28654
- break;
28655
- }
28656
- case 11:
28657
- if (!((currentQuantity + deltaQuantity) % product.increments !== 0 || from == 'onDelete' && productId == key)) {
28658
- _context3.next = 22;
28659
- break;
28660
- }
28661
- deltaQuantity++;
28662
- somethingChanged = 'byImcrement';
28663
- if (!(whatToDo !== 'increaseQunatity')) {
28664
- _context3.next = 20;
28665
- break;
28666
- }
28667
- if (!((currentQuantity - deltaQuantity) % product.increments === 0 && from != 'onAdd')) {
28668
- _context3.next = 19;
28669
- break;
28670
- }
28671
- if (!(product.minQuantity === undefined || product.minQuantity <= currentQuantity - deltaQuantity || currentQuantity - deltaQuantity === 0)) {
28672
- _context3.next = 19;
28673
- break;
28674
- }
28675
- whatToDo = 'decreaseQunatity';
28676
- return _context3.abrupt("break", 22);
28677
- case 19:
28678
- if ((currentQuantity + deltaQuantity) % product.increments === 0 && from != 'onDelete') {
28679
- whatToDo = 'increaseQunatity';
28680
- }
28681
- case 20:
28682
- _context3.next = 11;
28683
- break;
28684
- case 22:
28685
- if (!(whatToDo !== undefined)) {
28686
- _context3.next = 36;
28687
- break;
28688
- }
28689
- case 23:
28690
- if (!(deltaQuantity !== 0)) {
28691
- _context3.next = 36;
28692
- break;
28693
- }
28694
- article = articles[product.curTargetArticles[0]]; //attention!! If an article has a quantity bigger than 1 this wont work!
28695
- if (!(whatToDo === 'increaseQunatity')) {
28696
- _context3.next = 30;
28697
- break;
28698
- }
28699
- _context3.next = 28;
28700
- return setHandlerInstance.addPlannerElement(set, article.articleCodex, {
28701
- variantValues: article.VariantValues
28702
- }, 'initializingProduct');
28703
- case 28:
28704
- _context3.next = 33;
28705
- break;
28706
- case 30:
28707
- _context3.next = 32;
28708
- return setHandlerInstance.deleteElementFromSet(set, article, false, undefined, true);
28709
- case 32:
28710
- product.curTargetArticles.splice(0, 1);
28711
- case 33:
28712
- deltaQuantity--;
28713
- _context3.next = 23;
28714
- break;
28715
- case 36:
28716
- _context3.next = 3;
28717
- break;
28718
- case 38:
28719
- return _context3.abrupt("return", somethingChanged);
28720
- case 39:
28721
- case "end":
28722
- return _context3.stop();
28723
- }
28724
- }, _callee3, this);
28725
- }));
28726
- function checkQuantitySteps(_x6, _x7, _x8) {
28727
- return _checkQuantitySteps.apply(this, arguments);
28728
- }
28729
- return checkQuantitySteps;
28730
- }()
28731
- /**
28732
- * this functions controlls if the list of configItems is available or not
28733
- * @param configItems
28734
- * @param variantsInfo
28735
- * @param articles
28736
- * @param targetArticles
28737
- * @returns
28738
- */
28739
- }, {
28740
- key: "checkProductInStock",
28741
- value: function checkProductInStock(configItems, variantsInfo, articles, targetArticles) {
28742
- var productsKey = articles[targetArticles[0]].catalogCodex + '_' + articles[targetArticles[0]].articleCodex;
28743
- var products = this.singleProductsGrouped[productsKey];
28744
- var indexesToDelete = [];
28745
- for (var i = 0; i < variantsInfo.length; i++) {
28746
- var variantInStock = false;
28747
- var variantInfo = variantsInfo[i];
28748
- for (var key in products) {
28749
- //***GUF***DEBUG HERE
28750
- var productVariantValues = products[key].variantValues;
28751
- var notFound = false;
28752
- var _loop3 = function _loop3() {
28753
- var variant = variantInfo.variants[j];
28754
- if (!productVariantValues.find(function (item) {
28755
- return variant.OPT === item.OPT && variant.OPV === item.OPV;
28756
- })) {
28757
- //only notFound set to true when the opt in general does exist in the productVariants only the value of it is different
28758
- if (productVariantValues.find(function (item) {
28759
- return variant.OPT === item.OPT;
28760
- })) {
28761
- notFound = true;
28762
- return 1; // break
28763
- }
28764
- }
28765
- };
28766
- for (var j = 0; j < variantInfo.variants.length; j++) {
28767
- if (_loop3()) break;
28768
- }
28769
- if (!notFound) {
28770
- variantInStock = true;
28771
- break;
28772
- }
28773
- }
28774
- if (!variantInStock) {
28775
- if (configItems[i]) {
28776
- indexesToDelete.push(i);
28777
- }
28778
- }
28779
- }
28780
- for (var _i4 = indexesToDelete.length - 1; _i4 >= 0; _i4--) {
28781
- configItems.splice(indexesToDelete[_i4], 1);
28782
- }
28783
- return configItems;
28784
- }
28785
- }, {
28786
- key: "getPrice",
28787
- value: function getPrice() {
28788
- var price = 0;
28789
- for (var key in this.currentSingleProducts) {
28790
- price += this.singleProducts[key].price * this.currentSingleProducts[key];
28791
- }
28792
- for (var _key2 in this.currentFamilies) {
28793
- price += this.singleProducts[_key2].price * this.currentFamilies[_key2];
28794
- }
28795
- return price;
28796
- }
28797
- }, {
28798
- key: "getCurrentProducts",
28799
- value: function getCurrentProducts() {
28800
- var products = this.currentSingleProducts;
28801
- for (var key in this.currentFamilies) {
28802
- products[key] = this.currentFamilies[key];
28803
- }
28804
- return products;
28805
- }
28806
- }, {
28807
- key: "getProductById",
28808
- value: function getProductById(productId) {
28809
- var product;
28810
- product = this.singleProducts[productId];
28811
- if (!product) this.familyProducts[productId];
28812
- return product;
28813
- }
28814
- }, {
28815
- key: "getBestMatch",
28816
- value: function getBestMatch(articles) {
28817
- var OPTION_CODEX = 'KOPFTEIL';
28818
- if (!articles) return;
28819
- for (var key in articles) {
28820
- var _article$VariantValue;
28821
- var article = articles[key];
28822
- var opv = (_article$VariantValue = article.VariantValues['OPT' + OPTION_CODEX]) === null || _article$VariantValue === void 0 ? void 0 : _article$VariantValue.replace('OPV', '');
28823
- var products = this.singleProductsGrouped[article.catalogCodex + '_' + article.articleCodex];
28824
- if (!products || !opv) continue;
28825
- for (var pId in products) {
28826
- var _products$pId$affilia;
28827
- if ((_products$pId$affilia = products[pId].affiliate) !== null && _products$pId$affilia !== void 0 && _products$pId$affilia.length) if (products[pId].findOPVCodexInVariantValues(OPTION_CODEX, opv)) {
28828
- return products[pId];
28829
- }
28830
- }
28831
- }
28832
- return undefined;
28833
- }
28834
- }]);
28835
- }();
28836
- var productHandlerInstance = new DivaProductHandler();
28837
-
28838
28287
  var SummaryHandler = /*#__PURE__*/function () {
28839
28288
  function SummaryHandler() {
28840
28289
  _classCallCheck__default["default"](this, SummaryHandler);
@@ -29172,30 +28621,16 @@ var SummaryHandler = /*#__PURE__*/function () {
29172
28621
  }, {
29173
28622
  key: "getSummaryItems",
29174
28623
  value: function () {
29175
- var _getSummaryItems = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(sets, doConfigure, doAllowSetPlanner) {
28624
+ var _getSummaryItems = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(sets, doConfigure) {
29176
28625
  var ret, _key5, set, items, type;
29177
28626
  return _regeneratorRuntime__default["default"].wrap(function _callee$(_context) {
29178
28627
  while (1) switch (_context.prev = _context.next) {
29179
28628
  case 0:
29180
28629
  ret = [];
29181
- if (!doAllowSetPlanner) {
29182
- _context.next = 5;
29183
- break;
29184
- }
29185
- ret = [{
29186
- items: this.getArticlesForSummary(sets),
29187
- type: 'SUMMARY_ARTICLES',
29188
- name: 'ARTICLELIST',
29189
- price: setHandlerInstance.getTotalPrice(sets),
29190
- quantity: 1
29191
- }];
29192
- _context.next = 29;
29193
- break;
29194
- case 5:
29195
28630
  _context.t0 = _regeneratorRuntime__default["default"].keys(sets);
29196
- case 6:
28631
+ case 2:
29197
28632
  if ((_context.t1 = _context.t0()).done) {
29198
- _context.next = 29;
28633
+ _context.next = 25;
29199
28634
  break;
29200
28635
  }
29201
28636
  _key5 = _context.t1.value;
@@ -29203,9 +28638,9 @@ var SummaryHandler = /*#__PURE__*/function () {
29203
28638
  items = void 0;
29204
28639
  type = this.getSummaryType(set);
29205
28640
  _context.t2 = type;
29206
- _context.next = _context.t2 === 'SUMMARY_PARTLIST' ? 14 : _context.t2 === 'SUMMARY_OPTIONTREE' ? 17 : _context.t2 === 'VARIANTS' ? 19 : _context.t2 === 'PARTLIST_AND_SPECIALOPTIONS' ? 25 : 27;
28641
+ _context.next = _context.t2 === 'SUMMARY_PARTLIST' ? 10 : _context.t2 === 'SUMMARY_OPTIONTREE' ? 13 : _context.t2 === 'VARIANTS' ? 15 : _context.t2 === 'PARTLIST_AND_SPECIALOPTIONS' ? 21 : 23;
29207
28642
  break;
29208
- case 14:
28643
+ case 10:
29209
28644
  items = this.buildSummaryItemsOfPartlist(set);
29210
28645
  ret.push({
29211
28646
  items: items,
@@ -29214,33 +28649,33 @@ var SummaryHandler = /*#__PURE__*/function () {
29214
28649
  price: set.getSetPrice(),
29215
28650
  quantity: 1
29216
28651
  });
29217
- return _context.abrupt("break", 27);
29218
- case 17:
28652
+ return _context.abrupt("break", 23);
28653
+ case 13:
29219
28654
  ret = ret.concat(this.getOptionTreeSummary(set));
29220
- return _context.abrupt("break", 27);
29221
- case 19:
28655
+ return _context.abrupt("break", 23);
28656
+ case 15:
29222
28657
  _context.t3 = ret;
29223
- _context.next = 22;
28658
+ _context.next = 18;
29224
28659
  return this.getVariantsSummary(doConfigure, set);
29225
- case 22:
28660
+ case 18:
29226
28661
  _context.t4 = _context.sent;
29227
28662
  _context.t3.push.call(_context.t3, _context.t4);
29228
- return _context.abrupt("break", 27);
29229
- case 25:
28663
+ return _context.abrupt("break", 23);
28664
+ case 21:
29230
28665
  ret.push(this.buildSummaryItemsOfPartlistWithSpecialOptions(set));
29231
- return _context.abrupt("break", 27);
29232
- case 27:
29233
- _context.next = 6;
28666
+ return _context.abrupt("break", 23);
28667
+ case 23:
28668
+ _context.next = 2;
29234
28669
  break;
29235
- case 29:
28670
+ case 25:
29236
28671
  return _context.abrupt("return", ret);
29237
- case 30:
28672
+ case 26:
29238
28673
  case "end":
29239
28674
  return _context.stop();
29240
28675
  }
29241
28676
  }, _callee, this);
29242
28677
  }));
29243
- function getSummaryItems(_x, _x2, _x3) {
28678
+ function getSummaryItems(_x, _x2) {
29244
28679
  return _getSummaryItems.apply(this, arguments);
29245
28680
  }
29246
28681
  return getSummaryItems;
@@ -29344,69 +28779,15 @@ var SummaryHandler = /*#__PURE__*/function () {
29344
28779
  }
29345
28780
  return ret;
29346
28781
  }
29347
- }, {
29348
- key: "getArticlesForSummary",
29349
- value: function getArticlesForSummary(sets) {
29350
- var ret = {};
29351
- for (var setId in sets) {
29352
- var set = sets[setId];
29353
- var articles = set.getDivaArticles();
29354
- for (var basketId in articles) {
29355
- var article = articles[basketId];
29356
- if (!article.curProduct) {
29357
- var _key9 = article.catalogCodex + '_' + article.articleCodex + '_' + article.articleVariantDesc();
29358
- if (ret[_key9]) {
29359
- var _ret$_key9$targetArti;
29360
- ret[_key9].quantity = ret[_key9].quantity + article.quantity;
29361
- ret[_key9].targetBasketIds.push(article.basketId);
29362
- (_ret$_key9$targetArti = ret[_key9].targetArticlePosNrs) === null || _ret$_key9$targetArti === void 0 || _ret$_key9$targetArti.push(article.posNr);
29363
- } else {
29364
- ret[_key9] = {
29365
- setId: setId,
29366
- title: article.name,
29367
- title_locales: article.name_locales,
29368
- description: article.actSizeText,
29369
- isDefined: true,
29370
- price: article.price,
29371
- quantity: article.quantity,
29372
- codex: article.articleCodex,
29373
- targetBasketIds: [article.basketId],
29374
- posNr: Object.keys(ret).length,
29375
- image: article.imageUrl,
29376
- targetArticlePosNrs: [article.posNr]
29377
- };
29378
- }
29379
- }
29380
- }
29381
- }
29382
- var curProducts = productHandlerInstance.getCurrentProducts();
29383
- for (var _key10 in curProducts) {
29384
- var product = productHandlerInstance.getProductById(_key10);
29385
- ret[_key10] = {
29386
- setId: 'PRODUCTS',
29387
- title: product.shortDescription,
29388
- description: '',
29389
- isDefined: true,
29390
- price: product.price,
29391
- quantity: curProducts[_key10],
29392
- codex: product.productId,
29393
- targetBasketIds: [],
29394
- posNr: Object.keys(ret).length,
29395
- image: product.image,
29396
- targetArticlePosNrs: []
29397
- };
29398
- }
29399
- return ret;
29400
- }
29401
28782
  }, {
29402
28783
  key: "getSummaryItemsOfAllSets",
29403
28784
  value: function getSummaryItemsOfAllSets(sets, set) {
29404
28785
  var summaryItemsOfAllSets = {};
29405
- for (var _key11 in sets) {
29406
- var _set = sets[_key11];
28786
+ for (var _key9 in sets) {
28787
+ var _set = sets[_key9];
29407
28788
  var articlePosNrs = this.getArticlesPosNr(_set.getDivaArticles(true));
29408
28789
  var summaryItems = this.buildSummaryItems(articlePosNrs, _set);
29409
- summaryItemsOfAllSets[_key11] = {
28790
+ summaryItemsOfAllSets[_key9] = {
29410
28791
  setName: _set.CatalogData.catalogName,
29411
28792
  setPrice: _set.getSetPrice(),
29412
28793
  summaryItems: summaryItems
@@ -29420,10 +28801,10 @@ var SummaryHandler = /*#__PURE__*/function () {
29420
28801
  var groupedArticles = setHandlerInstance.getDockedGroupedArticles(set);
29421
28802
  var retGroups = {};
29422
28803
  var articlesCodexesOnIndex = {};
29423
- for (var _key12 in groupedArticles) {
29424
- var basketId = groupedArticles[_key12][Object.keys(groupedArticles[_key12])[0]].basketId;
28804
+ for (var _key10 in groupedArticles) {
28805
+ var basketId = groupedArticles[_key10][Object.keys(groupedArticles[_key10])[0]].basketId;
29425
28806
  retGroups[basketId] = {
29426
- articles: groupedArticles[_key12],
28807
+ articles: groupedArticles[_key10],
29427
28808
  quantity: 1
29428
28809
  };
29429
28810
  }
@@ -29438,12 +28819,12 @@ var SummaryHandler = /*#__PURE__*/function () {
29438
28819
  articlesCodexesOnIndex[articleCodex].push(i);
29439
28820
  }
29440
28821
  }
29441
- for (var _key13 in articlesCodexesOnIndex) {
29442
- if (articlesCodexesOnIndex[_key13].length > 1) {
28822
+ for (var _key11 in articlesCodexesOnIndex) {
28823
+ if (articlesCodexesOnIndex[_key11].length > 1) {
29443
28824
  //group the single groups by the aricleCodex
29444
28825
  var articles = [];
29445
- for (var _i4 = 0; _i4 < articlesCodexesOnIndex[_key13].length; _i4++) {
29446
- var _group = groupedArticles[articlesCodexesOnIndex[_key13][_i4]];
28826
+ for (var _i4 = 0; _i4 < articlesCodexesOnIndex[_key11].length; _i4++) {
28827
+ var _group = groupedArticles[articlesCodexesOnIndex[_key11][_i4]];
29447
28828
  articles.push({
29448
28829
  article: _group[Object.keys(_group)[0]]
29449
28830
  });
@@ -29499,12 +28880,12 @@ var SummaryHandler = /*#__PURE__*/function () {
29499
28880
  }
29500
28881
 
29501
28882
  //old logic TODO: Delete in 2024
29502
- if (Object.keys(tabGroups).length === 0) for (var _key14 in article.articleOptionStates) {
29503
- var _ops = article.articleOptionStates[_key14];
28883
+ if (Object.keys(tabGroups).length === 0) for (var _key12 in article.articleOptionStates) {
28884
+ var _ops = article.articleOptionStates[_key12];
29504
28885
  if (!_ops.isInvisible && (_ops.selectionmode != 0 || (_ops.visibleCount > 1 || _ops.isFreeText) && article.set.api.showSelectionModeZero()) && _ops.isDoShow && _ops.valCodex != 'OPVNR') {
29505
28886
  var tabGroup = _ops.option.addOptionToTabgroupInPartlistSummary;
29506
28887
  if (tabGroup) tabGroups.push({
29507
- optionCodex: _key14,
28888
+ optionCodex: _key12,
29508
28889
  tabGroup: tabGroup
29509
28890
  });
29510
28891
  }
@@ -29539,8 +28920,8 @@ var SummaryHandler = /*#__PURE__*/function () {
29539
28920
  }
29540
28921
 
29541
28922
  //old logic TODO: Delete in 2024
29542
- for (var _key15 in article.articleOptionStates) {
29543
- var _optionState = article.articleOptionStates[_key15];
28923
+ for (var _key13 in article.articleOptionStates) {
28924
+ var _optionState = article.articleOptionStates[_key13];
29544
28925
  if (_optionState.option.addOptionToTabgroupInPartlistSummary == tabGroup && !_optionState.isInvisible && _optionState.isDoShow && _optionState.visibleCount > 0 && _optionState.valCodex != 'OPVNR') {
29545
28926
  opss.push(_optionState);
29546
28927
  }
@@ -29704,7 +29085,7 @@ var SummaryHandler = /*#__PURE__*/function () {
29704
29085
  }
29705
29086
  }, _callee3);
29706
29087
  }));
29707
- function getVariantsSummary(_x4, _x5) {
29088
+ function getVariantsSummary(_x3, _x4) {
29708
29089
  return _getVariantsSummary.apply(this, arguments);
29709
29090
  }
29710
29091
  return getVariantsSummary;
@@ -29732,8 +29113,8 @@ var SummaryHandler = /*#__PURE__*/function () {
29732
29113
  key: "getArticlesPrice",
29733
29114
  value: function getArticlesPrice(articles) {
29734
29115
  var price = 0;
29735
- for (var _key16 in articles) {
29736
- price = price + articles[_key16].price * articles[_key16].quantity;
29116
+ for (var _key14 in articles) {
29117
+ price = price + articles[_key14].price * articles[_key14].quantity;
29737
29118
  }
29738
29119
  return price;
29739
29120
  }
@@ -29753,10 +29134,11 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
29753
29134
  return _createClass__default["default"](DivaFavoritesHandler, [{
29754
29135
  key: "initSet",
29755
29136
  value: function initSet(set, orderSet) {
29756
- var _orderSet$ConfigVaria;
29137
+ var _orderSet$TinyVariant;
29757
29138
  set.favorites = orderSet !== null && orderSet !== void 0 && orderSet.Favorites ? orderSet.Favorites : new basketModel.Favorites();
29758
- if ((_orderSet$ConfigVaria = orderSet.ConfigVariants) !== null && _orderSet$ConfigVaria !== void 0 && _orderSet$ConfigVaria.length) {
29759
- set.oldConfigVariants = _toConsumableArray__default["default"](orderSet.ConfigVariants);
29139
+ if ((_orderSet$TinyVariant = orderSet.TinyVariantConfiguration) !== null && _orderSet$TinyVariant !== void 0 && _orderSet$TinyVariant.length) {
29140
+ var _orderSet$TinyVariant2;
29141
+ set.oldConfigVariants = _toConsumableArray__default["default"]((_orderSet$TinyVariant2 = orderSet.TinyVariantConfiguration) !== null && _orderSet$TinyVariant2 !== void 0 ? _orderSet$TinyVariant2 : []);
29760
29142
  }
29761
29143
  set.disabledVariants = [];
29762
29144
  }
@@ -29773,33 +29155,35 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
29773
29155
  key: "getVariantsForSummary",
29774
29156
  value: function () {
29775
29157
  var _getVariantsForSummary = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(set) {
29776
- var _set$allVariantsCache;
29158
+ var _set$actions, _set$allVariantsCache, _set$actions2;
29777
29159
  var variants;
29778
29160
  return _regeneratorRuntime__default["default"].wrap(function _callee$(_context) {
29779
29161
  while (1) switch (_context.prev = _context.next) {
29780
29162
  case 0:
29781
29163
  this.isCalcForSummary = true;
29164
+ (_set$actions = set.actions) === null || _set$actions === void 0 || _set$actions.toggleLoading('calcfavorites', false, true);
29782
29165
  if (!((_set$allVariantsCache = set.allVariantsCache) !== null && _set$allVariantsCache !== void 0)) {
29783
- _context.next = 5;
29166
+ _context.next = 6;
29784
29167
  break;
29785
29168
  }
29786
29169
  _context.t0 = _set$allVariantsCache;
29787
- _context.next = 8;
29170
+ _context.next = 9;
29788
29171
  break;
29789
- case 5:
29790
- _context.next = 7;
29172
+ case 6:
29173
+ _context.next = 8;
29791
29174
  return this.getAllValidVariants(set);
29792
- case 7:
29793
- _context.t0 = _context.sent;
29794
29175
  case 8:
29176
+ _context.t0 = _context.sent;
29177
+ case 9:
29795
29178
  variants = _context.t0;
29179
+ (_set$actions2 = set.actions) === null || _set$actions2 === void 0 || _set$actions2.toggleLoading('calcfavorites', false, false);
29796
29180
  this.isCalcForSummary = false;
29797
29181
  return _context.abrupt("return", {
29798
29182
  disabled: set.disabledVariants,
29799
29183
  variants: variants,
29800
29184
  singleOptions: this.repairFavorites(set).singleOptions
29801
29185
  });
29802
- case 11:
29186
+ case 13:
29803
29187
  case "end":
29804
29188
  return _context.stop();
29805
29189
  }
@@ -29976,8 +29360,9 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
29976
29360
  if (!((_set$oldConfigVariant = set.oldConfigVariants) !== null && _set$oldConfigVariant !== void 0 && _set$oldConfigVariant.length)) return 0;
29977
29361
  var highestId = 0;
29978
29362
  for (var i = 0; i < set.oldConfigVariants.length; i++) {
29979
- if (highestId < set.oldConfigVariants[i].VariantID) {
29980
- highestId = set.oldConfigVariants[i].VariantID;
29363
+ var variant = set.oldConfigVariants[i];
29364
+ if (variant.VariantID && highestId < variant.VariantID) {
29365
+ highestId = variant.VariantID;
29981
29366
  }
29982
29367
  }
29983
29368
  return highestId + 1;
@@ -29990,15 +29375,17 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
29990
29375
  for (var i = 0; i < set.oldConfigVariants.length; i++) {
29991
29376
  var oldConfigVariant = set.oldConfigVariants[i];
29992
29377
  var tryNext = false;
29993
- for (var basketId in variant.targetArticles) {
29378
+ var _loop2 = function _loop2(basketId) {
29994
29379
  var articleNew = variant.targetArticles[basketId];
29995
- var articleOld = oldConfigVariant.SetVariantData[basketId];
29380
+ var articleOld = oldConfigVariant.OrderSets[0].OrderLines.find(function (ol) {
29381
+ return ol.BasketID == basketId;
29382
+ });
29996
29383
  if (!articleOld) {
29997
29384
  tryNext = true;
29998
- continue;
29385
+ return 1; // continue
29999
29386
  }
30000
- var _loop2 = function _loop2(opt) {
30001
- var option = articleOld.VariantValues.find(function (v) {
29387
+ var _loop3 = function _loop3(opt) {
29388
+ var option = articleOld.VariantBasketDatas.find(function (v) {
30002
29389
  return 'OPT' + v.OPT == opt;
30003
29390
  });
30004
29391
  if (!option) {
@@ -30012,9 +29399,12 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
30012
29399
  },
30013
29400
  _ret;
30014
29401
  for (var opt in articleNew) {
30015
- _ret = _loop2(opt);
29402
+ _ret = _loop3(opt);
30016
29403
  if (_ret === 0) continue;
30017
29404
  }
29405
+ };
29406
+ for (var basketId in variant.targetArticles) {
29407
+ if (_loop2(basketId)) continue;
30018
29408
  }
30019
29409
  if (tryNext) continue;
30020
29410
  return oldConfigVariant.VariantID;
@@ -30059,7 +29449,7 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
30059
29449
  var optionValue = set.CatalogData.getOptionValue(opvs[i]);
30060
29450
  var optionValueName = optionValue === null || optionValue === void 0 ? void 0 : optionValue.name;
30061
29451
  var optionValueImage = optionValue === null || optionValue === void 0 ? void 0 : optionValue.image;
30062
- favorit = new basketModel.Favorit(opt, opvs[i], targetArticles, optionName, optionValueName, optionValueImage);
29452
+ favorit = new basketModel.Favorite(opt, opvs[i], targetArticles, optionName, optionValueName, optionValueImage);
30063
29453
  this.setFavorites(set, opt, opvs[i], favorit, remove);
30064
29454
  }
30065
29455
  set.disabledVariants = [];
@@ -30455,14 +29845,28 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
30455
29845
  var optionsMatching = {};
30456
29846
  for (var basketId in variant.targetArticles) {
30457
29847
  var articleVariantValues = variant.targetArticles[basketId];
29848
+ var _loop4 = function _loop4(opt) {
29849
+ var _articleWithOption$Va;
29850
+ if (optionsMatching[opt]) return 0; // continue
29851
+ var articleWithOption = oldConfig.OrderSets[0].OrderLines.find(function (ol) {
29852
+ return ol.VariantBasketDatas.find(function (v) {
29853
+ return 'OPT' + v.OPT === opt;
29854
+ });
29855
+ });
29856
+ if ('OPV' + (articleWithOption === null || articleWithOption === void 0 || (_articleWithOption$Va = articleWithOption.VariantBasketDatas.find(function (v) {
29857
+ return 'OPT' + v.OPT === opt;
29858
+ })) === null || _articleWithOption$Va === void 0 ? void 0 : _articleWithOption$Va.OPV) == articleVariantValues[opt]) {
29859
+ optionsMatching[opt] = true;
29860
+ } else {
29861
+ tryNext = true;
29862
+ return 1; // break
29863
+ }
29864
+ },
29865
+ _ret2;
30458
29866
  for (var opt in articleVariantValues) {
30459
- if (optionsMatching[opt]) continue;
30460
- if (oldConfig.Variant[opt] == articleVariantValues[opt]) {
30461
- optionsMatching[opt] = true;
30462
- } else {
30463
- tryNext = true;
30464
- break;
30465
- }
29867
+ _ret2 = _loop4(opt);
29868
+ if (_ret2 === 0) continue;
29869
+ if (_ret2 === 1) break;
30466
29870
  }
30467
29871
  if (tryNext) break;
30468
29872
  }
@@ -31294,6 +30698,53 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
31294
30698
  }();
31295
30699
  var configTreeHandler = new DivaConfigTreeHandler();
31296
30700
 
30701
+ //Diese Klasse verwaltet Productlogiken
30702
+ var DivaProductHandler = /*#__PURE__*/function () {
30703
+ function DivaProductHandler() {
30704
+ _classCallCheck__default["default"](this, DivaProductHandler);
30705
+ }
30706
+ return _createClass__default["default"](DivaProductHandler, [{
30707
+ key: "getPrice",
30708
+ value: function getPrice() {
30709
+ var price = 0;
30710
+ return price;
30711
+ }
30712
+ }, {
30713
+ key: "updateProducts",
30714
+ value: function () {
30715
+ var _updateProducts = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(sets, api, from) {
30716
+ return _regeneratorRuntime__default["default"].wrap(function _callee$(_context) {
30717
+ while (1) switch (_context.prev = _context.next) {
30718
+ case 0:
30719
+ ({
30720
+ catalogs: sets.map(function (set) {
30721
+ return {
30722
+ articles: Object.values(set.getDivaArticles()).map(function (article) {
30723
+ return {
30724
+ codex: article.articleCodex,
30725
+ hash: article.articleProductHash
30726
+ };
30727
+ }),
30728
+ catalogGuid: set.CatalogData.catalogGuid
30729
+ };
30730
+ })
30731
+ });
30732
+ return _context.abrupt("return");
30733
+ case 2:
30734
+ case "end":
30735
+ return _context.stop();
30736
+ }
30737
+ }, _callee);
30738
+ }));
30739
+ function updateProducts(_x, _x2, _x3) {
30740
+ return _updateProducts.apply(this, arguments);
30741
+ }
30742
+ return updateProducts;
30743
+ }()
30744
+ }]);
30745
+ }();
30746
+ var productHandlerInstance = new DivaProductHandler();
30747
+
31297
30748
  function ownKeys$8(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; }
31298
30749
  function _objectSpread$8(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$8(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$8(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
31299
30750
  var LOG$8 = DivaUtils__default["default"].initLog('Planner', 'DIVA-SET-HANDLER');
@@ -31342,11 +30793,8 @@ var DivaSetHandler = /*#__PURE__*/function () {
31342
30793
  _context.next = 12;
31343
30794
  return set.plannerHandler.initSet(set, catalogData, undefined);
31344
30795
  case 12:
31345
- _context.next = 14;
31346
- return productHandlerInstance.updateProducts(set, 'onAdd');
31347
- case 14:
31348
30796
  return _context.abrupt("return", set);
31349
- case 15:
30797
+ case 13:
31350
30798
  case "end":
31351
30799
  return _context.stop();
31352
30800
  }
@@ -31403,7 +30851,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
31403
30851
  PosNr: orderline.PosNr,
31404
30852
  VariantValues: variantValues,
31405
30853
  VariantItemData: orderline.VariantBasketDatas,
31406
- ShelfPlanData: orderline.ShelfPlandata,
30854
+ ShelfPlandata: orderline.ShelfPlandata,
31407
30855
  elementId: (_orderline$ElementID = orderline.ElementID) !== null && _orderline$ElementID !== void 0 ? _orderline$ElementID : elements === null || elements === void 0 || (_elements$find = elements.find(function (element) {
31408
30856
  return element.basketID == orderline.BasketID;
31409
30857
  })) === null || _elements$find === void 0 ? void 0 : _elements$find.elementID
@@ -32130,19 +31578,12 @@ var DivaSetHandler = /*#__PURE__*/function () {
32130
31578
  _context13.next = 16;
32131
31579
  return articleHandlerInstance.toDoAfterArticleLoaded(newArticle, defaultHeaderValues, {}, from, undefined, ignorePlanner);
32132
31580
  case 16:
32133
- if (!(from === 'initializing')) {
32134
- _context13.next = 19;
32135
- break;
32136
- }
32137
- _context13.next = 19;
32138
- return productHandlerInstance.updateProducts(set, 'onAdd');
32139
- case 19:
32140
31581
  LOG$8.successTransaction('ON_PLAN_ARTICLE', {
32141
31582
  art: articleCodex,
32142
31583
  artName: newArticle.name
32143
31584
  });
32144
31585
  return _context13.abrupt("return", newArticle);
32145
- case 21:
31586
+ case 18:
32146
31587
  case "end":
32147
31588
  return _context13.stop();
32148
31589
  }
@@ -32275,7 +31716,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
32275
31716
  key: "deleteElementFromSet",
32276
31717
  value: function () {
32277
31718
  var _deleteElementFromSet = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee14(set, article, autoCorrectAVL_AVR, deletionType, dontReload) {
32278
- var _deletedArticle$doorP, _set$CatalogData, _deletedArticle$curPr;
31719
+ var _deletedArticle$doorP, _set$CatalogData;
32279
31720
  var setId, deletedArticle, articles, key, newSelectedElement, oldTransform, result, _set$getArticleByBask3, elementDeleted;
32280
31721
  return _regeneratorRuntime__default["default"].wrap(function _callee14$(_context16) {
32281
31722
  while (1) switch (_context16.prev = _context16.next) {
@@ -32335,20 +31776,13 @@ var DivaSetHandler = /*#__PURE__*/function () {
32335
31776
  _context16.next = 27;
32336
31777
  return this.updateArticlesOptionStatesOfActSet(set, {}, []);
32337
31778
  case 27:
32338
- if (dontReload) {
32339
- _context16.next = 30;
32340
- break;
32341
- }
32342
- _context16.next = 30;
32343
- return productHandlerInstance.updateProducts(set, 'onDelete', deletedArticle === null || deletedArticle === void 0 || (_deletedArticle$curPr = deletedArticle.curProduct) === null || _deletedArticle$curPr === void 0 ? void 0 : _deletedArticle$curPr.productId);
32344
- case 30:
32345
31779
  return _context16.abrupt("return", {
32346
31780
  success: elementDeleted,
32347
31781
  selectElementId: newSelectedElement,
32348
31782
  setId: setId,
32349
31783
  oldTransform: oldTransform
32350
31784
  });
32351
- case 31:
31785
+ case 28:
32352
31786
  case "end":
32353
31787
  return _context16.stop();
32354
31788
  }
@@ -33130,8 +32564,8 @@ var DivaSetHandler = /*#__PURE__*/function () {
33130
32564
  key: "variantsEvaluator",
33131
32565
  value: (function () {
33132
32566
  var _variantsEvaluator = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee23(set, configItems, configStepKey, paletteType) {
33133
- var _set$WebConfig, _set$ViewConfig, _configItems$;
33134
- var opt, checkForProductsInStock, calcVariantsForPricePreview, previewType, _set$CatalogData$show, targetArticles, startTime, variants, endTime;
32567
+ var _set$ViewConfig, _configItems$;
32568
+ var opt, calcVariantsForPricePreview, previewType, _set$CatalogData$show, targetArticles, startTime, variants, endTime;
33135
32569
  return _regeneratorRuntime__default["default"].wrap(function _callee23$(_context25) {
33136
32570
  while (1) switch (_context25.prev = _context25.next) {
33137
32571
  case 0:
@@ -33142,7 +32576,6 @@ var DivaSetHandler = /*#__PURE__*/function () {
33142
32576
  }
33143
32577
  return _context25.abrupt("return", configItems);
33144
32578
  case 3:
33145
- checkForProductsInStock = ((_set$WebConfig = set.WebConfig) === null || _set$WebConfig === void 0 ? void 0 : _set$WebConfig.checkForProductsInStock) && !(opt !== null && opt !== void 0 && opt.isDescribingState);
33146
32579
  calcVariantsForPricePreview = false;
33147
32580
  previewType = (_set$ViewConfig = set.ViewConfig) === null || _set$ViewConfig === void 0 ? void 0 : _set$ViewConfig.pricePreview;
33148
32581
  if (previewType) {
@@ -33152,27 +32585,24 @@ var DivaSetHandler = /*#__PURE__*/function () {
33152
32585
  if (paletteType == 'GAL' && ((_configItems$ = configItems[0]) === null || _configItems$ === void 0 ? void 0 : _configItems$.groupName) === undefined || paletteType == 'TEXTBOX' || paletteType == 'NUMBERBOX' || paletteType == 'RANGE') {
33153
32586
  calcVariantsForPricePreview = false;
33154
32587
  }
33155
- if (!(checkForProductsInStock || calcVariantsForPricePreview)) {
33156
- _context25.next = 19;
32588
+ if (!calcVariantsForPricePreview) {
32589
+ _context25.next = 17;
33157
32590
  break;
33158
32591
  }
33159
32592
  targetArticles = set.configTree.getTargetArticles(configStepKey);
33160
32593
  startTime = new Date();
33161
- _context25.next = 14;
32594
+ _context25.next = 13;
33162
32595
  return this.calcVariants(set, configItems, targetArticles);
33163
- case 14:
32596
+ case 13:
33164
32597
  variants = _context25.sent;
33165
32598
  endTime = new Date();
33166
32599
  if (endTime.getTime() - startTime.getTime() > 1000) set.dontCalcPricePreviewDueToPerformanceIssues = true;
33167
32600
  if (previewType) {
33168
32601
  this.calcPricePreview(set, configItems, variants);
33169
32602
  }
33170
- if (checkForProductsInStock) {
33171
- configItems = productHandlerInstance.checkProductInStock(configItems, variants, set.getDivaArticles(), targetArticles);
33172
- }
33173
- case 19:
32603
+ case 17:
33174
32604
  return _context25.abrupt("return", configItems);
33175
- case 20:
32605
+ case 18:
33176
32606
  case "end":
33177
32607
  return _context25.stop();
33178
32608
  }
@@ -33346,29 +32776,22 @@ var DivaSetHandler = /*#__PURE__*/function () {
33346
32776
  _context27.next = 19;
33347
32777
  return this.updateEdoArticles(set, retValues.newEDOExtraArticles);
33348
32778
  case 19:
33349
- if (!(from == 'FromViewClick')) {
33350
- _context27.next = 22;
33351
- break;
33352
- }
33353
- _context27.next = 22;
33354
- return productHandlerInstance.updateProducts(set, 'onConfig');
33355
- case 22:
33356
32779
  if (set.CatalogData.hasAlternateRenderings) set.CatalogData.updateAlternativeRenderings(set.getDivaArticles());
33357
32780
 
33358
32781
  //Update Planner - check if planner data changed
33359
32782
  if (!(!ignorePlanner && from != 'calcVariant')) {
33360
- _context27.next = 51;
32783
+ _context27.next = 48;
33361
32784
  break;
33362
32785
  }
33363
32786
  targetElementIds = this.getElementIdsOfArticles(set, targetArticlesWithNewValues);
33364
- _context27.next = 27;
32787
+ _context27.next = 24;
33365
32788
  return set.plannerHandler.updatePlanner(set.getSetId(), myValues, targetElementIds);
33366
- case 27:
32789
+ case 24:
33367
32790
  resultPlannerUpdate = _context27.sent;
33368
32791
  i = 0;
33369
- case 29:
32792
+ case 26:
33370
32793
  if (!(i < resultPlannerUpdate.elemIdsToDelete.length)) {
33371
- _context27.next = 38;
32794
+ _context27.next = 35;
33372
32795
  break;
33373
32796
  }
33374
32797
  articleToDel = set.getArticleByElementId(resultPlannerUpdate.elemIdsToDelete[i]);
@@ -33376,43 +32799,43 @@ var DivaSetHandler = /*#__PURE__*/function () {
33376
32799
  if (index > -1) {
33377
32800
  targetArticlesWithNewValues.splice(index, 1);
33378
32801
  }
33379
- _context27.next = 35;
32802
+ _context27.next = 32;
33380
32803
  return this.deleteElementFromSetByElemId(set, resultPlannerUpdate.elemIdsToDelete[i], false, resultPlannerUpdate.deletionType);
33381
- case 35:
32804
+ case 32:
33382
32805
  i++;
33383
- _context27.next = 29;
32806
+ _context27.next = 26;
33384
32807
  break;
33385
- case 38:
32808
+ case 35:
33386
32809
  if (!(resultPlannerUpdate.elementIdToCopy && resultPlannerUpdate.elementIdToCopy.length > 0)) {
33387
- _context27.next = 51;
32810
+ _context27.next = 48;
33388
32811
  break;
33389
32812
  }
33390
32813
  //Todo copy these elements
33391
32814
  articleCopyRelation = new Map();
33392
32815
  i = 0;
33393
- case 41:
32816
+ case 38:
33394
32817
  if (!(i < resultPlannerUpdate.elementIdToCopy.length)) {
33395
- _context27.next = 49;
32818
+ _context27.next = 46;
33396
32819
  break;
33397
32820
  }
33398
- _context27.next = 44;
32821
+ _context27.next = 41;
33399
32822
  return this.copyArticleByElementId(set, resultPlannerUpdate.elementIdToCopy[i], resultPlannerUpdate.ignoreOptionsToCopy);
33400
- case 44:
32823
+ case 41:
33401
32824
  newArticle = _context27.sent;
33402
32825
  articleCopyRelation.set(resultPlannerUpdate.elementIdToCopy[i], newArticle.basketId);
33403
- case 46:
32826
+ case 43:
33404
32827
  i++;
33405
- _context27.next = 41;
32828
+ _context27.next = 38;
33406
32829
  break;
33407
- case 49:
33408
- _context27.next = 51;
32830
+ case 46:
32831
+ _context27.next = 48;
33409
32832
  return set.plannerHandler.copyPlannerElements(set.getSetId(), articleCopyRelation, {
33410
32833
  dpType: resultPlannerUpdate.copyDPType ? resultPlannerUpdate.copyDPType : 'NO',
33411
32834
  copyType: resultPlannerUpdate.copyType,
33412
32835
  changedOPT: resultPlannerUpdate.changedOPT,
33413
32836
  targetElements: resultPlannerUpdate.targetElements
33414
32837
  });
33415
- case 51:
32838
+ case 48:
33416
32839
  this.updatePosNrOfAccessoiresOfTargetArticles(set, targetArticlesWithNewValues);
33417
32840
  if (from == 'FromViewClick' && (_Object$keys = Object.keys(myValues)) !== null && _Object$keys !== void 0 && _Object$keys.length) {
33418
32841
  this.confirmOptionsInMetric(set, [Object.keys(myValues)[0]], 'onSelectConfig');
@@ -33422,7 +32845,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
33422
32845
  elementIdsToUpdateSelection: (_resultPlannerUpdate = resultPlannerUpdate) === null || _resultPlannerUpdate === void 0 ? void 0 : _resultPlannerUpdate.elementIdsToUpdateSelection,
33423
32846
  setId: set.getSetId()
33424
32847
  });
33425
- case 54:
32848
+ case 51:
33426
32849
  case "end":
33427
32850
  return _context27.stop();
33428
32851
  }
@@ -33568,7 +32991,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
33568
32991
  articleHandlerInstance.defineAllOptionsOfArticles(articles);
33569
32992
  } else if (key === set.getSetId()) {
33570
32993
  for (var _key in basketIdsOnOptions) {
33571
- articlesAndOptions[_key] = {
32994
+ if (articles[_key]) articlesAndOptions[_key] = {
33572
32995
  article: articles[_key],
33573
32996
  options: basketIdsOnOptions[_key]
33574
32997
  };
@@ -33719,7 +33142,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
33719
33142
  value: function getTotalPrice(sets) {
33720
33143
  var _this$actSet;
33721
33144
  var price = 0;
33722
- if ((_this$actSet = this.actSet(sets)) !== null && _this$actSet !== void 0 && (_this$actSet = _this$actSet.WebConfig) !== null && _this$actSet !== void 0 && _this$actSet.checkForProductsInStock) {
33145
+ if ((_this$actSet = this.actSet(sets)) !== null && _this$actSet !== void 0 && (_this$actSet = _this$actSet.WebConfig) !== null && _this$actSet !== void 0 && _this$actSet.checkForProductsPrice && productHandlerInstance.getPrice()) {
33723
33146
  return productHandlerInstance.getPrice();
33724
33147
  }
33725
33148
  for (var key in sets) {
@@ -33733,7 +33156,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
33733
33156
  var _this$actSet2;
33734
33157
  var price = 0;
33735
33158
  var bruttoActive = false;
33736
- if ((_this$actSet2 = this.actSet(sets)) !== null && _this$actSet2 !== void 0 && (_this$actSet2 = _this$actSet2.WebConfig) !== null && _this$actSet2 !== void 0 && _this$actSet2.checkForProductsInStock) {
33159
+ if ((_this$actSet2 = this.actSet(sets)) !== null && _this$actSet2 !== void 0 && (_this$actSet2 = _this$actSet2.WebConfig) !== null && _this$actSet2 !== void 0 && _this$actSet2.checkForProductsPrice && productHandlerInstance.getPrice()) {
33737
33160
  return productHandlerInstance.getPrice();
33738
33161
  }
33739
33162
  for (var key in sets) {
@@ -33760,7 +33183,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
33760
33183
  key: "fillOrderLinesAndOrderSets",
33761
33184
  value: function () {
33762
33185
  var _fillOrderLinesAndOrderSets = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee28(sets, divaBasketHandler, repairOnly, setPlanner, returnTo) {
33763
- var _set$WebConfig2;
33186
+ var _set$WebConfig;
33764
33187
  var orderSets, basketData, set, setPosNr, price, key, _set$basketConfigVari, _OrderLinesOfActSet$, _set, catalogData, articles, orderLineInitInfos, newOrderSet, OrderLinesOfActSet, ret, _key2, i, _basketData$OrderSets, _basketData$SetPlanne, oderSetsIsInActPlanning, setId, j;
33765
33188
  return _regeneratorRuntime__default["default"].wrap(function _callee28$(_context30) {
33766
33189
  while (1) switch (_context30.prev = _context30.next) {
@@ -33770,7 +33193,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
33770
33193
  set = this.actSet(sets); //ACHTUNG: Wenn man das nicht zuerst löscht, gibt es beim wiederholten basket Speichern doppelte Einträge
33771
33194
  basketData.setSAPOrderLines([]);
33772
33195
  setPosNr = 0;
33773
- if (set !== null && set !== void 0 && (_set$WebConfig2 = set.WebConfig) !== null && _set$WebConfig2 !== void 0 && _set$WebConfig2.checkForProductsPrice) {
33196
+ if (set !== null && set !== void 0 && (_set$WebConfig = set.WebConfig) !== null && _set$WebConfig !== void 0 && _set$WebConfig.checkForProductsPrice) {
33774
33197
  price = set.priceForActHash();
33775
33198
  if (!price) {
33776
33199
  basketData.OrigProductId = undefined;
@@ -33807,7 +33230,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
33807
33230
  if (newOrderSet.SetImage == '' && (_OrderLinesOfActSet$ = OrderLinesOfActSet[0]) !== null && _OrderLinesOfActSet$ !== void 0 && _OrderLinesOfActSet$.Image && _set.PlannerMode == 'No') {
33808
33231
  newOrderSet.SetImage = OrderLinesOfActSet[0].Image.replace('_low', '');
33809
33232
  }
33810
- ret = divaBasketHandler.divaWWSHandler.getWWSData(basketData, _set, newOrderSet, OrderLinesOfActSet, productHandlerInstance.getCurrentProducts());
33233
+ ret = divaBasketHandler.divaWWSHandler.getWWSData(basketData, _set, newOrderSet, OrderLinesOfActSet);
33811
33234
  for (_key2 in ret) {
33812
33235
  if (_key2 == 'orderlines') {
33813
33236
  OrderLinesOfActSet = ret[_key2];
@@ -33911,8 +33334,11 @@ var DivaSetHandler = /*#__PURE__*/function () {
33911
33334
  });
33912
33335
  if (origOrderSet) {
33913
33336
  origOrderSet.CatalogName = actOrderSet.CatalogName;
33337
+ origOrderSet.AccountName = actOrderSet.AccountName;
33338
+ origOrderSet.AccountLogo = actOrderSet.AccountLogo;
33914
33339
  origOrderSet.CatalogOfflineVersion = actOrderSet.CatalogOfflineVersion;
33915
33340
  origOrderSet.CatalogGUID = actOrderSet.CatalogGUID;
33341
+ origOrderSet.CollectionGUID = actOrderSet.CollectionGUID;
33916
33342
  origOrderSet.OrderLines = actOrderSet.OrderLines;
33917
33343
  origOrderSet.OrderSetDesc = actOrderSet.OrderSetDesc;
33918
33344
  origOrderSet.OrigZKATNr = actOrderSet.OrigZKATNr;
@@ -33925,11 +33351,14 @@ var DivaSetHandler = /*#__PURE__*/function () {
33925
33351
  origOrderSet.BBox = actOrderSet.BBox;
33926
33352
  origOrderSet.VariantDescription = actOrderSet.VariantDescription;
33927
33353
  if (actOrderSet.ConfigVariants && origOrderSet.ConfigVariants) origOrderSet.ConfigVariants = actOrderSet.ConfigVariants.map(function (variant, index) {
33354
+ var _origOrderSet$ConfigV;
33355
+ var configVariant = (_origOrderSet$ConfigV = origOrderSet.ConfigVariants) === null || _origOrderSet$ConfigV === void 0 ? void 0 : _origOrderSet$ConfigV[index];
33356
+ if (!configVariant) return variant;
33928
33357
  return _objectSpread$8(_objectSpread$8({}, variant), {}, {
33929
- SetImage: origOrderSet.ConfigVariants[index].SetImage,
33930
- HQRenderScript: origOrderSet.ConfigVariants[index].HQRenderScript,
33931
- Set2DImage: origOrderSet.ConfigVariants[index].Set2DImage,
33932
- Diva3DProject: origOrderSet.ConfigVariants[index].Diva3DProject
33358
+ SetImage: configVariant.SetImage,
33359
+ HQRenderScript: configVariant.HQRenderScript,
33360
+ Set2DImage: configVariant.Set2DImage,
33361
+ Diva3DProject: configVariant.Diva3DProject
33933
33362
  });
33934
33363
  });
33935
33364
  }
@@ -33938,7 +33367,6 @@ var DivaSetHandler = /*#__PURE__*/function () {
33938
33367
  _loop7();
33939
33368
  }
33940
33369
  }
33941
-
33942
33370
  /**************************SpeicherRoutinen*************************************/
33943
33371
  }, {
33944
33372
  key: "isNoArticleToSave",
@@ -34022,7 +33450,6 @@ var DivaSetHandler = /*#__PURE__*/function () {
34022
33450
  CatalogOfflineFilesLastUpdate: catalogData.offlineFilesLastUpdate,
34023
33451
  Description: catalogData.description,
34024
33452
  GroupType: GroupType,
34025
- MainPosNr: posNr,
34026
33453
  OfflineData: catalogData.offlineData,
34027
33454
  SetArticleNr: set.SetArticleNr ? set.SetArticleNr : catalogData.retailArticleNr,
34028
33455
  SetArticleNrPrefix: set.SetArticleNrPrefix,
@@ -34271,31 +33698,6 @@ var DivaSetHandler = /*#__PURE__*/function () {
34271
33698
  Info: ((_set$api$getI18n$t = (_set$api$getI18n = set.api.getI18n()) === null || _set$api$getI18n === void 0 || (_set$api$getI18n$t2 = _set$api$getI18n.t) === null || _set$api$getI18n$t2 === void 0 ? void 0 : _set$api$getI18n$t2.call(_set$api$getI18n, 'utils.width_first_letter', 'B')) !== null && _set$api$getI18n$t !== void 0 ? _set$api$getI18n$t : 'B') + ': ' + dim.X + ' cm x ' + ((_set$api$getI18n$t3 = (_set$api$getI18n2 = set.api.getI18n()) === null || _set$api$getI18n2 === void 0 || (_set$api$getI18n2$t = _set$api$getI18n2.t) === null || _set$api$getI18n2$t === void 0 ? void 0 : _set$api$getI18n2$t.call(_set$api$getI18n2, 'utils.depth_first_letter', 'T')) !== null && _set$api$getI18n$t3 !== void 0 ? _set$api$getI18n$t3 : 'T') + ': ' + dim.Y + ' cm' + (dim.Z ? ' x ' + ((_set$api$getI18n$t4 = (_set$api$getI18n3 = set.api.getI18n()) === null || _set$api$getI18n3 === void 0 || (_set$api$getI18n3$t = _set$api$getI18n3.t) === null || _set$api$getI18n3$t === void 0 ? void 0 : _set$api$getI18n3$t.call(_set$api$getI18n3, 'utils.height_first_letter', 'H')) !== null && _set$api$getI18n$t4 !== void 0 ? _set$api$getI18n$t4 : 'H') + ': ' + dim.X + ' cm' : '')
34272
33699
  });
34273
33700
  }
34274
- }, {
34275
- key: "loadProductsOfSets",
34276
- value: function () {
34277
- var _loadProductsOfSets = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee34(orderSets, involvedSetIds) {
34278
- return _regeneratorRuntime__default["default"].wrap(function _callee34$(_context36) {
34279
- while (1) switch (_context36.prev = _context36.next) {
34280
- case 0:
34281
- _context36.next = 2;
34282
- return productHandlerInstance.loadProductsOfSets(orderSets, involvedSetIds);
34283
- case 2:
34284
- case "end":
34285
- return _context36.stop();
34286
- }
34287
- }, _callee34);
34288
- }));
34289
- function loadProductsOfSets(_x113, _x114) {
34290
- return _loadProductsOfSets.apply(this, arguments);
34291
- }
34292
- return loadProductsOfSets;
34293
- }()
34294
- }, {
34295
- key: "addProducts",
34296
- value: function addProducts(variants, families) {
34297
- productHandlerInstance.addProducts(variants, families);
34298
- }
34299
33701
  }, {
34300
33702
  key: "getAllProducts",
34301
33703
  value: function getAllProducts(sets) {
@@ -34323,28 +33725,25 @@ var DivaSetHandler = /*#__PURE__*/function () {
34323
33725
  }, {
34324
33726
  key: "addOrderSetArticlesToExistingSet",
34325
33727
  value: function () {
34326
- var _addOrderSetArticlesToExistingSet = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee35(set, orderSet, lastSetToInitialize) {
34327
- return _regeneratorRuntime__default["default"].wrap(function _callee35$(_context37) {
34328
- while (1) switch (_context37.prev = _context37.next) {
33728
+ var _addOrderSetArticlesToExistingSet = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee34(set, orderSet, lastSetToInitialize) {
33729
+ return _regeneratorRuntime__default["default"].wrap(function _callee34$(_context36) {
33730
+ while (1) switch (_context36.prev = _context36.next) {
34329
33731
  case 0:
34330
33732
  //TODO: GLOBAL STUFF
34331
33733
  //this.updateActSet(set);
34332
33734
  orderSet.changeBasketIds();
34333
- _context37.next = 3;
33735
+ _context36.next = 3;
34334
33736
  return this.initOrderLineArticles(set, orderSet);
34335
33737
  case 3:
34336
- _context37.next = 5;
33738
+ _context36.next = 5;
34337
33739
  return set.plannerHandler.extendSet(set, orderSet.SetPlanData, lastSetToInitialize);
34338
33740
  case 5:
34339
- _context37.next = 7;
34340
- return productHandlerInstance.updateProducts(set, 'onAdd');
34341
- case 7:
34342
33741
  case "end":
34343
- return _context37.stop();
33742
+ return _context36.stop();
34344
33743
  }
34345
- }, _callee35, this);
33744
+ }, _callee34, this);
34346
33745
  }));
34347
- function addOrderSetArticlesToExistingSet(_x115, _x116, _x117) {
33746
+ function addOrderSetArticlesToExistingSet(_x113, _x114, _x115) {
34348
33747
  return _addOrderSetArticlesToExistingSet.apply(this, arguments);
34349
33748
  }
34350
33749
  return addOrderSetArticlesToExistingSet;
@@ -34669,21 +34068,29 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34669
34068
  }, {
34670
34069
  key: "initProductId",
34671
34070
  value: function () {
34672
- var _initProductId = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee2(api, productId, keepOldDivaNr) {
34071
+ var _initProductId = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee2(api, productId) {
34072
+ var result;
34673
34073
  return _regeneratorRuntime__default["default"].wrap(function _callee2$(_context2) {
34674
34074
  while (1) switch (_context2.prev = _context2.next) {
34675
34075
  case 0:
34676
34076
  _context2.next = 2;
34677
- return this.loadProduct(api, productId, keepOldDivaNr);
34077
+ return this.getProduct(api, productId);
34678
34078
  case 2:
34079
+ result = _context2.sent;
34080
+ this.assignNewDivaNr = true;
34081
+ _context2.next = 6;
34082
+ return this.initBasket(api, result.divaNr, {
34083
+ basket: result.configuration
34084
+ }, false);
34085
+ case 6:
34679
34086
  return _context2.abrupt("return", _context2.sent);
34680
- case 3:
34087
+ case 7:
34681
34088
  case "end":
34682
34089
  return _context2.stop();
34683
34090
  }
34684
34091
  }, _callee2, this);
34685
34092
  }));
34686
- function initProductId(_x2, _x3, _x4) {
34093
+ function initProductId(_x2, _x3) {
34687
34094
  return _initProductId.apply(this, arguments);
34688
34095
  }
34689
34096
  return initProductId;
@@ -34729,7 +34136,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34729
34136
  }
34730
34137
  }, _callee3, this);
34731
34138
  }));
34732
- function tryInitFirstCatalog(_x5) {
34139
+ function tryInitFirstCatalog(_x4) {
34733
34140
  return _tryInitFirstCatalog.apply(this, arguments);
34734
34141
  }
34735
34142
  return tryInitFirstCatalog;
@@ -34764,7 +34171,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34764
34171
  }
34765
34172
  }, _callee4, this);
34766
34173
  }));
34767
- function createNewDivaNr(_x6) {
34174
+ function createNewDivaNr(_x5) {
34768
34175
  return _createNewDivaNr.apply(this, arguments);
34769
34176
  }
34770
34177
  return createNewDivaNr;
@@ -34794,7 +34201,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34794
34201
  } else {
34795
34202
  this.origConfiguration.originDivaNr = divaNr;
34796
34203
  }
34797
- if (this.plannerConfig.returnTo != 'REPAIR_BASKET' && basket.StatusKey == 'BASE_CONFIGURATION') {
34204
+ if (this.plannerConfig.returnTo != 'REPAIR_BASKET' && (basket.StatusKey == 'BASE_CONFIGURATION' || keepOldDivaNr === false)) {
34798
34205
  this.assignNewDivaNr = true;
34799
34206
  basket.CustomerJourneyId = DivaUtils.nanoid();
34800
34207
  basket.StatusKey = 'USER_CONFIGURATION';
@@ -34812,7 +34219,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34812
34219
  basket.OrderSets[i].SetID = newSetId;
34813
34220
  }
34814
34221
  }
34815
- if (!(this.assignNewDivaNr && !keepOldDivaNr)) {
34222
+ if (!this.assignNewDivaNr) {
34816
34223
  _context5.next = 29;
34817
34224
  break;
34818
34225
  }
@@ -34892,7 +34299,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34892
34299
  }
34893
34300
  }, _callee5, this);
34894
34301
  }));
34895
- function initBasket(_x7, _x8, _x9, _x10, _x11) {
34302
+ function initBasket(_x6, _x7, _x8, _x9, _x10) {
34896
34303
  return _initBasket.apply(this, arguments);
34897
34304
  }
34898
34305
  return initBasket;
@@ -34971,7 +34378,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34971
34378
  }
34972
34379
  }, _callee6, this);
34973
34380
  }));
34974
- function loadBasketByCatalogCodex(_x12) {
34381
+ function loadBasketByCatalogCodex(_x11) {
34975
34382
  return _loadBasketByCatalogCodex.apply(this, arguments);
34976
34383
  }
34977
34384
  return loadBasketByCatalogCodex;
@@ -34979,7 +34386,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34979
34386
  }, {
34980
34387
  key: "loadBasketByDivaNr",
34981
34388
  value: function () {
34982
- var _loadBasketByDivaNr = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee7(api, divaNr, keepOldDivaNr, origProductId) {
34389
+ var _loadBasketByDivaNr = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee7(api, divaNr) {
34983
34390
  var variantData;
34984
34391
  return _regeneratorRuntime__default["default"].wrap(function _callee7$(_context7) {
34985
34392
  while (1) switch (_context7.prev = _context7.next) {
@@ -34990,13 +34397,13 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34990
34397
  case 3:
34991
34398
  variantData = _context7.sent;
34992
34399
  _context7.next = 6;
34993
- return this.initBasket(api, divaNr, variantData, keepOldDivaNr, origProductId);
34400
+ return this.initBasket(api, divaNr, variantData);
34994
34401
  case 6:
34995
34402
  return _context7.abrupt("return", _context7.sent);
34996
34403
  case 9:
34997
34404
  _context7.prev = 9;
34998
34405
  _context7.t0 = _context7["catch"](0);
34999
- LOG$7.error(new DivaUtils.DivaError('DivaNr konnte in der Datenbank nicht gefunden werden', {
34406
+ LOG$7.error(new DivaUtils.DivaError('DivaNr cannot be found in Database', {
35000
34407
  code: 'WC_0004',
35001
34408
  custom: {
35002
34409
  divaNr: divaNr
@@ -35009,7 +34416,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35009
34416
  }
35010
34417
  }, _callee7, this, [[0, 9]]);
35011
34418
  }));
35012
- function loadBasketByDivaNr(_x13, _x14, _x15, _x16) {
34419
+ function loadBasketByDivaNr(_x12, _x13) {
35013
34420
  return _loadBasketByDivaNr.apply(this, arguments);
35014
34421
  }
35015
34422
  return loadBasketByDivaNr;
@@ -35022,98 +34429,65 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35022
34429
  return _regeneratorRuntime__default["default"].wrap(function _callee8$(_context8) {
35023
34430
  while (1) switch (_context8.prev = _context8.next) {
35024
34431
  case 0:
35025
- _context8.next = 2;
34432
+ _context8.prev = 0;
34433
+ _context8.next = 3;
35026
34434
  return api.getDataCache(api.getProductBasketUrl(key, productId), undefined, undefined, 'catalog', 'POST', {
35027
34435
  fields: fields !== null && fields !== void 0 && fields.length ? fields : undefined
35028
34436
  });
35029
- case 2:
34437
+ case 3:
35030
34438
  variantData = _context8.sent;
35031
34439
  if (!(variantData.Error || !variantData.basket)) {
35032
- _context8.next = 8;
34440
+ _context8.next = 9;
35033
34441
  break;
35034
34442
  }
35035
- LOG$7.error(new DivaUtils.DivaError('ProductId konnte in der Datenbank nicht gefunden werden', {
34443
+ LOG$7.error(new DivaUtils.DivaError('CustomProductId cannot be found in Database', {
35036
34444
  code: 'WC_0005',
35037
34445
  custom: {
34446
+ key: key,
35038
34447
  productId: productId
35039
34448
  }
35040
34449
  }));
35041
34450
  return _context8.abrupt("return", false);
35042
- case 8:
35043
- return _context8.abrupt("return", this.initBasket(api, variantData.basket.DivaNr, variantData, undefined, productId));
35044
34451
  case 9:
34452
+ return _context8.abrupt("return", this.initBasket(api, variantData.basket.DivaNr, variantData, undefined, productId));
34453
+ case 10:
34454
+ _context8.next = 16;
34455
+ break;
34456
+ case 12:
34457
+ _context8.prev = 12;
34458
+ _context8.t0 = _context8["catch"](0);
34459
+ LOG$7.error(new DivaUtils.DivaError('Error while fetching product data', {
34460
+ code: 'WC_0005',
34461
+ custom: {
34462
+ productId: productId
34463
+ }
34464
+ }));
34465
+ return _context8.abrupt("return", false);
34466
+ case 16:
35045
34467
  case "end":
35046
34468
  return _context8.stop();
35047
34469
  }
35048
- }, _callee8, this);
34470
+ }, _callee8, this, [[0, 12]]);
35049
34471
  }));
35050
- function loadBasketByCustomProductId(_x17, _x18, _x19, _x20) {
34472
+ function loadBasketByCustomProductId(_x14, _x15, _x16, _x17) {
35051
34473
  return _loadBasketByCustomProductId.apply(this, arguments);
35052
34474
  }
35053
34475
  return loadBasketByCustomProductId;
35054
34476
  }()
35055
34477
  }, {
35056
- key: "loadProduct",
34478
+ key: "getProduct",
35057
34479
  value: function () {
35058
- var _loadProduct = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee9(api, productId, keepOldDivaNr) {
35059
- var result, divaNr, id, successfully;
34480
+ var _getProduct = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee9(api, productId) {
34481
+ var result;
35060
34482
  return _regeneratorRuntime__default["default"].wrap(function _callee9$(_context9) {
35061
34483
  while (1) switch (_context9.prev = _context9.next) {
35062
34484
  case 0:
35063
34485
  _context9.next = 2;
35064
- return this.getProduct(api, productId);
35065
- case 2:
35066
- result = _context9.sent;
35067
- if (!(result === false)) {
35068
- _context9.next = 5;
35069
- break;
35070
- }
35071
- return _context9.abrupt("return", false);
35072
- case 5:
35073
- divaNr = result.divaNr;
35074
- if (result.originDivaNr) {
35075
- divaNr = result.originDivaNr;
35076
- } else if (result.variantId !== undefined) {
35077
- id = result.variantId;
35078
- divaNr = result.divaNr + '_' + id.toString().padStart(4, '0');
35079
- }
35080
- _context9.next = 9;
35081
- return this.loadBasketByDivaNr(api, divaNr, keepOldDivaNr, productId);
35082
- case 9:
35083
- successfully = _context9.sent;
35084
- result.type = 'ProductId';
35085
- if (!successfully) {
35086
- _context9.next = 15;
35087
- break;
35088
- }
35089
- return _context9.abrupt("return", result);
35090
- case 15:
35091
- return _context9.abrupt("return", false);
35092
- case 16:
35093
- case "end":
35094
- return _context9.stop();
35095
- }
35096
- }, _callee9, this);
35097
- }));
35098
- function loadProduct(_x21, _x22, _x23) {
35099
- return _loadProduct.apply(this, arguments);
35100
- }
35101
- return loadProduct;
35102
- }()
35103
- }, {
35104
- key: "getProduct",
35105
- value: function () {
35106
- var _getProduct = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee10(api, productId) {
35107
- var result;
35108
- return _regeneratorRuntime__default["default"].wrap(function _callee10$(_context10) {
35109
- while (1) switch (_context10.prev = _context10.next) {
35110
- case 0:
35111
- _context10.next = 2;
35112
34486
  return api.getDataCache(api.getProductUrl(productId), undefined, undefined, 'catalog');
35113
34487
  case 2:
35114
- result = _context10.sent;
34488
+ result = _context9.sent;
35115
34489
  if (!(result.Error || !result)) {
35116
- _context10.next = 6;
34490
+ _context9.next = 6;
35117
34491
  break;
35118
34492
  }
35119
34493
  LOG$7.error(new DivaUtils.DivaError('ProductId konnte in der Datenbank nicht gefunden werden', {
@@ -35122,16 +34496,16 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35122
34496
  productId: productId
35123
34497
  }
35124
34498
  }));
35125
- return _context10.abrupt("return", false);
34499
+ return _context9.abrupt("return", false);
35126
34500
  case 6:
35127
- return _context10.abrupt("return", result[0]);
34501
+ return _context9.abrupt("return", result[0]);
35128
34502
  case 7:
35129
34503
  case "end":
35130
- return _context10.stop();
34504
+ return _context9.stop();
35131
34505
  }
35132
- }, _callee10);
34506
+ }, _callee9);
35133
34507
  }));
35134
- function getProduct(_x24, _x25) {
34508
+ function getProduct(_x18, _x19) {
35135
34509
  return _getProduct.apply(this, arguments);
35136
34510
  }
35137
34511
  return getProduct;
@@ -35139,15 +34513,14 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35139
34513
  }, {
35140
34514
  key: "createNewBasket",
35141
34515
  value: function () {
35142
- var _createNewBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee11(api, initObject, divaNr, lang) {
34516
+ var _createNewBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee10(api, initObject, divaNr, lang) {
35143
34517
  var setId, orderSet, basketInitObejct, basket;
35144
- return _regeneratorRuntime__default["default"].wrap(function _callee11$(_context11) {
35145
- while (1) switch (_context11.prev = _context11.next) {
34518
+ return _regeneratorRuntime__default["default"].wrap(function _callee10$(_context10) {
34519
+ while (1) switch (_context10.prev = _context10.next) {
35146
34520
  case 0:
35147
34521
  setId = 'PLANNING_' + Math.random().toString(36).substring(6);
35148
34522
  orderSet = new basketModel.OrderSetData({
35149
34523
  SetID: setId,
35150
- MainPosNr: 1,
35151
34524
  AccountSessionGUID: initObject.accountSessionGuid,
35152
34525
  CatalogCodex: initObject.catalogCodex,
35153
34526
  CatalogGUID: initObject.catalogGuid,
@@ -35155,10 +34528,10 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35155
34528
  Favorites: new basketModel.Favorites()
35156
34529
  });
35157
34530
  if (!(initObject.accountGuid && !orderSet.AccountSessionGUID)) {
35158
- _context11.next = 5;
34531
+ _context10.next = 5;
35159
34532
  break;
35160
34533
  }
35161
- _context11.next = 5;
34534
+ _context10.next = 5;
35162
34535
  return api.setAccountSessionGuid({
35163
34536
  os: orderSet,
35164
34537
  accountGuid: initObject.accountGuid,
@@ -35176,14 +34549,14 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35176
34549
  CustomerJourneyId: DivaUtils.nanoid()
35177
34550
  };
35178
34551
  basket = new basketModel.BasketData(basketInitObejct);
35179
- return _context11.abrupt("return", basket);
34552
+ return _context10.abrupt("return", basket);
35180
34553
  case 8:
35181
34554
  case "end":
35182
- return _context11.stop();
34555
+ return _context10.stop();
35183
34556
  }
35184
- }, _callee11);
34557
+ }, _callee10);
35185
34558
  }));
35186
- function createNewBasket(_x26, _x27, _x28, _x29) {
34559
+ function createNewBasket(_x20, _x21, _x22, _x23) {
35187
34560
  return _createNewBasket.apply(this, arguments);
35188
34561
  }
35189
34562
  return createNewBasket;
@@ -35202,11 +34575,11 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35202
34575
  }, {
35203
34576
  key: "saveToBasket",
35204
34577
  value: function () {
35205
- var _saveToBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee12(api, actBasket, returnTo) {
34578
+ var _saveToBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee11(api, actBasket, returnTo) {
35206
34579
  var _this$plannerConfig$c4, _this$_basketHandler, _api$getJwt;
35207
34580
  var response;
35208
- return _regeneratorRuntime__default["default"].wrap(function _callee12$(_context12) {
35209
- while (1) switch (_context12.prev = _context12.next) {
34581
+ return _regeneratorRuntime__default["default"].wrap(function _callee11$(_context11) {
34582
+ while (1) switch (_context11.prev = _context11.next) {
35210
34583
  case 0:
35211
34584
  LOG$7.startTransaction({
35212
34585
  event: 'SaveBasketOnAPI',
@@ -35218,12 +34591,12 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35218
34591
  actBasket.ReportConfigIdentifier = api.getReportConfigIdentifier();
35219
34592
  actBasket.PrintOptions = api.getPrintOptions(this.reportConfig);
35220
34593
  actBasket.ClientLanguage = api.getLanguage();
35221
- _context12.next = 8;
34594
+ _context11.next = 8;
35222
34595
  return DivaUtils__default["default"].updateBasketOrgInfo(actBasket, this.plannerConfig.currentOrganization, this.plannerConfig.currentUser, this.plannerConfig.settings.keepSalesPersonDataInBasket);
35223
34596
  case 8:
35224
34597
  actBasket.UserLanguage = api.getLanguage();
35225
34598
  actBasket.PrintRetailLogo = (_this$plannerConfig$c4 = this.plannerConfig.currentOrganization) === null || _this$plannerConfig$c4 === void 0 ? void 0 : _this$plannerConfig$c4.logoUrl;
35226
- _context12.next = 12;
34599
+ _context11.next = 12;
35227
34600
  return (_this$_basketHandler = this._basketHandler) === null || _this$_basketHandler === void 0 ? void 0 : _this$_basketHandler.saveBasket({
35228
34601
  jwt: (_api$getJwt = api.getJwt()) !== null && _api$getJwt !== void 0 ? _api$getJwt : undefined,
35229
34602
  basket: actBasket,
@@ -35232,30 +34605,30 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35232
34605
  apiKey: api.getApiKey()
35233
34606
  });
35234
34607
  case 12:
35235
- response = _context12.sent;
34608
+ response = _context11.sent;
35236
34609
  if (!(response != 'ERROR_NO_BASKET_SAVED')) {
35237
- _context12.next = 17;
34610
+ _context11.next = 17;
35238
34611
  break;
35239
34612
  }
35240
34613
  this.baskets[this.actDivaNr] = new basketModel.BasketData(response);
35241
- _context12.next = 19;
34614
+ _context11.next = 19;
35242
34615
  break;
35243
34616
  case 17:
35244
34617
  if (!(response === 'ERROR_NO_BASKET_SAVED' || response === 'ERROR_BASKET_AFTER_SAVE')) {
35245
- _context12.next = 19;
34618
+ _context11.next = 19;
35246
34619
  break;
35247
34620
  }
35248
- return _context12.abrupt("return", response);
34621
+ return _context11.abrupt("return", response);
35249
34622
  case 19:
35250
34623
  LOG$7.successTransaction('saveBasketOnAPI');
35251
- return _context12.abrupt("return", response === null || response === void 0 ? void 0 : response._id);
34624
+ return _context11.abrupt("return", response === null || response === void 0 ? void 0 : response._id);
35252
34625
  case 21:
35253
34626
  case "end":
35254
- return _context12.stop();
34627
+ return _context11.stop();
35255
34628
  }
35256
- }, _callee12, this);
34629
+ }, _callee11, this);
35257
34630
  }));
35258
- function saveToBasket(_x30, _x31, _x32) {
34631
+ function saveToBasket(_x24, _x25, _x26) {
35259
34632
  return _saveToBasket.apply(this, arguments);
35260
34633
  }
35261
34634
  return saveToBasket;
@@ -35368,61 +34741,53 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35368
34741
  }, {
35369
34742
  key: "initWWSClient",
35370
34743
  value: function () {
35371
- var _initWWSClient = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee13(wwsClient) {
35372
- var _yield$import, PfisterWWSHandler, _yield$import2, LiviqueWWSHandler, _yield$import3, SeriousWWSHandler, _yield$import4, ProductWWSHandler, _yield$import5, StandardWWSHandler;
35373
- return _regeneratorRuntime__default["default"].wrap(function _callee13$(_context13) {
35374
- while (1) switch (_context13.prev = _context13.next) {
34744
+ var _initWWSClient = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee12(wwsClient) {
34745
+ var _yield$import, PfisterWWSHandler, _yield$import2, LiviqueWWSHandler, _yield$import3, SeriousWWSHandler, _yield$import4, StandardWWSHandler;
34746
+ return _regeneratorRuntime__default["default"].wrap(function _callee12$(_context12) {
34747
+ while (1) switch (_context12.prev = _context12.next) {
35375
34748
  case 0:
35376
- _context13.t0 = wwsClient;
35377
- _context13.next = _context13.t0 === 'Pfister' ? 3 : _context13.t0 === 'Livique' ? 9 : _context13.t0 === 'Serious' ? 15 : _context13.t0 === 'Product' ? 21 : 27;
34749
+ _context12.t0 = wwsClient;
34750
+ _context12.next = _context12.t0 === 'Pfister' ? 3 : _context12.t0 === 'Livique' ? 9 : _context12.t0 === 'Serious' ? 15 : 21;
35378
34751
  break;
35379
34752
  case 3:
35380
- _context13.next = 5;
35381
- return Promise.resolve().then(function () { return require('./PfisterWWSHandler-b47dba23.js'); });
34753
+ _context12.next = 5;
34754
+ return Promise.resolve().then(function () { return require('./PfisterWWSHandler-f0420b6e.js'); });
35382
34755
  case 5:
35383
- _yield$import = _context13.sent;
34756
+ _yield$import = _context12.sent;
35384
34757
  PfisterWWSHandler = _yield$import["default"];
35385
34758
  this._divaWWSHandler = new PfisterWWSHandler();
35386
- return _context13.abrupt("break", 33);
34759
+ return _context12.abrupt("break", 27);
35387
34760
  case 9:
35388
- _context13.next = 11;
35389
- return Promise.resolve().then(function () { return require('./LiviqueWWSHandler-85a1dc89.js'); });
34761
+ _context12.next = 11;
34762
+ return Promise.resolve().then(function () { return require('./LiviqueWWSHandler-3c5f38b8.js'); });
35390
34763
  case 11:
35391
- _yield$import2 = _context13.sent;
34764
+ _yield$import2 = _context12.sent;
35392
34765
  LiviqueWWSHandler = _yield$import2["default"];
35393
34766
  this._divaWWSHandler = new LiviqueWWSHandler();
35394
- return _context13.abrupt("break", 33);
34767
+ return _context12.abrupt("break", 27);
35395
34768
  case 15:
35396
- _context13.next = 17;
35397
- return Promise.resolve().then(function () { return require('./SeriousBasketHandler-28f031fa.js'); });
34769
+ _context12.next = 17;
34770
+ return Promise.resolve().then(function () { return require('./SeriousBasketHandler-3e286b68.js'); });
35398
34771
  case 17:
35399
- _yield$import3 = _context13.sent;
34772
+ _yield$import3 = _context12.sent;
35400
34773
  SeriousWWSHandler = _yield$import3["default"];
35401
34774
  this._divaWWSHandler = new SeriousWWSHandler();
35402
- return _context13.abrupt("break", 33);
34775
+ return _context12.abrupt("break", 27);
35403
34776
  case 21:
35404
- _context13.next = 23;
35405
- return Promise.resolve().then(function () { return require('./ProductBasketHandler-22cb7ee4.js'); });
34777
+ _context12.next = 23;
34778
+ return Promise.resolve().then(function () { return require('./StandardWWSHandler-c2ac4b39.js'); });
35406
34779
  case 23:
35407
- _yield$import4 = _context13.sent;
35408
- ProductWWSHandler = _yield$import4["default"];
35409
- this._divaWWSHandler = new ProductWWSHandler();
35410
- return _context13.abrupt("break", 33);
35411
- case 27:
35412
- _context13.next = 29;
35413
- return Promise.resolve().then(function () { return require('./StandardWWSHandler-ab0c107b.js'); });
35414
- case 29:
35415
- _yield$import5 = _context13.sent;
35416
- StandardWWSHandler = _yield$import5["default"];
34780
+ _yield$import4 = _context12.sent;
34781
+ StandardWWSHandler = _yield$import4["default"];
35417
34782
  this._divaWWSHandler = new StandardWWSHandler();
35418
- return _context13.abrupt("break", 33);
35419
- case 33:
34783
+ return _context12.abrupt("break", 27);
34784
+ case 27:
35420
34785
  case "end":
35421
- return _context13.stop();
34786
+ return _context12.stop();
35422
34787
  }
35423
- }, _callee13, this);
34788
+ }, _callee12, this);
35424
34789
  }));
35425
- function initWWSClient(_x33) {
34790
+ function initWWSClient(_x27) {
35426
34791
  return _initWWSClient.apply(this, arguments);
35427
34792
  }
35428
34793
  return initWWSClient;
@@ -36025,7 +35390,7 @@ var Rendering = /*#__PURE__*/function () {
36025
35390
  this.creationTime = new Date();
36026
35391
  this.layerMaskThreeTexture = undefined;
36027
35392
  this.hasStaticBackground = hasStaticBG;
36028
- this.mediaServiceSaveMode = mediaServiceSaveMode;
35393
+ this.mediaServiceSaveMode = mediaServiceSaveMode !== null && mediaServiceSaveMode !== void 0 ? mediaServiceSaveMode : 'STREAM';
36029
35394
  this.urlToSavedRendering = '';
36030
35395
  this.catalogData = {
36031
35396
  catalogCodex: '',
@@ -36070,12 +35435,12 @@ var Rendering = /*#__PURE__*/function () {
36070
35435
  }, {
36071
35436
  key: "getHasStaticBackground",
36072
35437
  value: function getHasStaticBackground() {
36073
- return this.hasStaticBackground;
35438
+ return !!this.hasStaticBackground;
36074
35439
  }
36075
35440
  }, {
36076
35441
  key: "getIsFullscreenRendering",
36077
35442
  value: function getIsFullscreenRendering() {
36078
- return this.isFullscreenRendering;
35443
+ return !!this.isFullscreenRendering;
36079
35444
  }
36080
35445
  }, {
36081
35446
  key: "setIsFullscreenRendering",
@@ -36085,12 +35450,13 @@ var Rendering = /*#__PURE__*/function () {
36085
35450
  }, {
36086
35451
  key: "getHasDimensionLines",
36087
35452
  value: function getHasDimensionLines() {
36088
- return this.hasDimensionLines;
35453
+ return !!this.hasDimensionLines;
36089
35454
  }
36090
35455
  }, {
36091
35456
  key: "getPlannerMeasureDigits",
36092
35457
  value: function getPlannerMeasureDigits() {
36093
- return this.plannerMeasureDigits;
35458
+ var _this$plannerMeasureD;
35459
+ return (_this$plannerMeasureD = this.plannerMeasureDigits) !== null && _this$plannerMeasureD !== void 0 ? _this$plannerMeasureD : 0;
36094
35460
  }
36095
35461
  }, {
36096
35462
  key: "getIsAlternateRendering",
@@ -36310,6 +35676,7 @@ var Rendering = /*#__PURE__*/function () {
36310
35676
  return this.catalogData.catalogCodex;
36311
35677
  },
36312
35678
  set: function set(val) {
35679
+ if (!val) return;
36313
35680
  this.catalogData.catalogCodex = val;
36314
35681
  }
36315
35682
  }, {
@@ -36318,6 +35685,7 @@ var Rendering = /*#__PURE__*/function () {
36318
35685
  return this.catalogData.catalogGUID;
36319
35686
  },
36320
35687
  set: function set(val) {
35688
+ if (!val) return;
36321
35689
  this.catalogData.catalogGUID = val;
36322
35690
  }
36323
35691
  }, {
@@ -36341,7 +35709,7 @@ var Rendering = /*#__PURE__*/function () {
36341
35709
  }, {
36342
35710
  key: "HasLayerMask",
36343
35711
  get: function get() {
36344
- return this.hasLayerMask;
35712
+ return !!this.hasLayerMask;
36345
35713
  },
36346
35714
  set: function set(hasLayerMask) {
36347
35715
  this.hasLayerMask = hasLayerMask;
@@ -36349,17 +35717,19 @@ var Rendering = /*#__PURE__*/function () {
36349
35717
  }, {
36350
35718
  key: "RenderWidth",
36351
35719
  get: function get() {
36352
- return this.renderWidth;
35720
+ var _this$renderWidth;
35721
+ return (_this$renderWidth = this.renderWidth) !== null && _this$renderWidth !== void 0 ? _this$renderWidth : 0;
36353
35722
  }
36354
35723
  }, {
36355
35724
  key: "RenderHeight",
36356
35725
  get: function get() {
36357
- return this.renderHeight;
35726
+ var _this$renderHeight;
35727
+ return (_this$renderHeight = this.renderHeight) !== null && _this$renderHeight !== void 0 ? _this$renderHeight : 0;
36358
35728
  }
36359
35729
  }, {
36360
35730
  key: "getHasLayerMask",
36361
35731
  value: function getHasLayerMask() {
36362
- return this.hasLayerMask;
35732
+ return !!this.hasLayerMask;
36363
35733
  }
36364
35734
  }, {
36365
35735
  key: "getLayerMaskForSrc",
@@ -36795,7 +36165,7 @@ var PlannerHandler3D = /*#__PURE__*/function () {
36795
36165
  while (1) switch (_context3.prev = _context3.next) {
36796
36166
  case 0:
36797
36167
  _context3.next = 2;
36798
- return Promise.resolve().then(function () { return require('./Host3DSignalR-d3830717.js'); });
36168
+ return Promise.resolve().then(function () { return require('./Host3DSignalR-600ce869.js'); });
36799
36169
  case 2:
36800
36170
  _yield$import = _context3.sent;
36801
36171
  Host3DSignalR = _yield$import["default"];
@@ -38347,7 +37717,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
38347
37717
  break;
38348
37718
  case 8:
38349
37719
  _context4.next = 10;
38350
- return Promise.resolve().then(function () { return require('./DivaStandardPlanner-c73e6e57.js'); });
37720
+ return Promise.resolve().then(function () { return require('./DivaStandardPlanner-d498cfee.js'); });
38351
37721
  case 10:
38352
37722
  _yield$import = _context4.sent;
38353
37723
  DivaStandardPlanner = _yield$import["default"];
@@ -38358,7 +37728,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
38358
37728
  return _context4.abrupt("break", 21);
38359
37729
  case 15:
38360
37730
  _context4.next = 17;
38361
- return Promise.resolve().then(function () { return require('./DivaBoxPlanner-7b508f32.js'); });
37731
+ return Promise.resolve().then(function () { return require('./DivaBoxPlanner-d7da16a8.js'); });
38362
37732
  case 17:
38363
37733
  _yield$import2 = _context4.sent;
38364
37734
  DivaBoxPlanner = _yield$import2["default"];
@@ -38492,6 +37862,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
38492
37862
  key: "getSetImageAsUrl",
38493
37863
  value: (function () {
38494
37864
  var _getSetImageAsUrl = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee6(setId) {
37865
+ var _rendering$get3DDimIn, _rendering$get3DDimIn2, _rendering$get3DDimIn3;
38495
37866
  var rendering;
38496
37867
  return _regeneratorRuntime__default["default"].wrap(function _callee6$(_context6) {
38497
37868
  while (1) switch (_context6.prev = _context6.next) {
@@ -38504,9 +37875,9 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
38504
37875
  return _context6.abrupt("return", {
38505
37876
  url: rendering === null || rendering === void 0 ? void 0 : rendering.UrlToSavedRendering,
38506
37877
  dimensions: {
38507
- w: rendering === null || rendering === void 0 ? void 0 : rendering.get3DDimInfo().w,
38508
- h: rendering === null || rendering === void 0 ? void 0 : rendering.get3DDimInfo().h,
38509
- d: rendering === null || rendering === void 0 ? void 0 : rendering.get3DDimInfo().d
37878
+ w: ((_rendering$get3DDimIn = rendering === null || rendering === void 0 ? void 0 : rendering.get3DDimInfo().w) !== null && _rendering$get3DDimIn !== void 0 ? _rendering$get3DDimIn : 0) > 0 ? rendering === null || rendering === void 0 ? void 0 : rendering.get3DDimInfo().w : undefined,
37879
+ h: ((_rendering$get3DDimIn2 = rendering === null || rendering === void 0 ? void 0 : rendering.get3DDimInfo().h) !== null && _rendering$get3DDimIn2 !== void 0 ? _rendering$get3DDimIn2 : 0) > 0 ? rendering === null || rendering === void 0 ? void 0 : rendering.get3DDimInfo().h : undefined,
37880
+ d: ((_rendering$get3DDimIn3 = rendering === null || rendering === void 0 ? void 0 : rendering.get3DDimInfo().d) !== null && _rendering$get3DDimIn3 !== void 0 ? _rendering$get3DDimIn3 : 0) > 0 ? rendering === null || rendering === void 0 ? void 0 : rendering.get3DDimInfo().d : undefined
38510
37881
  }
38511
37882
  });
38512
37883
  case 5:
@@ -39503,7 +38874,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39503
38874
  //Do also pass the correct price format
39504
38875
  (_this$actions = _this.actions) === null || _this$actions === void 0 || (_this$actions$toggleL = _this$actions.toggleLoading) === null || _this$actions$toggleL === void 0 || _this$actions$toggleL.call(_this$actions, 'SUMMARY');
39505
38876
  _context2.next = 6;
39506
- return summaryHandlerInstance.getSummaryItems(_this.sets, _this.doConfigure.bind(_this), _this.doAllowSetPlanner());
38877
+ return summaryHandlerInstance.getSummaryItems(_this.sets, _this.doConfigure.bind(_this));
39507
38878
  case 6:
39508
38879
  summaryItems = _context2.sent;
39509
38880
  (_this$updateSummaryIt = _this.updateSummaryItems) === null || _this$updateSummaryIt === void 0 || _this$updateSummaryIt.call(_this, summaryItems, setPriceFormat, summaryHandlerInstance.getSummaryStepWarning(_this.actSet(), summaryItems));
@@ -39588,11 +38959,12 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39588
38959
  _this.updateViewButtonsDependigOnConfigStructure();
39589
38960
  baseArticle = setHandlerInstance.getBaseParentArticleOfAccessoire(set, newArticle.basketId);
39590
38961
  if (!dontUpdateView) (_this$updateElementSe = _this.updateElementSelectionPlanner) === null || _this$updateElementSe === void 0 || _this$updateElementSe.call(_this, [baseArticle.setId], [baseArticle.elementId], true);
39591
- _context3.next = 29;
38962
+ productHandlerInstance.updateProducts(_this.setsAsArray, _this.api, 'onAdd');
38963
+ _context3.next = 30;
39592
38964
  return _this.checkVariantData();
39593
- case 29:
39594
- return _context3.abrupt("return", 'ElementAdded');
39595
38965
  case 30:
38966
+ return _context3.abrupt("return", 'ElementAdded');
38967
+ case 31:
39596
38968
  case "end":
39597
38969
  return _context3.stop();
39598
38970
  }
@@ -39672,8 +39044,10 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39672
39044
  (_this$updateViewPlann3 = _this.updateViewPlannerElements) === null || _this$updateViewPlann3 === void 0 || _this$updateViewPlann3.call(_this, setHandlerInstance.getAllViewPlannerElements(set), setHandlerInstance.getAllVisualiedNotPlannedElements(set));
39673
39045
  _this.updatePlannerView('ADD_ACC_ON_SHELF_PLANNER');
39674
39046
  }
39047
+ productHandlerInstance.updateProducts(_this.setsAsArray, _this.api, 'onShelfAdd');
39048
+ _this.checkVariantData();
39675
39049
  return _context5.abrupt("return", retVal);
39676
- case 8:
39050
+ case 10:
39677
39051
  case "end":
39678
39052
  return _context5.stop();
39679
39053
  }
@@ -39717,7 +39091,9 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39717
39091
  _this.updateViewButtonsDependigOnConfigStructure();
39718
39092
  (_this$updateViewPlann5 = _this.updateViewPlannerElements) === null || _this$updateViewPlann5 === void 0 || _this$updateViewPlann5.call(_this, setHandlerInstance.getAllViewPlannerElements(set), setHandlerInstance.getAllVisualiedNotPlannedElements(set));
39719
39093
  _this.updatePlannerView('DELETE_ACC_ON_SHELF_PLANNER');
39720
- case 9:
39094
+ productHandlerInstance.updateProducts(_this.setsAsArray, _this.api, 'onShelfDelete');
39095
+ _this.checkVariantData();
39096
+ case 11:
39721
39097
  case "end":
39722
39098
  return _context6.stop();
39723
39099
  }
@@ -39775,22 +39151,24 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39775
39151
  _defineProperty__default["default"](this, "updateAccessoireQuantity", /*#__PURE__*/function () {
39776
39152
  var _ref8 = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee8(accessoireItem, relatedToBasketId, newQuantity, forceConfigSingle) {
39777
39153
  var _this$actions11, _this$actions11$toggl, _this$actions12, _this$actions12$toggl;
39778
- var ret;
39154
+ var set, ret;
39779
39155
  return _regeneratorRuntime__default["default"].wrap(function _callee8$(_context8) {
39780
39156
  while (1) switch (_context8.prev = _context8.next) {
39781
39157
  case 0:
39158
+ set = _this.actSet();
39782
39159
  (_this$actions11 = _this.actions) === null || _this$actions11 === void 0 || (_this$actions11$toggl = _this$actions11.toggleLoading) === null || _this$actions11$toggl === void 0 || _this$actions11$toggl.call(_this$actions11, 'LoadingArticles_' + accessoireItem.articleCodex, false, true);
39783
- _context8.next = 3;
39784
- return setHandlerInstance.updateAccessoireQuantity(_this.actSet(), accessoireItem, relatedToBasketId, newQuantity, forceConfigSingle);
39785
- case 3:
39160
+ _context8.next = 4;
39161
+ return setHandlerInstance.updateAccessoireQuantity(set, accessoireItem, relatedToBasketId, newQuantity, forceConfigSingle);
39162
+ case 4:
39786
39163
  ret = _context8.sent;
39787
39164
  (_this$actions12 = _this.actions) === null || _this$actions12 === void 0 || (_this$actions12$toggl = _this$actions12.toggleLoading) === null || _this$actions12$toggl === void 0 || _this$actions12$toggl.call(_this$actions12, 'LoadingArticles_' + accessoireItem.articleCodex, false, false);
39788
39165
  if (ret.somethingChanged) _this.updateConfigStructure();
39789
39166
  _this.updatePlannerView('UPDATE_ACC_QUANTITY');
39790
39167
  _this.updatePriceInView();
39791
39168
  _this.updateViewButtonsDependigOnConfigStructure();
39169
+ productHandlerInstance.updateProducts(_this.setsAsArray, _this.api, 'onAccessoireUpdate');
39792
39170
  _this.checkVariantData();
39793
- case 10:
39171
+ case 12:
39794
39172
  case "end":
39795
39173
  return _context8.stop();
39796
39174
  }
@@ -39818,9 +39196,10 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39818
39196
  _this.updatePriceInView();
39819
39197
  _this.updateViewButtonsDependigOnConfigStructure();
39820
39198
  }
39199
+ productHandlerInstance.updateProducts(_this.setsAsArray, _this.api, 'onAccessoireDelete');
39821
39200
  _this.checkVariantData();
39822
39201
  return _context9.abrupt("return", wasDeleted);
39823
- case 7:
39202
+ case 8:
39824
39203
  case "end":
39825
39204
  return _context9.stop();
39826
39205
  }
@@ -39902,9 +39281,10 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39902
39281
  returnValues = _context11.sent;
39903
39282
  (_this$actions14 = _this.actions) === null || _this$actions14 === void 0 || (_this$actions14$toggl = _this$actions14.toggleLoading) === null || _this$actions14$toggl === void 0 || _this$actions14$toggl.call(_this$actions14, 'doConfigure', false, false);
39904
39283
  structure = setHandlerInstance.loadConfigStructureOfActSet(set, _this.getCurPlannerType());
39284
+ productHandlerInstance.updateProducts(_this.setsAsArray, _this.api, 'onConfig');
39905
39285
  _this.checkVariantData();
39906
39286
  if (dontUpdatePlannerView) {
39907
- _context11.next = 18;
39287
+ _context11.next = 19;
39908
39288
  break;
39909
39289
  }
39910
39290
  _this.updateConfiguratorStructure(structure);
@@ -39918,16 +39298,16 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39918
39298
  _this.updateViewButtonsDependigOnConfigStructure();
39919
39299
  _this.updatePlannerView('DO_CONFIGURE', myValues);
39920
39300
  _this.updateWebConfiguratorTitle();
39921
- _context11.next = 18;
39301
+ _context11.next = 19;
39922
39302
  return _this.getFreePlacesOnGrids(undefined, 'doConfigure');
39923
- case 18:
39303
+ case 19:
39924
39304
  if (dontCallEvents) {
39925
- _context11.next = 21;
39305
+ _context11.next = 22;
39926
39306
  break;
39927
39307
  }
39928
- _context11.next = 21;
39308
+ _context11.next = 22;
39929
39309
  return _this.fillBaksetforOnWebPlanerConfigChange(myValues);
39930
- case 21:
39310
+ case 22:
39931
39311
  case "end":
39932
39312
  return _context11.stop();
39933
39313
  }
@@ -40053,11 +39433,11 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40053
39433
  case 12:
40054
39434
  loadSuccessful = _context13.sent;
40055
39435
  if (!loadSuccessful) {
40056
- _context13.next = 55;
39436
+ _context13.next = 58;
40057
39437
  break;
40058
39438
  }
40059
39439
  if (!(typeof loadSuccessful != 'boolean')) {
40060
- _context13.next = 23;
39440
+ _context13.next = 25;
40061
39441
  break;
40062
39442
  }
40063
39443
  if (!(loadSuccessful.type == 'ProductList')) {
@@ -40074,53 +39454,49 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40074
39454
  (_this$actions15 = this.actions) === null || _this$actions15 === void 0 || (_this$actions15$toggl = _this$actions15.toggleLoading) === null || _this$actions15$toggl === void 0 || _this$actions15$toggl.call(_this$actions15, 'Planner_Loading', false, false);
40075
39455
  return _context13.abrupt("return", true);
40076
39456
  case 23:
40077
- //TODO: get prices of matching product with more than one element
40078
-
40079
- //else if (DivaApiHandler.doCheckForProductsPrice()) {
40080
- // await DivaSetHandler.loadProductsOfSets(
40081
- // this.divaBasketHandler.getOrderSetsByDivaNr(this.divaNr),
40082
- // this.divaBasketHandler.actBasket.SetPlannerInfos?.InvolvedSetIds,
40083
- // );
40084
- //}
40085
-
39457
+ _context13.next = 26;
39458
+ break;
39459
+ case 25:
39460
+ if (this.api.doCheckForProductsPrice()) ;
39461
+ case 26:
40086
39462
  this.divaNr = this.divaBasketHandler.actDivaNr;
40087
39463
  initSetState = this.getInitStateForSet();
40088
39464
  this.plannerHandler.initPlanner(initSetState, this.getPlannerHandlerFunctions());
40089
- _context13.next = 28;
39465
+ _context13.next = 31;
40090
39466
  return setHandlerInstance.initSetsByOrderSet(this.divaBasketHandler.getOrderSetsByDivaNr(this.divaNr), initSetState);
40091
- case 28:
39467
+ case 31:
40092
39468
  set = this.actSet();
40093
39469
  if (!((_initSetState$api$web = initSetState.api.webConfig) !== null && _initSetState$api$web !== void 0 && _initSetState$api$web.checkForProductsPrice)) {
40094
- _context13.next = 40;
39470
+ _context13.next = 43;
40095
39471
  break;
40096
39472
  }
40097
39473
  if (!(typeof loadSuccessful != 'boolean' && loadSuccessful.type == 'ProductId')) {
40098
- _context13.next = 35;
39474
+ _context13.next = 38;
40099
39475
  break;
40100
39476
  }
40101
39477
  products = loadSuccessful;
40102
39478
  set === null || set === void 0 || set.remindPriceForHash(products);
40103
- _context13.next = 40;
39479
+ _context13.next = 43;
40104
39480
  break;
40105
- case 35:
39481
+ case 38:
40106
39482
  if (!this.divaBasketHandler.actBasket.OrigProductId) {
40107
- _context13.next = 40;
39483
+ _context13.next = 43;
40108
39484
  break;
40109
39485
  }
40110
- _context13.next = 38;
39486
+ _context13.next = 41;
40111
39487
  return this.divaBasketHandler.getProduct(this.api, this.divaBasketHandler.actBasket.OrigProductId);
40112
- case 38:
39488
+ case 41:
40113
39489
  result = _context13.sent;
40114
39490
  if (result) {
40115
39491
  set === null || set === void 0 || set.remindPriceForHash(result);
40116
39492
  }
40117
- case 40:
40118
- _context13.next = 42;
39493
+ case 43:
39494
+ _context13.next = 45;
40119
39495
  return viewReadyPromise;
40120
- case 42:
40121
- _context13.next = 44;
39496
+ case 45:
39497
+ _context13.next = 47;
40122
39498
  return this.initView();
40123
- case 44:
39499
+ case 47:
40124
39500
  (_this$actions16 = this.actions) === null || _this$actions16 === void 0 || _this$actions16.onEvent({
40125
39501
  type: 'onConfiguratorReady'
40126
39502
  });
@@ -40144,11 +39520,11 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40144
39520
  divaNr: basket.DivaNr,
40145
39521
  documentVersion: basket.DocumentVersion.toString()
40146
39522
  });
40147
- _context13.next = 52;
39523
+ _context13.next = 55;
40148
39524
  return this.fillBaksetforOnWebPlanerConfigChange(undefined, true);
40149
- case 52:
40150
- return _context13.abrupt("return", true);
40151
39525
  case 55:
39526
+ return _context13.abrupt("return", true);
39527
+ case 58:
40152
39528
  this.onInitializationError();
40153
39529
  //fehler beim laden vom basket..
40154
39530
  LOG$1.errorTransaction('LOADING_BASKET', 'BASKET_0002', 'Fehler beim Laden des Baskets', {
@@ -40166,7 +39542,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40166
39542
  plannerMode: this.getCurImageMode(),*/
40167
39543
  });
40168
39544
  return _context13.abrupt("return", false);
40169
- case 58:
39545
+ case 61:
40170
39546
  case "end":
40171
39547
  return _context13.stop();
40172
39548
  }
@@ -40328,7 +39704,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40328
39704
  break;
40329
39705
  }
40330
39706
  (_this$initConfigurato = this.initConfiguratorStructure) === null || _this$initConfigurato === void 0 || _this$initConfigurato.call(this, setHandlerInstance.loadConfigStructureForOnlyProductsList());
40331
- _context15.next = 17;
39707
+ _context15.next = 18;
40332
39708
  break;
40333
39709
  case 7:
40334
39710
  _context15.next = 9;
@@ -40343,11 +39719,12 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40343
39719
  (_this$updateViewPlann9 = this.updateViewPlannerElements) === null || _this$updateViewPlann9 === void 0 || _this$updateViewPlann9.call(this, setHandlerInstance.getAllViewPlannerElements(set), setHandlerInstance.getAllVisualiedNotPlannedElements(set), set.getSetId(), set.firstElementId);
40344
39720
  this.updatePlannerView('INIT_VIEW');
40345
39721
  this.onBasketInitialized();
39722
+ productHandlerInstance.updateProducts(this.setsAsArray, this.api, 'onInit');
40346
39723
  this.checkVariantData();
40347
- case 17:
40348
- _context15.next = 19;
39724
+ case 18:
39725
+ _context15.next = 20;
40349
39726
  return this.runInitMode(plannerMode);
40350
- case 19:
39727
+ case 20:
40351
39728
  case "end":
40352
39729
  return _context15.stop();
40353
39730
  }
@@ -40446,31 +39823,32 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40446
39823
  i = 0;
40447
39824
  case 8:
40448
39825
  if (!(i < orderSets.length)) {
40449
- _context17.next = 23;
39826
+ _context17.next = 24;
40450
39827
  break;
40451
39828
  }
40452
39829
  orderset = orderSets[i];
40453
39830
  lastSetToInitialize = setHandlerInstance.getOrderSetShouldInitPlanner(orderSets, i);
40454
39831
  loadedSet = setHandlerInstance.findLoadedSet(this.sets, orderset.CatalogCodex, orderset.AccountGUID);
40455
39832
  if (!loadedSet) {
40456
- _context17.next = 17;
39833
+ _context17.next = 18;
40457
39834
  break;
40458
39835
  }
40459
39836
  _context17.next = 15;
40460
39837
  return setHandlerInstance.addOrderSetArticlesToExistingSet(loadedSet, orderset, lastSetToInitialize);
40461
39838
  case 15:
40462
- _context17.next = 19;
39839
+ productHandlerInstance.updateProducts(this.setsAsArray, this.api, 'onAdd');
39840
+ _context17.next = 20;
40463
39841
  break;
40464
- case 17:
40465
- _context17.next = 19;
39842
+ case 18:
39843
+ _context17.next = 20;
40466
39844
  return setHandlerInstance.initSet(orderset, this.getInitStateForSet(), lastSetToInitialize);
40467
- case 19:
40468
- this.cleanUpEmptySets(true);
40469
39845
  case 20:
39846
+ this.cleanUpEmptySets(true);
39847
+ case 21:
40470
39848
  i++;
40471
39849
  _context17.next = 8;
40472
39850
  break;
40473
- case 23:
39851
+ case 24:
40474
39852
  this.divaBasketHandler.actBasket.OrderSets = [];
40475
39853
  this.updatePriceInView();
40476
39854
  this.updateWebConfiguratorTitle();
@@ -40478,7 +39856,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40478
39856
  (_this$updateViewPlann10 = this.updateViewPlannerElements) === null || _this$updateViewPlann10 === void 0 || _this$updateViewPlann10.call(this, setHandlerInstance.getAllViewPlannerElements(set), setHandlerInstance.getAllVisualiedNotPlannedElements(set));
40479
39857
  articlesKeys = Object.keys(this.actSet().getDivaArticles());
40480
39858
  this.loadPaletteInfos(undefined, [articlesKeys[0]], articlesKeys);
40481
- case 30:
39859
+ case 31:
40482
39860
  case "end":
40483
39861
  return _context17.stop();
40484
39862
  }
@@ -40489,37 +39867,6 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40489
39867
  }
40490
39868
  return addSetToActPlanningByDivaNr;
40491
39869
  }()
40492
- }, {
40493
- key: "initProductId",
40494
- value: function () {
40495
- var _initProductId = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee18(productId) {
40496
- var loadSuccessful;
40497
- return _regeneratorRuntime__default["default"].wrap(function _callee18$(_context18) {
40498
- while (1) switch (_context18.prev = _context18.next) {
40499
- case 0:
40500
- _context18.next = 2;
40501
- return this.divaBasketHandler.initProductId(this.api, productId, true);
40502
- case 2:
40503
- loadSuccessful = _context18.sent;
40504
- if (!(typeof loadSuccessful != 'boolean')) {
40505
- _context18.next = 6;
40506
- break;
40507
- }
40508
- setHandlerInstance.addProducts([loadSuccessful], []);
40509
- return _context18.abrupt("return", loadSuccessful.divaNr);
40510
- case 6:
40511
- return _context18.abrupt("return", false);
40512
- case 7:
40513
- case "end":
40514
- return _context18.stop();
40515
- }
40516
- }, _callee18, this);
40517
- }));
40518
- function initProductId(_x49) {
40519
- return _initProductId.apply(this, arguments);
40520
- }
40521
- return initProductId;
40522
- }()
40523
39870
  }, {
40524
39871
  key: "cleanUpEmptySets",
40525
39872
  value: function cleanUpEmptySets(ignoreActSet) {
@@ -40548,28 +39895,28 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40548
39895
  }, {
40549
39896
  key: "setActSetCurConfigStepKey",
40550
39897
  value: function () {
40551
- var _setActSetCurConfigStepKey = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee19(curConfigStepKey) {
39898
+ var _setActSetCurConfigStepKey = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee18(curConfigStepKey) {
40552
39899
  var set;
40553
- return _regeneratorRuntime__default["default"].wrap(function _callee19$(_context19) {
40554
- while (1) switch (_context19.prev = _context19.next) {
39900
+ return _regeneratorRuntime__default["default"].wrap(function _callee18$(_context18) {
39901
+ while (1) switch (_context18.prev = _context18.next) {
40555
39902
  case 0:
40556
39903
  set = this.actSet();
40557
39904
  if (set) {
40558
- _context19.next = 3;
39905
+ _context18.next = 3;
40559
39906
  break;
40560
39907
  }
40561
- return _context19.abrupt("return");
39908
+ return _context18.abrupt("return");
40562
39909
  case 3:
40563
39910
  set.ActConfigStepKey = curConfigStepKey;
40564
- _context19.next = 6;
39911
+ _context18.next = 6;
40565
39912
  return setHandlerInstance.updateNavigation(set);
40566
39913
  case 6:
40567
39914
  case "end":
40568
- return _context19.stop();
39915
+ return _context18.stop();
40569
39916
  }
40570
- }, _callee19, this);
39917
+ }, _callee18, this);
40571
39918
  }));
40572
- function setActSetCurConfigStepKey(_x50) {
39919
+ function setActSetCurConfigStepKey(_x49) {
40573
39920
  return _setActSetCurConfigStepKey.apply(this, arguments);
40574
39921
  }
40575
39922
  return setActSetCurConfigStepKey;
@@ -40708,17 +40055,17 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40708
40055
  }, {
40709
40056
  key: "deletePlannerElement",
40710
40057
  value: function () {
40711
- var _deletePlannerElement = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee20(setId, elementId, denyElementSelectionClear) {
40058
+ var _deletePlannerElement = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee19(setId, elementId, denyElementSelectionClear) {
40712
40059
  var _this$updateViewPlann11;
40713
40060
  var set, result, _this$updateElementSe5, _this$updateElementSe6;
40714
- return _regeneratorRuntime__default["default"].wrap(function _callee20$(_context20) {
40715
- while (1) switch (_context20.prev = _context20.next) {
40061
+ return _regeneratorRuntime__default["default"].wrap(function _callee19$(_context19) {
40062
+ while (1) switch (_context19.prev = _context19.next) {
40716
40063
  case 0:
40717
40064
  set = this.sets[setId];
40718
- _context20.next = 3;
40065
+ _context19.next = 3;
40719
40066
  return setHandlerInstance.deleteElementFromSetByElemId(set, elementId, true);
40720
40067
  case 3:
40721
- result = _context20.sent;
40068
+ result = _context19.sent;
40722
40069
  this.updateConfigStructure();
40723
40070
  (_this$updateViewPlann11 = this.updateViewPlannerElements) === null || _this$updateViewPlann11 === void 0 || _this$updateViewPlann11.call(this, setHandlerInstance.getAllViewPlannerElements(set), setHandlerInstance.getAllVisualiedNotPlannedElements(set));
40724
40071
  this.updatePlannerView('DELETE_PLANNER_ELEMENT');
@@ -40728,16 +40075,17 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40728
40075
  if (result.selectElementId) (_this$updateElementSe5 = this.updateElementSelectionPlanner) === null || _this$updateElementSe5 === void 0 || _this$updateElementSe5.call(this, [result.setId], [result.selectElementId], true);else (_this$updateElementSe6 = this.updateElementSelectionPlanner) === null || _this$updateElementSe6 === void 0 || _this$updateElementSe6.call(this, [], [], true);
40729
40076
  }
40730
40077
  this.updatePriceInView();
40078
+ productHandlerInstance.updateProducts(this.setsAsArray, this.api, 'onDelete');
40731
40079
  this.checkVariantData();
40732
- _context20.next = 14;
40080
+ _context19.next = 15;
40733
40081
  return this.getFreePlacesOnGrids(undefined, 'deleteElement');
40734
- case 14:
40082
+ case 15:
40735
40083
  case "end":
40736
- return _context20.stop();
40084
+ return _context19.stop();
40737
40085
  }
40738
- }, _callee20, this);
40086
+ }, _callee19, this);
40739
40087
  }));
40740
- function deletePlannerElement(_x51, _x52, _x53) {
40088
+ function deletePlannerElement(_x50, _x51, _x52) {
40741
40089
  return _deletePlannerElement.apply(this, arguments);
40742
40090
  }
40743
40091
  return deletePlannerElement;
@@ -40751,17 +40099,17 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40751
40099
  }, {
40752
40100
  key: "copyPlannerElement",
40753
40101
  value: (function () {
40754
- var _copyPlannerElement = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee21(setId, elementId, curConfigKey, copyInfo) {
40102
+ var _copyPlannerElement = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee20(setId, elementId, curConfigKey, copyInfo) {
40755
40103
  var _this$updateViewPlann12;
40756
40104
  var set, newSelectedArticle, newConfigStepKey, _this$updateElementSe7, baseArticle;
40757
- return _regeneratorRuntime__default["default"].wrap(function _callee21$(_context21) {
40758
- while (1) switch (_context21.prev = _context21.next) {
40105
+ return _regeneratorRuntime__default["default"].wrap(function _callee20$(_context20) {
40106
+ while (1) switch (_context20.prev = _context20.next) {
40759
40107
  case 0:
40760
40108
  set = this.sets[setId];
40761
- _context21.next = 3;
40109
+ _context20.next = 3;
40762
40110
  return setHandlerInstance.copyPlannerElement(set, elementId, copyInfo);
40763
40111
  case 3:
40764
- newSelectedArticle = _context21.sent;
40112
+ newSelectedArticle = _context20.sent;
40765
40113
  this.updateConfigStructure();
40766
40114
  (_this$updateViewPlann12 = this.updateViewPlannerElements) === null || _this$updateViewPlann12 === void 0 || _this$updateViewPlann12.call(this, setHandlerInstance.getAllViewPlannerElements(set), setHandlerInstance.getAllVisualiedNotPlannedElements(set));
40767
40115
  this.updatePlannerView('COPY_PLANNER_ELEMENT');
@@ -40774,17 +40122,18 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40774
40122
  baseArticle = setHandlerInstance.getBaseParentArticleOfAccessoire(set, newSelectedArticle.basketId);
40775
40123
  (_this$updateElementSe7 = this.updateElementSelectionPlanner) === null || _this$updateElementSe7 === void 0 || _this$updateElementSe7.call(this, [baseArticle.setId], [baseArticle.elementId], true);
40776
40124
  }
40777
- _context21.next = 13;
40125
+ productHandlerInstance.updateProducts(this.setsAsArray, this.api, 'onCopy');
40126
+ _context20.next = 14;
40778
40127
  return this.checkVariantData();
40779
- case 13:
40780
- return _context21.abrupt("return", newConfigStepKey);
40781
40128
  case 14:
40129
+ return _context20.abrupt("return", newConfigStepKey);
40130
+ case 15:
40782
40131
  case "end":
40783
- return _context21.stop();
40132
+ return _context20.stop();
40784
40133
  }
40785
- }, _callee21, this);
40134
+ }, _callee20, this);
40786
40135
  }));
40787
- function copyPlannerElement(_x54, _x55, _x56, _x57) {
40136
+ function copyPlannerElement(_x53, _x54, _x55, _x56) {
40788
40137
  return _copyPlannerElement.apply(this, arguments);
40789
40138
  }
40790
40139
  return copyPlannerElement;
@@ -40813,33 +40162,33 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40813
40162
  }, {
40814
40163
  key: "getFreePlacesOnGrids",
40815
40164
  value: function () {
40816
- var _getFreePlacesOnGrids = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee22(gridGroup, from) {
40165
+ var _getFreePlacesOnGrids = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee21(gridGroup, from) {
40817
40166
  var _this$updateFreePlace;
40818
40167
  var set, freeShelfGrids, plannedShelfGrids;
40819
- return _regeneratorRuntime__default["default"].wrap(function _callee22$(_context22) {
40820
- while (1) switch (_context22.prev = _context22.next) {
40168
+ return _regeneratorRuntime__default["default"].wrap(function _callee21$(_context21) {
40169
+ while (1) switch (_context21.prev = _context21.next) {
40821
40170
  case 0:
40822
40171
  set = this.actSet();
40823
40172
  if (set) {
40824
- _context22.next = 3;
40173
+ _context21.next = 3;
40825
40174
  break;
40826
40175
  }
40827
40176
  throw new Error('getFreePlacesOnGrids: act set is not defined!');
40828
40177
  case 3:
40829
40178
  if (!gridGroup) {
40830
- _context22.next = 9;
40179
+ _context21.next = 9;
40831
40180
  break;
40832
40181
  }
40833
- _context22.next = 6;
40182
+ _context21.next = 6;
40834
40183
  return setHandlerInstance.getFreeShelfGrids(set, gridGroup);
40835
40184
  case 6:
40836
- _context22.t0 = _context22.sent;
40837
- _context22.next = 10;
40185
+ _context21.t0 = _context21.sent;
40186
+ _context21.next = 10;
40838
40187
  break;
40839
40188
  case 9:
40840
- _context22.t0 = undefined;
40189
+ _context21.t0 = undefined;
40841
40190
  case 10:
40842
- freeShelfGrids = _context22.t0;
40191
+ freeShelfGrids = _context21.t0;
40843
40192
  plannedShelfGrids = setHandlerInstance.getPlannedShelfGrids(set);
40844
40193
  LOG$1.debug('TOULA', 'freeShelfGrids', freeShelfGrids, 'plannedShelfGrids', plannedShelfGrids);
40845
40194
  LOG$1.debug('update free from: ' + from, 'freeShelfGrids', freeShelfGrids, 'plannedShelfGrids', plannedShelfGrids);
@@ -40847,17 +40196,17 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40847
40196
  freeShelfGrids: freeShelfGrids,
40848
40197
  plannedShelfGrids: plannedShelfGrids
40849
40198
  });
40850
- return _context22.abrupt("return", {
40199
+ return _context21.abrupt("return", {
40851
40200
  freeShelfGrids: freeShelfGrids,
40852
40201
  plannedShelfGrids: plannedShelfGrids
40853
40202
  });
40854
40203
  case 16:
40855
40204
  case "end":
40856
- return _context22.stop();
40205
+ return _context21.stop();
40857
40206
  }
40858
- }, _callee22, this);
40207
+ }, _callee21, this);
40859
40208
  }));
40860
- function getFreePlacesOnGrids(_x58, _x59) {
40209
+ function getFreePlacesOnGrids(_x57, _x58) {
40861
40210
  return _getFreePlacesOnGrids.apply(this, arguments);
40862
40211
  }
40863
40212
  return getFreePlacesOnGrids;
@@ -40874,36 +40223,36 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40874
40223
  }, {
40875
40224
  key: "moveShelfItemToGrid",
40876
40225
  value: function () {
40877
- var _moveShelfItemToGrid = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee23(accessoireBasketId, parentBasketId, gridName, cellIndex) {
40226
+ var _moveShelfItemToGrid = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee22(accessoireBasketId, parentBasketId, gridName, cellIndex) {
40878
40227
  var set, newGridId;
40879
- return _regeneratorRuntime__default["default"].wrap(function _callee23$(_context23) {
40880
- while (1) switch (_context23.prev = _context23.next) {
40228
+ return _regeneratorRuntime__default["default"].wrap(function _callee22$(_context22) {
40229
+ while (1) switch (_context22.prev = _context22.next) {
40881
40230
  case 0:
40882
40231
  set = this.actSet();
40883
40232
  if (set) {
40884
- _context23.next = 3;
40233
+ _context22.next = 3;
40885
40234
  break;
40886
40235
  }
40887
- return _context23.abrupt("return");
40236
+ return _context22.abrupt("return");
40888
40237
  case 3:
40889
- _context23.next = 5;
40238
+ _context22.next = 5;
40890
40239
  return setHandlerInstance.moveShelfItemToGrid(set, accessoireBasketId, parentBasketId, gridName, cellIndex);
40891
40240
  case 5:
40892
- newGridId = _context23.sent;
40241
+ newGridId = _context22.sent;
40893
40242
  this.updatePlannerView('MOVE_SHELF_ITEM');
40894
40243
  if (!newGridId) {
40895
- _context23.next = 10;
40244
+ _context22.next = 10;
40896
40245
  break;
40897
40246
  }
40898
- _context23.next = 10;
40247
+ _context22.next = 10;
40899
40248
  return this.getFreePlacesOnGrids(newGridId, 'move shelf');
40900
40249
  case 10:
40901
40250
  case "end":
40902
- return _context23.stop();
40251
+ return _context22.stop();
40903
40252
  }
40904
- }, _callee23, this);
40253
+ }, _callee22, this);
40905
40254
  }));
40906
- function moveShelfItemToGrid(_x60, _x61, _x62, _x63) {
40255
+ function moveShelfItemToGrid(_x59, _x60, _x61, _x62) {
40907
40256
  return _moveShelfItemToGrid.apply(this, arguments);
40908
40257
  }
40909
40258
  return moveShelfItemToGrid;
@@ -40911,27 +40260,27 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40911
40260
  }, {
40912
40261
  key: "resetArticle",
40913
40262
  value: function () {
40914
- var _resetArticle = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee24(basketId) {
40263
+ var _resetArticle = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee23(basketId) {
40915
40264
  var set;
40916
- return _regeneratorRuntime__default["default"].wrap(function _callee24$(_context24) {
40917
- while (1) switch (_context24.prev = _context24.next) {
40265
+ return _regeneratorRuntime__default["default"].wrap(function _callee23$(_context23) {
40266
+ while (1) switch (_context23.prev = _context23.next) {
40918
40267
  case 0:
40919
40268
  set = this.actSet();
40920
40269
  if (set) {
40921
- _context24.next = 3;
40270
+ _context23.next = 3;
40922
40271
  break;
40923
40272
  }
40924
- return _context24.abrupt("return");
40273
+ return _context23.abrupt("return");
40925
40274
  case 3:
40926
- _context24.next = 5;
40275
+ _context23.next = 5;
40927
40276
  return setHandlerInstance.resetArticle(set, basketId);
40928
40277
  case 5:
40929
40278
  case "end":
40930
- return _context24.stop();
40279
+ return _context23.stop();
40931
40280
  }
40932
- }, _callee24, this);
40281
+ }, _callee23, this);
40933
40282
  }));
40934
- function resetArticle(_x64) {
40283
+ function resetArticle(_x63) {
40935
40284
  return _resetArticle.apply(this, arguments);
40936
40285
  }
40937
40286
  return resetArticle;
@@ -40939,27 +40288,27 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40939
40288
  }, {
40940
40289
  key: "checkVariantData",
40941
40290
  value: function () {
40942
- var _checkVariantData = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee25() {
40291
+ var _checkVariantData = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee24() {
40943
40292
  var somethingChanged;
40944
- return _regeneratorRuntime__default["default"].wrap(function _callee25$(_context25) {
40945
- while (1) switch (_context25.prev = _context25.next) {
40293
+ return _regeneratorRuntime__default["default"].wrap(function _callee24$(_context24) {
40294
+ while (1) switch (_context24.prev = _context24.next) {
40946
40295
  case 0:
40947
40296
  if (!this.api.getDoCheckVariantData()) {
40948
- _context25.next = 5;
40297
+ _context24.next = 5;
40949
40298
  break;
40950
40299
  }
40951
- _context25.next = 3;
40300
+ _context24.next = 3;
40952
40301
  return setHandlerInstance.checkVariantData(this.actSet());
40953
40302
  case 3:
40954
- somethingChanged = _context25.sent;
40303
+ somethingChanged = _context24.sent;
40955
40304
  if (somethingChanged) {
40956
40305
  this.updatePriceInView();
40957
40306
  }
40958
40307
  case 5:
40959
40308
  case "end":
40960
- return _context25.stop();
40309
+ return _context24.stop();
40961
40310
  }
40962
- }, _callee25, this);
40311
+ }, _callee24, this);
40963
40312
  }));
40964
40313
  function checkVariantData() {
40965
40314
  return _checkVariantData.apply(this, arguments);
@@ -41055,7 +40404,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41055
40404
  }, {
41056
40405
  key: "saveToBasketWrapper",
41057
40406
  value: function () {
41058
- var _saveToBasketWrapper = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee26(event, repairOnly, force) {
40407
+ var _saveToBasketWrapper = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee25(event, repairOnly, force) {
41059
40408
  var _this$actions25,
41060
40409
  _this$actions25$toggl,
41061
40410
  _this$actions26,
@@ -41063,48 +40412,46 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41063
40412
  _this2 = this,
41064
40413
  _this$actions30,
41065
40414
  _this$i18n14;
41066
- var returnTo, finalEvent, _this$api$getBarrierC, _this$openLeafeltBarr, product, _result, result, _this$actions27, _this$i18n8, _this$i18n9, _this$actions28, _this$i18n10, _this$i18n11, _this$actions29, _this$i18n12, _this$i18n13, _this$updatePlannerMs2, _this$actions31, _this$i18n15;
41067
- return _regeneratorRuntime__default["default"].wrap(function _callee26$(_context26) {
41068
- while (1) switch (_context26.prev = _context26.next) {
40415
+ var returnTo, finalEvent, _this$api$getBarrierC, _this$openLeafeltBarr, product, result, _this$actions27, _this$i18n8, _this$i18n9, _this$actions28, _this$i18n10, _this$i18n11, _this$actions29, _this$i18n12, _this$i18n13, _this$updatePlannerMs2;
40416
+ return _regeneratorRuntime__default["default"].wrap(function _callee25$(_context25) {
40417
+ while (1) switch (_context25.prev = _context25.next) {
41069
40418
  case 0:
41070
40419
  returnTo = this.getReturnTo(event);
41071
40420
  finalEvent = event;
41072
40421
  if (!(returnTo == 'OPEN_LEAFLET_BARRIER')) {
41073
- _context26.next = 16;
40422
+ _context25.next = 14;
41074
40423
  break;
41075
40424
  }
41076
40425
  product = undefined;
41077
40426
  if (!((_this$api$getBarrierC = this.api.getBarrierConfig()) !== null && _this$api$getBarrierC !== void 0 && _this$api$getBarrierC.affiliate)) {
41078
- _context26.next = 10;
40427
+ _context25.next = 8;
41079
40428
  break;
41080
40429
  }
41081
- _context26.next = 7;
40430
+ _context25.next = 7;
41082
40431
  return this.api.getDataCache(this.api.getCatalogProductUrl(this.actSet().getCatalogCodex()), undefined, undefined, 'catalog');
41083
40432
  case 7:
41084
- _result = _context26.sent;
41085
- productHandlerInstance.addProducts(_result, []);
41086
- product = productHandlerInstance.getBestMatch(this.getDivaArticles());
41087
- case 10:
41088
- _context26.next = 12;
40433
+ _context25.sent;
40434
+ case 8:
40435
+ _context25.next = 10;
41089
40436
  return (_this$openLeafeltBarr = this.openLeafeltBarrier) === null || _this$openLeafeltBarr === void 0 ? void 0 : _this$openLeafeltBarr.call(this, this.divaBasketHandler, this.api.getBarrierConfig(), product);
41090
- case 12:
41091
- finalEvent = _context26.sent;
40437
+ case 10:
40438
+ finalEvent = _context25.sent;
41092
40439
  if (finalEvent) {
41093
- _context26.next = 15;
40440
+ _context25.next = 13;
41094
40441
  break;
41095
40442
  }
41096
- return _context26.abrupt("return", 'canceled');
41097
- case 15:
40443
+ return _context25.abrupt("return", 'canceled');
40444
+ case 13:
41098
40445
  returnTo = finalEvent == 'onAddToBasket' ? 'OPEN_PDF' : returnTo;
41099
- case 16:
40446
+ case 14:
41100
40447
  (_this$actions25 = this.actions) === null || _this$actions25 === void 0 || (_this$actions25$toggl = _this$actions25.toggleLoading) === null || _this$actions25$toggl === void 0 || _this$actions25$toggl.call(_this$actions25, 'Planner_Saving', false, true);
41101
- _context26.next = 19;
40448
+ _context25.next = 17;
41102
40449
  return this.saveToBasket(finalEvent, repairOnly, force);
41103
- case 19:
41104
- result = _context26.sent;
40450
+ case 17:
40451
+ result = _context25.sent;
41105
40452
  (_this$actions26 = this.actions) === null || _this$actions26 === void 0 || (_this$actions26$toggl = _this$actions26.toggleLoading) === null || _this$actions26$toggl === void 0 || _this$actions26$toggl.call(_this$actions26, 'Planner_Saving', false, false);
41106
40453
  if (!(result === 'canceled')) {
41107
- _context26.next = 25;
40454
+ _context25.next = 23;
41108
40455
  break;
41109
40456
  }
41110
40457
  LOG$1.error(new DivaUtils.DivaError('failed to save Basket'));
@@ -41112,12 +40459,12 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41112
40459
  text: ((_this$i18n8 = this.i18n()) === null || _this$i18n8 === void 0 ? void 0 : _this$i18n8.t('modal.general_error')) + ' --- ' + DivaUtils__default["default"].formatDate(new Date(), true, undefined, true) + ' --- ' + DivaUtils__default["default"].getCurrentTraceId() ? ((_this$i18n9 = this.i18n()) === null || _this$i18n9 === void 0 ? void 0 : _this$i18n9.t('modal.errorcode')) + ': ' + DivaUtils__default["default"].getCurrentTraceId() : '',
41113
40460
  accept: true
41114
40461
  });
41115
- return _context26.abrupt("return", result);
41116
- case 25:
41117
- _context26.t0 = returnTo;
41118
- _context26.next = _context26.t0 === 'OPEN_PDF' ? 28 : _context26.t0 === 'SAVE_BASKET_WITH_MODAL' ? 30 : 31;
40462
+ return _context25.abrupt("return", result);
40463
+ case 23:
40464
+ _context25.t0 = returnTo;
40465
+ _context25.next = _context25.t0 === 'OPEN_PDF' ? 26 : _context25.t0 === 'SAVE_BASKET_WITH_MODAL' ? 28 : 29;
41119
40466
  break;
41120
- case 28:
40467
+ case 26:
41121
40468
  if (!this.getBasket().PDFDocumentURL) {
41122
40469
  LOG$1.error(new DivaUtils.DivaError('PDF url is missing in basket', {
41123
40470
  code: 'WC_0010'
@@ -41135,39 +40482,28 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41135
40482
  }
41136
40483
  });
41137
40484
  }
41138
- return _context26.abrupt("break", 31);
41139
- case 30:
40485
+ return _context25.abrupt("break", 29);
40486
+ case 28:
41140
40487
  (_this$actions30 = this.actions) === null || _this$actions30 === void 0 || _this$actions30.openModal({
41141
40488
  text: (_this$i18n14 = this.i18n()) === null || _this$i18n14 === void 0 ? void 0 : _this$i18n14.t('modal.planning_saved'),
41142
40489
  accept: true
41143
40490
  });
41144
- case 31:
40491
+ case 29:
41145
40492
  if (!(result == 'noArticleToSave')) {
41146
- _context26.next = 34;
40493
+ _context25.next = 32;
41147
40494
  break;
41148
40495
  }
41149
40496
  (_this$updatePlannerMs2 = this.updatePlannerMsgContainer) === null || _this$updatePlannerMs2 === void 0 || _this$updatePlannerMs2.call(this, 'NOTHING_TO_SAVE', true, 'INFO', 'NOTHING_TO_SAVE', true);
41150
- return _context26.abrupt("return", 'canceled');
41151
- case 34:
41152
- if (!(result == 'payloadToBig')) {
41153
- _context26.next = 37;
41154
- break;
41155
- }
41156
- (_this$actions31 = this.actions) === null || _this$actions31 === void 0 || _this$actions31.openModal({
41157
- accept: true,
41158
- text: (_this$i18n15 = this.i18n()) === null || _this$i18n15 === void 0 ? void 0 : _this$i18n15.t('configurator.PAYLOAD_TO_BIG'),
41159
- title: 'modals.error_saving'
41160
- });
41161
- return _context26.abrupt("return", 'canceled');
41162
- case 37:
41163
- return _context26.abrupt("return", result);
41164
- case 38:
40497
+ return _context25.abrupt("return", 'canceled');
40498
+ case 32:
40499
+ return _context25.abrupt("return", result);
40500
+ case 33:
41165
40501
  case "end":
41166
- return _context26.stop();
40502
+ return _context25.stop();
41167
40503
  }
41168
- }, _callee26, this);
40504
+ }, _callee25, this);
41169
40505
  }));
41170
- function saveToBasketWrapper(_x65, _x66, _x67) {
40506
+ function saveToBasketWrapper(_x64, _x65, _x66) {
41171
40507
  return _saveToBasketWrapper.apply(this, arguments);
41172
40508
  }
41173
40509
  return saveToBasketWrapper;
@@ -41175,51 +40511,36 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41175
40511
  }, {
41176
40512
  key: "saveToBasket",
41177
40513
  value: function () {
41178
- var _saveToBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee27(event, repairOnly, force) {
41179
- var _returnTo, _event, _event2, _event3, _returnTo2, _returnTo3, _this$actions32, _this$actions33;
41180
- var set, actBasket, returnTo, oldReturnTo, count, basketData, bytes, result, newDivaNr, _result2, _event4, product;
41181
- return _regeneratorRuntime__default["default"].wrap(function _callee27$(_context27) {
41182
- while (1) switch (_context27.prev = _context27.next) {
40514
+ var _saveToBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee26(event, repairOnly, force) {
40515
+ var _returnTo, _event, _event2, _event3, _returnTo2, _returnTo3, _this$actions31, _this$actions32, _this$actions33;
40516
+ var set, actBasket, returnTo, oldReturnTo, result, newDivaNr, _result2, _event4, product;
40517
+ return _regeneratorRuntime__default["default"].wrap(function _callee26$(_context26) {
40518
+ while (1) switch (_context26.prev = _context26.next) {
41183
40519
  case 0:
41184
40520
  set = this.actSet();
41185
40521
  if (!(setHandlerInstance.isNoArticleToSave(this.sets) && !force)) {
41186
- _context27.next = 3;
40522
+ _context26.next = 3;
41187
40523
  break;
41188
40524
  }
41189
- return _context27.abrupt("return", 'noArticleToSave');
40525
+ return _context26.abrupt("return", 'noArticleToSave');
41190
40526
  case 3:
41191
40527
  actBasket = this.divaBasketHandler.actBasket;
41192
40528
  returnTo = this.getReturnTo(event);
41193
40529
  if (!((_returnTo = returnTo) !== null && _returnTo !== void 0 && _returnTo.startsWith('FAVORITS') && favoritesHandlerInstance.FavoritesDefined(set))) {
41194
- _context27.next = 22;
40530
+ _context26.next = 13;
41195
40531
  break;
41196
40532
  }
41197
40533
  oldReturnTo = returnTo;
41198
40534
  this.ReturnTo = returnTo.replace('FAVORITS_', '');
41199
- _context27.next = 10;
41200
- return this.getValidVariantsLength();
41201
- case 10:
41202
- count = _context27.sent;
41203
- _context27.next = 13;
41204
- return setHandlerInstance.fillOrderLinesAndOrderSets(this.sets, this.divaBasketHandler, !!repairOnly, this.doAllowSetPlanner(), this.ReturnTo);
41205
- case 13:
41206
- basketData = _context27.sent;
41207
- bytes = new TextEncoder().encode(JSON.stringify(basketData.getAsJson())).length;
41208
- if (!(bytes * count > 15000000)) {
41209
- _context27.next = 17;
41210
- break;
41211
- }
41212
- return _context27.abrupt("return", 'payloadToBig');
41213
- case 17:
41214
- _context27.next = 19;
40535
+ _context26.next = 10;
41215
40536
  return this.handleFavorites('SAVE');
41216
- case 19:
41217
- result = _context27.sent;
40537
+ case 10:
40538
+ result = _context26.sent;
41218
40539
  if (result === 'canceled') {
41219
40540
  this.ReturnTo = oldReturnTo;
41220
40541
  }
41221
- return _context27.abrupt("return", result);
41222
- case 22:
40542
+ return _context26.abrupt("return", result);
40543
+ case 13:
41223
40544
  LOG$1.startTransaction({
41224
40545
  event: (_event = event) !== null && _event !== void 0 ? _event : 'onAddToBasket',
41225
40546
  message: 'Perform case: ' + ((_event2 = event) !== null && _event2 !== void 0 ? _event2 : 'onAddToBasket'),
@@ -41234,13 +40555,13 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41234
40555
  warningTime: 2000,
41235
40556
  errorTime: 4000
41236
40557
  });
41237
- _context27.t0 = this.divaBasketHandler;
41238
- _context27.t1 = this.divaBasketHandler.actDivaNr;
41239
- _context27.next = 27;
40558
+ _context26.t0 = this.divaBasketHandler;
40559
+ _context26.t1 = this.divaBasketHandler.actDivaNr;
40560
+ _context26.next = 18;
41240
40561
  return setHandlerInstance.fillOrderLinesAndOrderSets(this.sets, this.divaBasketHandler, !!repairOnly, this.doAllowSetPlanner(), this.ReturnTo);
41241
- case 27:
41242
- _context27.t2 = _context27.sent;
41243
- _context27.t0.setBasketData.call(_context27.t0, _context27.t1, _context27.t2);
40562
+ case 18:
40563
+ _context26.t2 = _context26.sent;
40564
+ _context26.t0.setBasketData.call(_context26.t0, _context26.t1, _context26.t2);
41244
40565
  if ((_returnTo2 = returnTo) !== null && _returnTo2 !== void 0 && _returnTo2.endsWith('OPEN_SELLER_BASKET')) {
41245
40566
  this.ReturnTo = 'OPEN_SELLER_BASKET';
41246
40567
  returnTo = this.ReturnTo;
@@ -41256,13 +40577,14 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41256
40577
  actBasket.Updated = Date.now();
41257
40578
  LOG$1.successTransaction('FILL_BASKET');
41258
40579
  if (!returnTo) {
41259
- _context27.next = 63;
40580
+ _context26.next = 55;
41260
40581
  break;
41261
40582
  }
41262
- _context27.t3 = returnTo;
41263
- _context27.next = _context27.t3 === 'OPEN_SELLER_PRODUCTCREATOR' ? 39 : _context27.t3 === 'OPEN_SELLER_BASKET' ? 41 : _context27.t3 === 'OPEN_PDF' ? 43 : _context27.t3 === 'SAVE_BASKET_WITH_MODAL' ? 43 : _context27.t3 === 'SAVE_BASKET' ? 43 : _context27.t3 === 'SAVE_BASKET_SYNC' ? 43 : _context27.t3 === 'OPEN_LEAFLET_BARRIER' ? 43 : 63;
40583
+ _context26.t3 = returnTo;
40584
+ _context26.next = _context26.t3 === 'OPEN_SELLER_PRODUCTCREATOR' ? 30 : _context26.t3 === 'OPEN_SELLER_BASKET' ? 33 : _context26.t3 === 'OPEN_PDF' ? 35 : _context26.t3 === 'SAVE_BASKET_WITH_MODAL' ? 35 : _context26.t3 === 'SAVE_BASKET' ? 35 : _context26.t3 === 'SAVE_BASKET_SYNC' ? 35 : _context26.t3 === 'OPEN_LEAFLET_BARRIER' ? 35 : 55;
41264
40585
  break;
41265
- case 39:
40586
+ case 30:
40587
+ (_this$actions31 = this.actions) === null || _this$actions31 === void 0 || _this$actions31.toggleLoading('buildScene', false, false);
41266
40588
  (_this$actions32 = this.actions) === null || _this$actions32 === void 0 || _this$actions32.openComponent({
41267
40589
  type: 'SELLER',
41268
40590
  parameters: {
@@ -41270,12 +40592,11 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41270
40592
  divaNr: actBasket.DivaNr
41271
40593
  },
41272
40594
  internal: {
41273
- basketData: actBasket,
41274
- edited: true
40595
+ basketData: actBasket
41275
40596
  }
41276
40597
  });
41277
- return _context27.abrupt("break", 63);
41278
- case 41:
40598
+ return _context26.abrupt("break", 55);
40599
+ case 33:
41279
40600
  (_this$actions33 = this.actions) === null || _this$actions33 === void 0 || _this$actions33.openComponent({
41280
40601
  type: 'SELLER',
41281
40602
  parameters: {
@@ -41286,37 +40607,37 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41286
40607
  basketData: actBasket
41287
40608
  }
41288
40609
  });
41289
- return _context27.abrupt("break", 63);
41290
- case 43:
40610
+ return _context26.abrupt("break", 55);
40611
+ case 35:
41291
40612
  if (!(event == 'onSaveProduct')) {
41292
- _context27.next = 53;
40613
+ _context26.next = 45;
41293
40614
  break;
41294
40615
  }
41295
40616
  //copy basket, so we only save a copy as baseconfiguration and can continue working with the original basket
41296
40617
  actBasket = new basketModel.BasketData(JSON.parse(JSON.stringify(actBasket)));
41297
- _context27.next = 47;
40618
+ _context26.next = 39;
41298
40619
  return DivaUtils__default["default"].updateBasketOrgInfo(actBasket, this.plannerConfig.currentOrganization, this.plannerConfig.currentUser);
41299
- case 47:
41300
- _context27.next = 49;
40620
+ case 39:
40621
+ _context26.next = 41;
41301
40622
  return this.api.getDataWithoutCache(this.api.getUniqueNewDivaNr(), undefined, 'basket');
41302
- case 49:
41303
- newDivaNr = _context27.sent;
40623
+ case 41:
40624
+ newDivaNr = _context26.sent;
41304
40625
  actBasket.convertToBaseConfiguration(newDivaNr.divaNr);
41305
- _context27.next = 62;
40626
+ _context26.next = 54;
41306
40627
  break;
41307
- case 53:
40628
+ case 45:
41308
40629
  if (this.divaBasketHandler.basketWasSavedWithCurrentDocVersion) {
41309
40630
  this.divaBasketHandler.basketWasSavedWithCurrentDocVersion = undefined;
41310
40631
  actBasket.setDocumentVersion(actBasket.getDocumentVersion() + 1);
41311
40632
  }
41312
40633
  this.divaBasketHandler.basketWasSavedWithCurrentDocVersion = true;
41313
40634
  actBasket.setDivaNr(this.divaBasketHandler.actDivaNr.split('-').length > 2 ? this.divaBasketHandler.actDivaNr.split('-')[0] + '-' + this.divaBasketHandler.actDivaNr.split('-')[1] : this.divaBasketHandler.actDivaNr);
41314
- _context27.next = 58;
40635
+ _context26.next = 50;
41315
40636
  return this.divaBasketHandler.saveToBasket(this.api, actBasket, returnTo);
41316
- case 58:
41317
- _result2 = _context27.sent;
40637
+ case 50:
40638
+ _result2 = _context26.sent;
41318
40639
  if (!(_result2 === 'ERROR_NO_BASKET_SAVED' || _result2 === 'ERROR_BASKET_AFTER_SAVE')) {
41319
- _context27.next = 62;
40640
+ _context26.next = 54;
41320
40641
  break;
41321
40642
  }
41322
40643
  LOG$1.errorTransaction((_event4 = event) !== null && _event4 !== void 0 ? _event4 : 'onAddToBasket', 'WC_0019', 'Error saving basket', {
@@ -41325,23 +40646,23 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41325
40646
  status: this.getBasketData().Status,
41326
40647
  bv: set.getSetPrice() / 1000
41327
40648
  });
41328
- return _context27.abrupt("return", 'canceled');
41329
- case 62:
41330
- return _context27.abrupt("break", 63);
41331
- case 63:
40649
+ return _context26.abrupt("return", 'canceled');
40650
+ case 54:
40651
+ return _context26.abrupt("break", 55);
40652
+ case 55:
41332
40653
  if (returnTo == 'DONT_SAVE_BASKET') event = 'dontSaveBasket';
41333
- _context27.next = 66;
40654
+ _context26.next = 58;
41334
40655
  return this.addToBasket(actBasket, event);
41335
- case 66:
41336
- product = _context27.sent;
41337
- return _context27.abrupt("return", product !== null && product !== void 0 ? product : 'saved');
41338
- case 68:
40656
+ case 58:
40657
+ product = _context26.sent;
40658
+ return _context26.abrupt("return", product !== null && product !== void 0 ? product : 'saved');
40659
+ case 60:
41339
40660
  case "end":
41340
- return _context27.stop();
40661
+ return _context26.stop();
41341
40662
  }
41342
- }, _callee27, this);
40663
+ }, _callee26, this);
41343
40664
  }));
41344
- function saveToBasket(_x68, _x69, _x70) {
40665
+ function saveToBasket(_x67, _x68, _x69) {
41345
40666
  return _saveToBasket.apply(this, arguments);
41346
40667
  }
41347
40668
  return saveToBasket;
@@ -41542,16 +40863,16 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41542
40863
  }, {
41543
40864
  key: "getEnableUnityRtvKombi",
41544
40865
  value: function getEnableUnityRtvKombi() {
41545
- var _this$actSet24;
40866
+ var _this$actSet24, _this$actSet25;
41546
40867
  // if force rtv disable unity kombi - biohort
41547
40868
  if ((_this$actSet24 = this.actSet()) !== null && _this$actSet24 !== void 0 && _this$actSet24.CatalogData.divaForceRTV) return false;
41548
- return this.api.getEnableRTVUnityKombi();
40869
+ return ((_this$actSet25 = this.actSet()) === null || _this$actSet25 === void 0 ? void 0 : _this$actSet25.CatalogData.divaArReady) == true && this.api.getEnableRTVUnityKombi();
41549
40870
  }
41550
40871
  }, {
41551
40872
  key: "getShelfPlannerRTV",
41552
40873
  value: function getShelfPlannerRTV() {
41553
- var _this$actSet25;
41554
- return (_this$actSet25 = this.actSet()) === null || _this$actSet25 === void 0 ? void 0 : _this$actSet25.CatalogData.useShelfPlannerRTV;
40874
+ var _this$actSet26;
40875
+ return (_this$actSet26 = this.actSet()) === null || _this$actSet26 === void 0 ? void 0 : _this$actSet26.CatalogData.useShelfPlannerRTV;
41555
40876
  }
41556
40877
  }, {
41557
40878
  key: "getBasketData",
@@ -41566,23 +40887,23 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41566
40887
  }, {
41567
40888
  key: "getBasketDataWithEkText",
41568
40889
  value: function () {
41569
- var _getBasketDataWithEkText = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee28() {
41570
- return _regeneratorRuntime__default["default"].wrap(function _callee28$(_context28) {
41571
- while (1) switch (_context28.prev = _context28.next) {
40890
+ var _getBasketDataWithEkText = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee27() {
40891
+ return _regeneratorRuntime__default["default"].wrap(function _callee27$(_context27) {
40892
+ while (1) switch (_context27.prev = _context27.next) {
41572
40893
  case 0:
41573
- _context28.t0 = this.divaBasketHandler;
41574
- _context28.t1 = this.divaBasketHandler.actDivaNr;
41575
- _context28.next = 4;
40894
+ _context27.t0 = this.divaBasketHandler;
40895
+ _context27.t1 = this.divaBasketHandler.actDivaNr;
40896
+ _context27.next = 4;
41576
40897
  return setHandlerInstance.fillOrderLinesAndOrderSets(this.sets, this.divaBasketHandler, true, this.doAllowSetPlanner(), this.ReturnTo);
41577
40898
  case 4:
41578
- _context28.t2 = _context28.sent;
41579
- _context28.t0.setBasketData.call(_context28.t0, _context28.t1, _context28.t2);
41580
- return _context28.abrupt("return", this.divaBasketHandler.actBasket);
40899
+ _context27.t2 = _context27.sent;
40900
+ _context27.t0.setBasketData.call(_context27.t0, _context27.t1, _context27.t2);
40901
+ return _context27.abrupt("return", this.divaBasketHandler.actBasket);
41581
40902
  case 7:
41582
40903
  case "end":
41583
- return _context28.stop();
40904
+ return _context27.stop();
41584
40905
  }
41585
- }, _callee28, this);
40906
+ }, _callee27, this);
41586
40907
  }));
41587
40908
  function getBasketDataWithEkText() {
41588
40909
  return _getBasketDataWithEkText.apply(this, arguments);
@@ -41592,8 +40913,8 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41592
40913
  }, {
41593
40914
  key: "getCatalogData",
41594
40915
  value: function getCatalogData() {
41595
- var _this$actSet26;
41596
- return (_this$actSet26 = this.actSet()) === null || _this$actSet26 === void 0 ? void 0 : _this$actSet26.CatalogData;
40916
+ var _this$actSet27;
40917
+ return (_this$actSet27 = this.actSet()) === null || _this$actSet27 === void 0 ? void 0 : _this$actSet27.CatalogData;
41597
40918
  }
41598
40919
  }, {
41599
40920
  key: "ReturnTo",
@@ -41608,7 +40929,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41608
40929
  }, {
41609
40930
  key: "addToBasket",
41610
40931
  value: function () {
41611
- var _addToBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee29(actBasket) {
40932
+ var _addToBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee28(actBasket) {
41612
40933
  var _this$actions34,
41613
40934
  _this$actions35,
41614
40935
  _this$actions36,
@@ -41627,14 +40948,14 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41627
40948
  to,
41628
40949
  variants,
41629
40950
  products,
41630
- _args29 = arguments;
41631
- return _regeneratorRuntime__default["default"].wrap(function _callee29$(_context29) {
41632
- while (1) switch (_context29.prev = _context29.next) {
40951
+ _args28 = arguments;
40952
+ return _regeneratorRuntime__default["default"].wrap(function _callee28$(_context28) {
40953
+ while (1) switch (_context28.prev = _context28.next) {
41633
40954
  case 0:
41634
- event = _args29.length > 1 && _args29[1] !== undefined ? _args29[1] : 'onAddToBasket';
40955
+ event = _args28.length > 1 && _args28[1] !== undefined ? _args28[1] : 'onAddToBasket';
41635
40956
  addToBasketLog = true;
41636
- _context29.t0 = event;
41637
- _context29.next = _context29.t0 === 'onWebPlanerPrint' ? 5 : _context29.t0 === 'onWebPlanerSave' ? 8 : _context29.t0 === 'onWebPlanerShare' ? 11 : _context29.t0 === 'onRequestConsulation' ? 14 : _context29.t0 === 'onSave' ? 17 : _context29.t0 === 'onSendEmail' ? 20 : _context29.t0 === 'onSaveProduct' ? 25 : _context29.t0 === 'dontSaveBasket' ? 33 : _context29.t0 === 'onAddToBasket' ? 35 : 35;
40957
+ _context28.t0 = event;
40958
+ _context28.next = _context28.t0 === 'onWebPlanerPrint' ? 5 : _context28.t0 === 'onWebPlanerSave' ? 8 : _context28.t0 === 'onWebPlanerShare' ? 11 : _context28.t0 === 'onRequestConsulation' ? 14 : _context28.t0 === 'onSave' ? 17 : _context28.t0 === 'onSendEmail' ? 20 : _context28.t0 === 'onSaveProduct' ? 25 : _context28.t0 === 'dontSaveBasket' ? 33 : _context28.t0 === 'onAddToBasket' ? 35 : 35;
41638
40959
  break;
41639
40960
  case 5:
41640
40961
  this.handleSuccessTransaction('onPrintBasket', actBasket);
@@ -41642,35 +40963,35 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41642
40963
  type: 'onWebPlanerPrint',
41643
40964
  data: actBasket.getAsJson()
41644
40965
  });
41645
- return _context29.abrupt("break", 38);
40966
+ return _context28.abrupt("break", 38);
41646
40967
  case 8:
41647
40968
  this.handleSuccessTransaction('onSaveBasket', actBasket);
41648
40969
  (_this$actions35 = this.actions) === null || _this$actions35 === void 0 || _this$actions35.onEvent({
41649
40970
  type: 'onWebPlanerSave',
41650
40971
  data: actBasket.getAsJson()
41651
40972
  });
41652
- return _context29.abrupt("break", 38);
40973
+ return _context28.abrupt("break", 38);
41653
40974
  case 11:
41654
40975
  this.handleSuccessTransaction('onShareBasket', actBasket);
41655
40976
  (_this$actions36 = this.actions) === null || _this$actions36 === void 0 || _this$actions36.onEvent({
41656
40977
  type: 'onWebPlanerShare',
41657
40978
  data: actBasket.getAsJson()
41658
40979
  });
41659
- return _context29.abrupt("break", 38);
40980
+ return _context28.abrupt("break", 38);
41660
40981
  case 14:
41661
40982
  this.handleSuccessTransaction('onRequestConsulation', actBasket);
41662
40983
  (_this$actions37 = this.actions) === null || _this$actions37 === void 0 || _this$actions37.onEvent({
41663
40984
  type: 'onRequestConsulation',
41664
40985
  data: actBasket.getAsJson()
41665
40986
  });
41666
- return _context29.abrupt("break", 38);
40987
+ return _context28.abrupt("break", 38);
41667
40988
  case 17:
41668
40989
  this.handleSuccessTransaction('onSave', actBasket);
41669
40990
  (_this$actions38 = this.actions) === null || _this$actions38 === void 0 || _this$actions38.onEvent({
41670
40991
  type: 'onSave',
41671
40992
  data: actBasket.getAsJson()
41672
40993
  });
41673
- return _context29.abrupt("break", 38);
40994
+ return _context28.abrupt("break", 38);
41674
40995
  case 20:
41675
40996
  emailConfig = (_this$divaBasketHandl3 = this.divaBasketHandler.emailConfig) !== null && _this$divaBasketHandl3 !== void 0 ? _this$divaBasketHandl3 : this.getEmailConfig(); //reset the emailConfig
41676
40997
  this.divaBasketHandler.emailConfig = undefined;
@@ -41706,23 +41027,23 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41706
41027
  type: 'onAddToBasket',
41707
41028
  data: actBasket.getAsJson()
41708
41029
  });
41709
- return _context29.abrupt("break", 38);
41030
+ return _context28.abrupt("break", 38);
41710
41031
  case 25:
41711
41032
  this.actSet().CatalogData;
41712
- _context29.next = 28;
41033
+ _context28.next = 28;
41713
41034
  return this.api.saveAsProduct(this.sets, actBasket);
41714
41035
  case 28:
41715
- products = _context29.sent;
41036
+ products = _context28.sent;
41716
41037
  this.handleSuccessTransaction('onSaveProduct', actBasket);
41717
41038
  (_this$actions40 = this.actions) === null || _this$actions40 === void 0 || _this$actions40.onEvent({
41718
41039
  type: 'onAddToBasket',
41719
41040
  data: actBasket.getAsJson()
41720
41041
  });
41721
41042
  if (!products) {
41722
- _context29.next = 33;
41043
+ _context28.next = 33;
41723
41044
  break;
41724
41045
  }
41725
- return _context29.abrupt("return", products[0]);
41046
+ return _context28.abrupt("return", products[0]);
41726
41047
  case 33:
41727
41048
  this.handleSuccessTransaction('onAddToBasketCallback', actBasket);
41728
41049
  addToBasketLog = false;
@@ -41732,16 +41053,16 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41732
41053
  type: 'onAddToBasket',
41733
41054
  data: actBasket.getAsJson()
41734
41055
  });
41735
- return _context29.abrupt("break", 38);
41056
+ return _context28.abrupt("break", 38);
41736
41057
  case 38:
41737
- return _context29.abrupt("return");
41058
+ return _context28.abrupt("return");
41738
41059
  case 39:
41739
41060
  case "end":
41740
- return _context29.stop();
41061
+ return _context28.stop();
41741
41062
  }
41742
- }, _callee29, this);
41063
+ }, _callee28, this);
41743
41064
  }));
41744
- function addToBasket(_x71) {
41065
+ function addToBasket(_x70) {
41745
41066
  return _addToBasket.apply(this, arguments);
41746
41067
  }
41747
41068
  return addToBasket;
@@ -42022,9 +41343,9 @@ var DivaWebPlanner = /*#__PURE__*/function () {
42022
41343
  key: "initApiForLogicOnly",
42023
41344
  value: //just for testing purposes
42024
41345
  function () {
42025
- var _initApiForLogicOnly = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee30(organization, lang, getSessionGuid, handler, applicationEnvironment, apiKey, jwt) {
42026
- return _regeneratorRuntime__default["default"].wrap(function _callee30$(_context30) {
42027
- while (1) switch (_context30.prev = _context30.next) {
41346
+ var _initApiForLogicOnly = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee29(organization, lang, getSessionGuid, handler, applicationEnvironment, apiKey, jwt) {
41347
+ return _regeneratorRuntime__default["default"].wrap(function _callee29$(_context29) {
41348
+ while (1) switch (_context29.prev = _context29.next) {
42028
41349
  case 0:
42029
41350
  //empty services
42030
41351
  this.api = new DivaApiHandler(_objectSpread$5(_objectSpread$5({}, this.plannerConfig), {}, {
@@ -42037,17 +41358,17 @@ var DivaWebPlanner = /*#__PURE__*/function () {
42037
41358
  jwt: jwt,
42038
41359
  apiKey: apiKey
42039
41360
  }), handler);
42040
- _context30.next = 3;
41361
+ _context29.next = 3;
42041
41362
  return this.divaBasketHandler.initWWSClient(this.api.getWWSClient());
42042
41363
  case 3:
42043
41364
  this.plannerHandler = new DivaPlannerHandler(true);
42044
41365
  case 4:
42045
41366
  case "end":
42046
- return _context30.stop();
41367
+ return _context29.stop();
42047
41368
  }
42048
- }, _callee30, this);
41369
+ }, _callee29, this);
42049
41370
  }));
42050
- function initApiForLogicOnly(_x72, _x73, _x74, _x75, _x76, _x77, _x78) {
41371
+ function initApiForLogicOnly(_x71, _x72, _x73, _x74, _x75, _x76, _x77) {
42051
41372
  return _initApiForLogicOnly.apply(this, arguments);
42052
41373
  }
42053
41374
  return initApiForLogicOnly;
@@ -42060,16 +41381,16 @@ var DivaWebPlanner = /*#__PURE__*/function () {
42060
41381
  }, {
42061
41382
  key: "loadBasket",
42062
41383
  value: function () {
42063
- var _loadBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee31() {
42064
- return _regeneratorRuntime__default["default"].wrap(function _callee31$(_context31) {
42065
- while (1) switch (_context31.prev = _context31.next) {
41384
+ var _loadBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee30() {
41385
+ return _regeneratorRuntime__default["default"].wrap(function _callee30$(_context30) {
41386
+ while (1) switch (_context30.prev = _context30.next) {
42066
41387
  case 0:
42067
- return _context31.abrupt("return", this.divaBasketHandler.initializeBasket(this.api));
41388
+ return _context30.abrupt("return", this.divaBasketHandler.initializeBasket(this.api));
42068
41389
  case 1:
42069
41390
  case "end":
42070
- return _context31.stop();
41391
+ return _context30.stop();
42071
41392
  }
42072
- }, _callee31, this);
41393
+ }, _callee30, this);
42073
41394
  }));
42074
41395
  function loadBasket() {
42075
41396
  return _loadBasket.apply(this, arguments);
@@ -42084,31 +41405,31 @@ var DivaWebPlanner = /*#__PURE__*/function () {
42084
41405
  }, {
42085
41406
  key: "initBasket",
42086
41407
  value: function () {
42087
- var _initBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee32(init3D, ignoreFavorites) {
41408
+ var _initBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee31(init3D, ignoreFavorites) {
42088
41409
  var _initSetState$api$web2;
42089
41410
  var initSetState, sets, result, _sets$, set, basket;
42090
- return _regeneratorRuntime__default["default"].wrap(function _callee32$(_context32) {
42091
- while (1) switch (_context32.prev = _context32.next) {
41411
+ return _regeneratorRuntime__default["default"].wrap(function _callee31$(_context31) {
41412
+ while (1) switch (_context31.prev = _context31.next) {
42092
41413
  case 0:
42093
41414
  this.divaNr = this.divaBasketHandler.actDivaNr;
42094
41415
  initSetState = this.getInitStateForSet(!init3D);
42095
41416
  this.plannerHandler.initPlanner(initSetState, this.getPlannerHandlerFunctions());
42096
- _context32.next = 5;
41417
+ _context31.next = 5;
42097
41418
  return setHandlerInstance.initSetsByOrderSet(this.divaBasketHandler.getOrderSetsByDivaNr(this.divaNr), initSetState);
42098
41419
  case 5:
42099
- sets = _context32.sent;
41420
+ sets = _context31.sent;
42100
41421
  if (!((_initSetState$api$web2 = initSetState.api.webConfig) !== null && _initSetState$api$web2 !== void 0 && _initSetState$api$web2.checkForProductsPrice)) {
42101
- _context32.next = 12;
41422
+ _context31.next = 12;
42102
41423
  break;
42103
41424
  }
42104
41425
  if (!this.divaBasketHandler.actBasket.OrigProductId) {
42105
- _context32.next = 12;
41426
+ _context31.next = 12;
42106
41427
  break;
42107
41428
  }
42108
- _context32.next = 10;
41429
+ _context31.next = 10;
42109
41430
  return this.divaBasketHandler.getProduct(this.api, this.divaBasketHandler.actBasket.OrigProductId);
42110
41431
  case 10:
42111
- result = _context32.sent;
41432
+ result = _context31.sent;
42112
41433
  if (result) {
42113
41434
  (_sets$ = sets[0]) === null || _sets$ === void 0 || _sets$.remindPriceForHash(result);
42114
41435
  }
@@ -42117,24 +41438,24 @@ var DivaWebPlanner = /*#__PURE__*/function () {
42117
41438
  set = this.actSet();
42118
41439
  setHandlerInstance.loadConfigStructureOfActSet(set, this.getCurPlannerType());
42119
41440
  if (!(favoritesHandlerInstance.FavoritesDefined(set) && !ignoreFavorites)) {
42120
- _context32.next = 17;
41441
+ _context31.next = 17;
42121
41442
  break;
42122
41443
  }
42123
- _context32.next = 17;
41444
+ _context31.next = 17;
42124
41445
  return this.handleFavorites(init3D ? 'CALC' : 'REPAIR');
42125
41446
  case 17:
42126
- _context32.next = 19;
41447
+ _context31.next = 19;
42127
41448
  return setHandlerInstance.fillOrderLinesAndOrderSets(this.sets, this.divaBasketHandler, !init3D, this.doAllowSetPlanner(), this.ReturnTo);
42128
41449
  case 19:
42129
- basket = _context32.sent;
42130
- return _context32.abrupt("return", basket);
41450
+ basket = _context31.sent;
41451
+ return _context31.abrupt("return", basket);
42131
41452
  case 21:
42132
41453
  case "end":
42133
- return _context32.stop();
41454
+ return _context31.stop();
42134
41455
  }
42135
- }, _callee32, this);
41456
+ }, _callee31, this);
42136
41457
  }));
42137
- function initBasket(_x79, _x80) {
41458
+ function initBasket(_x78, _x79) {
42138
41459
  return _initBasket.apply(this, arguments);
42139
41460
  }
42140
41461
  return initBasket;
@@ -42148,21 +41469,21 @@ var DivaWebPlanner = /*#__PURE__*/function () {
42148
41469
  }, {
42149
41470
  key: "getValidVariantsLength",
42150
41471
  value: function () {
42151
- var _getValidVariantsLength = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee33() {
41472
+ var _getValidVariantsLength = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee32() {
42152
41473
  var set;
42153
- return _regeneratorRuntime__default["default"].wrap(function _callee33$(_context33) {
42154
- while (1) switch (_context33.prev = _context33.next) {
41474
+ return _regeneratorRuntime__default["default"].wrap(function _callee32$(_context32) {
41475
+ while (1) switch (_context32.prev = _context32.next) {
42155
41476
  case 0:
42156
41477
  set = this.actSet();
42157
- _context33.next = 3;
41478
+ _context32.next = 3;
42158
41479
  return favoritesHandlerInstance.getValidVariants(set, true);
42159
41480
  case 3:
42160
- return _context33.abrupt("return", _context33.sent.length);
41481
+ return _context32.abrupt("return", _context32.sent.length);
42161
41482
  case 4:
42162
41483
  case "end":
42163
- return _context33.stop();
41484
+ return _context32.stop();
42164
41485
  }
42165
- }, _callee33, this);
41486
+ }, _callee32, this);
42166
41487
  }));
42167
41488
  function getValidVariantsLength() {
42168
41489
  return _getValidVariantsLength.apply(this, arguments);
@@ -42172,46 +41493,46 @@ var DivaWebPlanner = /*#__PURE__*/function () {
42172
41493
  }, {
42173
41494
  key: "handleFavorites",
42174
41495
  value: function () {
42175
- var _handleFavorites = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee34(mode) {
41496
+ var _handleFavorites = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee33(mode) {
42176
41497
  var _this4 = this;
42177
41498
  var set, i;
42178
- return _regeneratorRuntime__default["default"].wrap(function _callee34$(_context34) {
42179
- while (1) switch (_context34.prev = _context34.next) {
41499
+ return _regeneratorRuntime__default["default"].wrap(function _callee33$(_context33) {
41500
+ while (1) switch (_context33.prev = _context33.next) {
42180
41501
  case 0:
42181
41502
  set = this.actSet();
42182
41503
  i = 0;
42183
41504
  case 2:
42184
41505
  if (!favoritesHandlerInstance.IsCalcForSummary) {
42185
- _context34.next = 11;
41506
+ _context33.next = 11;
42186
41507
  break;
42187
41508
  }
42188
- _context34.next = 5;
41509
+ _context33.next = 5;
42189
41510
  return DivaUtils__default["default"].Sleep(200);
42190
41511
  case 5:
42191
41512
  i++;
42192
41513
  if (!(i > 1000)) {
42193
- _context34.next = 9;
41514
+ _context33.next = 9;
42194
41515
  break;
42195
41516
  }
42196
41517
  LOG$1.error(new DivaUtils.DivaError('error on generating Variants of Summary'));
42197
- return _context34.abrupt("break", 11);
41518
+ return _context33.abrupt("break", 11);
42198
41519
  case 9:
42199
- _context34.next = 2;
41520
+ _context33.next = 2;
42200
41521
  break;
42201
41522
  case 11:
42202
- _context34.next = 13;
41523
+ _context33.next = 13;
42203
41524
  return favoritesHandlerInstance.handleFavorites(set, mode, this.divaBasketHandler.actBasket, this.saveToBasketWrapper.bind(this), this.doConfigure.bind(this), function () {
42204
41525
  return _this4.update2DGrid(set);
42205
41526
  }, this.actions);
42206
41527
  case 13:
42207
- return _context34.abrupt("return", _context34.sent);
41528
+ return _context33.abrupt("return", _context33.sent);
42208
41529
  case 14:
42209
41530
  case "end":
42210
- return _context34.stop();
41531
+ return _context33.stop();
42211
41532
  }
42212
- }, _callee34, this);
41533
+ }, _callee33, this);
42213
41534
  }));
42214
- function handleFavorites(_x81) {
41535
+ function handleFavorites(_x80) {
42215
41536
  return _handleFavorites.apply(this, arguments);
42216
41537
  }
42217
41538
  return handleFavorites;
@@ -42224,48 +41545,48 @@ var DivaWebPlanner = /*#__PURE__*/function () {
42224
41545
  }, {
42225
41546
  key: "initSapOrderLinesFromBasket",
42226
41547
  value: function () {
42227
- var _initSapOrderLinesFromBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee35(divaNr, init3D, onlyLoadOldBakset) {
41548
+ var _initSapOrderLinesFromBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee34(divaNr, init3D, onlyLoadOldBakset) {
42228
41549
  var result, oldBasket, basket;
42229
- return _regeneratorRuntime__default["default"].wrap(function _callee35$(_context35) {
42230
- while (1) switch (_context35.prev = _context35.next) {
41550
+ return _regeneratorRuntime__default["default"].wrap(function _callee34$(_context34) {
41551
+ while (1) switch (_context34.prev = _context34.next) {
42231
41552
  case 0:
42232
41553
  if (divaNr) this.divaBasketHandler.updateDivaNrInBasket(divaNr);
42233
- _context35.next = 3;
41554
+ _context34.next = 3;
42234
41555
  return this.loadBasket();
42235
41556
  case 3:
42236
- result = _context35.sent;
41557
+ result = _context34.sent;
42237
41558
  if (!onlyLoadOldBakset) {
42238
- _context35.next = 6;
41559
+ _context34.next = 6;
42239
41560
  break;
42240
41561
  }
42241
- return _context35.abrupt("return", {
41562
+ return _context34.abrupt("return", {
42242
41563
  oldBasket: new basketModel.BasketData(JSON.parse(JSON.stringify(this.divaBasketHandler.actBasket))),
42243
41564
  cache: {}
42244
41565
  });
42245
41566
  case 6:
42246
41567
  if (!(result === false)) {
42247
- _context35.next = 8;
41568
+ _context34.next = 8;
42248
41569
  break;
42249
41570
  }
42250
41571
  throw new Error('Could not load basket! ' + divaNr);
42251
41572
  case 8:
42252
41573
  oldBasket = new basketModel.BasketData(JSON.parse(JSON.stringify(this.divaBasketHandler.actBasket)));
42253
- _context35.next = 11;
41574
+ _context34.next = 11;
42254
41575
  return this.initBasket(init3D);
42255
41576
  case 11:
42256
- basket = _context35.sent;
42257
- return _context35.abrupt("return", {
41577
+ basket = _context34.sent;
41578
+ return _context34.abrupt("return", {
42258
41579
  basket: basket,
42259
41580
  oldBasket: oldBasket,
42260
41581
  cache: this.api.getJsonDataCache()
42261
41582
  });
42262
41583
  case 13:
42263
41584
  case "end":
42264
- return _context35.stop();
41585
+ return _context34.stop();
42265
41586
  }
42266
- }, _callee35, this);
41587
+ }, _callee34, this);
42267
41588
  }));
42268
- function initSapOrderLinesFromBasket(_x82, _x83, _x84) {
41589
+ function initSapOrderLinesFromBasket(_x81, _x82, _x83) {
42269
41590
  return _initSapOrderLinesFromBasket.apply(this, arguments);
42270
41591
  }
42271
41592
  return initSapOrderLinesFromBasket;
@@ -42290,6 +41611,11 @@ var DivaWebPlanner = /*#__PURE__*/function () {
42290
41611
  }
42291
41612
  return undefined;
42292
41613
  }
41614
+ }, {
41615
+ key: "setsAsArray",
41616
+ get: function get() {
41617
+ return Object.values(this.sets);
41618
+ }
42293
41619
 
42294
41620
  /**
42295
41621
  * This function returns the planner mode.
@@ -60223,7 +59549,7 @@ var ProductHandler = /*#__PURE__*/function () {
60223
59549
  }, {
60224
59550
  key: "isSameProduct",
60225
59551
  value: function isSameProduct(product, setHash, diva3dProject, orderLines, varinatData, catalogCodex) {
60226
- var _product$articles;
59552
+ var _product$articles, _product$configuratio, _product$configuratio2;
60227
59553
  //For new products we store the setHash and hqRenderScript in order to determine if the product changed.
60228
59554
  if (product.uniqueHash !== undefined) {
60229
59555
  return product.uniqueHash === 'v1' + setHash + DivaUtils.md5(diva3dProject);
@@ -60234,22 +59560,22 @@ var ProductHandler = /*#__PURE__*/function () {
60234
59560
  return false;
60235
59561
  }
60236
59562
  //For older products without setHash we use the old comparison logic
59563
+ var orderlines = (_product$configuratio = (_product$configuratio2 = product.configuration) === null || _product$configuratio2 === void 0 || (_product$configuratio2 = _product$configuratio2.OrderSets) === null || _product$configuratio2 === void 0 ? void 0 : _product$configuratio2[0].OrderLines) !== null && _product$configuratio !== void 0 ? _product$configuratio : [];
60237
59564
  var _loop = function _loop() {
60238
- var _article$variantValue;
60239
- var article = product.articles[i];
59565
+ var article = orderlines[i];
60240
59566
  var orderLine = orderLines.find(function (ol) {
60241
- return ol.ArticleCodex == article.articleCodex && catalogCodex == article.catalogCodex;
59567
+ return ol.ArticleCodex == article.ArticleCodex && catalogCodex == article.CatalogCodex;
60242
59568
  });
60243
- if (!orderLine || ((_article$variantValue = article.variantValues) === null || _article$variantValue === void 0 ? void 0 : _article$variantValue.length) != (varinatData === null || varinatData === void 0 ? void 0 : varinatData.length)) {
59569
+ if (!orderLine) {
60244
59570
  return {
60245
59571
  v: false
60246
59572
  };
60247
59573
  }
60248
59574
  var _loop2 = function _loop2() {
60249
- var varinatValue = article.variantValues[j];
60250
- if (!(varinatData !== null && varinatData !== void 0 && varinatData.find(function (vb) {
59575
+ var varinatValue = article.VariantBasketDatas[j];
59576
+ if (!varinatData.find(function (vb) {
60251
59577
  return vb.OPT == varinatValue['OPT'] && vb.OPV == varinatValue['OPV'];
60252
- }))) {
59578
+ })) {
60253
59579
  return {
60254
59580
  v: {
60255
59581
  v: false
@@ -60258,14 +59584,14 @@ var ProductHandler = /*#__PURE__*/function () {
60258
59584
  }
60259
59585
  },
60260
59586
  _ret2;
60261
- for (var j = 0; j < (((_article$variantValue2 = article.variantValues) === null || _article$variantValue2 === void 0 ? void 0 : _article$variantValue2.length) || 0); j++) {
60262
- var _article$variantValue2;
59587
+ for (var j = 0; j < (((_article$VariantBaske = article.VariantBasketDatas) === null || _article$VariantBaske === void 0 ? void 0 : _article$VariantBaske.length) || 0); j++) {
59588
+ var _article$VariantBaske;
60263
59589
  _ret2 = _loop2();
60264
59590
  if (_ret2) return _ret2.v;
60265
59591
  }
60266
59592
  },
60267
59593
  _ret;
60268
- for (var i = 0; i < product.articles.length; i++) {
59594
+ for (var i = 0; i < orderlines.length; i++) {
60269
59595
  _ret = _loop();
60270
59596
  if (_ret) return _ret.v;
60271
59597
  }
@@ -60805,7 +60131,6 @@ exports.DockingPoint = DockingPoint;
60805
60131
  exports.Grid = Grid;
60806
60132
  exports.HQRenderScript = HQRenderScript;
60807
60133
  exports.OptionCatalogData = OptionCatalogData;
60808
- exports.Product = Product;
60809
60134
  exports.Rendering = Rendering;
60810
60135
  exports.Vector2 = Vector2;
60811
60136
  exports.Vector3 = Vector3;
@@ -60814,6 +60139,5 @@ exports.articleHandlerInstance = articleHandlerInstance;
60814
60139
  exports.creatRenderOrders = creatRenderOrders;
60815
60140
  exports.getOrigProductId = getOrigProductId;
60816
60141
  exports.loadAndRepairBasket = loadAndRepairBasket;
60817
- exports.productHandlerInstance = productHandlerInstance;
60818
60142
  exports.setHandlerInstance = setHandlerInstance;
60819
60143
  exports.summaryHandlerInstance = summaryHandlerInstance;